Storing fonts, css changes throughout site

Hello!

I have a question regarding building some accessibility features for a website I’m working on.

The client works in the accessibility industry and there’s features they would like to add for example “if a user would prefer to read the site with the Dyslexia pro font, they would press a button and the website would store that change for that user or if they want the font size larger they could choose to do that”.

Would this be possible to do in Jekyll if so where would these changes store so that it would cache for that user?

jekyll is just a static site builder - there is no database to store anything, and once built it is what it is until you build it again. I’d guess you could add some javascript to store settings in local storage and then check for that but you’d probably have to do that on every page (I’m not sure exactly how you would do this).

I’d say technically this may be possible but I have not seen any examples of something like this.

I’d think there are best practices on how to do this and there maybe you could find what tech they use to make a site that handles that type of thing.

Like @rdyar said, I’d use Javascript (specifically the CSS Object Model) to alter the stylesheets on the browser side, and use the Web Storage API to persist user preferences. To make your Javascript run on every page, you can include it from your base Jekyll layout. Using layout inheritance, you should be able to use several layouts while keeping your <script> tags in a single base layout.

Let us know if you need additional resources/tutorials to get you started.

Keep in mind this is not how you usually build an accessible website. People who need accessibility features generally browse the internet using dedicated software that implement these features. Your job regarding accessibility, as a web dev, is to build websites that are compatible with these softwares by following HTML best practices. As usual, the MDN is a great reference to get started on this topic