-
Notifications
You must be signed in to change notification settings - Fork 20
User Settings and Reading Modes
We’ll probably have to build an “interceptor” CSS to sanitize CSS authors before applying user styles.
Ideally, it could be done using selectors’ specificity and the cascade (loading interceptor and styles after the author’s stylesheets), but it will be up to authors to play nicely since everything will be documented.
Adding classes or attributes in the DOM might prove problematic since authors may find and use them to design all kind of weird hacks. It will be more reasonable to let future implementers decide if they want to do that, without imposing something which could become a technical debt at some point.
Managing settings with CSS custom properties (a.k.a. CSS variables) would have been a great option since it solves many issues with little effort… but IE and Android are problematic.
Another possibility is to create a random class on the fly, so that we can scope stricter rules for stuff we must enforce, especially when it comes to a11y (Open Dyslexic, etc.).
As for reading modes, we probably can’t use a global filter
, for various reasons (performance, mediocre text rendering, etc.).
Borders and colors might prove to be be challenging (it’s all or nothing) but we can at least try to manage images’ backgrounds.
There will be some complex issues we can’t manage efficiently on the RS side. Maybe we could discuss and research some kind of “Public API” as a reasonable compromise.
For example, authors could request the Reading System to invert images or borders in night mode. This would need feedback from both implementers and authors though.
This list is non exhaustive.
- one page || two-page spread
- page margins
- typeface
- font size
- reading mode (
background-color
+color
)