Giter VIP home page Giter VIP logo

Comments (2)

JayPanoz avatar JayPanoz commented on June 11, 2024

A small update: we’re using CSS variables in the iOS implementation, for both flags and updated values, with inheritance kicking in whenever possible.

Which means that if you need it to be cross-platform, flags can be custom data-* attributes, most values can be appended as inline styles on html and some other user-settings can once again be custom data-* attributes, with preset values.

For instance

<html style="font-size: 200%; font-family: Seravek, sans-serif" data-reading-mode="night" data-user-margins="xl"> 

So you should still be able to manage everything in the same place: the html tag. I’ve made sure that our approach could quickly turn to fallbacks if needed when we started designing it.

Of course it requires you edit stylesheets’ selectors a little bit (user settings) but you should get ± the same performance as the one we can currently get in iOS.

from readium-css.

JayPanoz avatar JayPanoz commented on June 11, 2024

So to put it simply:

  1. Most of ReadiumCSS should work if you build a static representation (using the postcss-css-variables plugin, as described in the PostCSS doc), so you can definitely use it;
  2. user settings won’t though, so you’ll have to implement that using JS for instance.

In other words, change the custom selectors to manage reading modes, flags (advanced settings) and use either custom attributes or classes, then manage user preferences using JS (you can test for CSS variables using JS, as explained in the CSS variables doc).

There is little chance this decision will be reversed in the future as it’s a lot of work for a small usage and user settings fallbacks were partial, and subpar, especially as we removed support for Android 4.x.x.

You can still use this issue for questions though.

from readium-css.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.