-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inject user settings in non-FXL HTML resources #101
Comments
So to sum things up:
And that’s pretty much it. Adding settings to the A question though: currently all user settings are persistent across ebooks. Do we want to keep it that way or reserve persistence to some settings – in which case, we could have a mapping to the user overrides classification. |
From a model perspective, these will separate values. At an "app" level (the test app in our case), we could certainly be a little smarter though and tie several values together. |
Yeah definitely. Perhaps the most important is that the flag for advanced settings is shared so if one advanced user setting is already using it, you’re good to go for others requiring it. [edit] Clarify which flag is shared. |
If UserProperties.css= "color: blue;" |
Hmm,
and
are indeed more or less the same thing but we’re not doing that in ReadiumCSS, although that’s an option should an implementer use another CSS library. Currently, what we’re doing is something like:
So that’s
in the new user settings model. ReadiumCSS is indeed using the The alternative being injecting the entire styles for each setting via |
Took some extra look at the model on the r2 repo and just recording my thoughts but… If developers want to use |
I think the way we inject |
Yeah will open an issue in ReadiumCSS as well, as the “build” process currently covers only one case i.e. setting inline styles on |
Post Engineering Call Recap We have 3 different options there:
We’re currently using option 3. It’s worth noting option 1 and 2 still require custom properties to be set. Here’s the pros and cons for each option. Injecting stylesheets using It’s basically about using a static representation* of ReadiumCSS user settings submodules dynamically. You append a * Those have to be “compiled” using an altered version of our PostCSS config first. For the pref to work, you still need to use CSS custom properties for settings which value can be incremented/decrement and/or CSS classes for static values e.g. reading modes. Examples
or
Pros:
Cons:
injecting styles using It’s basically about writing styles directly in the DOM instead of linking to a css file. You append a For the pref to work, you still need to use CSS custom properties for settings which value can be incremented/decrement and/or CSS classes for static values e.g. reading modes. Examples
Note that’s the simplest example, most user settings have much larger styles to write. Pros:
Cons:
injecting inline styles i.e. It’s basically about adding, updating and removing custom properties in the Examples
Pros:
Cons:
Please feel free if I missed anything or if it’s unclear. Lists of pros and cons are by no means exhaustive so please feel free to add items to them. |
Based on the work on a new user settings model, we'll also need to start injecting them as well at a streamer level.
As far as I can tell, this will only be the case for non-FXL resources, which means that before anything is injected we'll need to check:
properties
)If we don't have a link-level helper for that, this would be a good time to implement something (for instance
link.fxl?
that returns a boolean).Once we've established that a resource is HTML and non-FXL, we can then proceed to injecting these user settings.
I'll let @JayPanoz chime in on the best way of injecting these CSS Custom Properties but basically:
name
for the CSS property namevalue
for the CSS property valueSerializing this to CSS Custom Properties should be fairly trivial.
The text was updated successfully, but these errors were encountered: