Looking for a way to control CSS with a cookie:
- Want the user's style choice to stick until they change it or the cookie expires
- Avoid any default styling issues when the user returns
- Avoid using jquery, libraries, or frameworks
- Need compatibility with IE, Firefox, Chrome, Opera, Safari on Windows; Safari, Firefox, and Chrome on MacOS; Safari on iOS; Firefox and Chrome on Linux)
- Link web fonts to a specific @class attribute
- Ensure buttons resize to fit text value
- Add a checkbox to switch styles and display cookie status
Initially thought of applying an onload handler to the <body> element. Other options include:
- Using
document.write
to dynamically create <link>s in the <head> - sitewizard.com uses multiple small stylesheets that users can switch between
Seeking advice on selecting a strategy that is easy to implement, maintain, and offers desired functionality across supported browsers.