Theming improvements#163
Merged
Merged
Conversation
For theming and filters + remove smartphone viewport since we don’t need to test MQ/breakpoints anymore.
There are way too many occurrences where a colored heading may become illegible because it doesn’t offer enough contrast with the background-color, so let’s only protect pre and not try to be too smart.
Will override the same styles when --USER__textColor is set
Collaborator
Author
|
This has been successfully deployed on Readium Playground and has significant improvements that should make life easier for implementers. Here’s the closed PR if you want to take a look and see how you can benefit from these changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Exposing these modifications early so that people have time to check and review while I stress-test them in Readium Playground.
Please check if the PR fulfills these requirements:
(Add x between brackets to check.)
What kind of change does this PR introduce? (Bug fix, feature, docs update, other)
This resolves #159 and closes #160.
To recap:
::selection(background and text) if they are set on:rootusing their--RS__-prefixed dedicated custom properties/variables;What is the current behaviour? (You can also link to an open issue here)
Currently you have to build upon sepia or night mode, and override all their colors if you want to benefit from their specific features.
The motivation is to make it easier for developers to build custom theme w/o having to rely on ReadiumCSS’ modes and introduce an extra layer of abstraction/cascade.
What is the new behaviour?
When set, ReadiumCSS will apply the styles, no matter the current reading mode (day, sepia, night).
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
Not that I am aware of. Older preset flags have been kept in the new imageFilters submodule to avoid breaking changes so value
readium-invert-onfor instance, should continue to work if your app has been implementing the invert filter for images in night mode. The differences are:Does not apply to enforcing colors in the theming submodule as this change should be considered a fix.
Other information:
If you are dealing with Japanese books containing gaiji, you’ll need to handle that manually when applying a dark theme since it can’t be automated from CSS. It will still work in night mode though, so no need to add it if you are using this reading mode through
--USER__appearance: readium-night-on.