Skip to content

Consider distributing a single set of stylesheets for all languages #165

@JayPanoz

Description

@JayPanoz

At the moment, ReadiumCSS ships with different stylesheets for LTR+Latin, RTL, CJK, and CJK + vertical-writing. This means apps have to implement some logic to load the proper set of stylesheets, as described in the dist ReadMe.

While we initially decided to not go with CSS logical properties in April 2024 while rekindling the project for v2 (see issue #137), this choice may need to be revisited as it will simplify things quite a bit, although it’s a massive breaking change – we already have significant breaking changes though e.g. removing auto-pagination, page margins, etc.

What would it mean if we decide to attempt this?

  • replacing all physical properties with logical properties
  • using dir and lang when it is required to make things work – to be fair we’re already doing that in some modules
  • providing all user settings submodules in the single set, even if they should not apply to all languages, which results in a slightly heavier after stylesheet
  • a significant effort re. documentation – that may actually require more work than updating the CSS
  • extending the beta testing period by a fair bit, in order to make sure we did not create new bugs and issues
  • additional work for consumers who have already migrated to v2
  • updating support (see CanIUse)

The main benefits would be:

  • less complexity at the ReadiumCSS level, by removing modules specific to vertical-writing, and removing 3 variants of dist stylesheets, significantly reducing the codebase
  • less complexity at the apps’ injection level, since you don’t have to inject the correct variant based on conditions – although these conditions would remain for a handful of user settings
  • no filtering of user settings may eventually be a benefit as we’ve seen settings required for some variants that did not initially import them – app developers would not have to do a feature request here, but simply implement the setting

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions