1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/guides/rails_guides
Jonathan Hefner 23d0cd6f6f Unify LTR / RTL CSS for guides
When `main.css` is updated, it is easy for `main.rtl.css` to be
overlooked (see #45423).

This commit eliminates `main.rtl.css` in favor of a unified approach to
LTR / RTL styling in `main.css`.  To accomplish this, the `<body>`
element is rendered with a [`dir` attribute][] (which has the same
effect as setting the CSS `direction` property), and LTR- / RTL-specific
styles are prefixed with `:where(body[dir="..."])` selectors.  (The
[`:where()` pseudo-class][] ensures that selector specificity is not
changed.)

This change also paves the way for automatic detection and application
of LTR / RTL styles when the [`:dir()` pseudo-class][] gains widespread
browser support.

[`dir` attribute]: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir
[`:where()` pseudo-class]: https://developer.mozilla.org/en-US/docs/Web/CSS/:where
[`:dir()` pseudo-class]: https://developer.mozilla.org/en-US/docs/Web/CSS/:dir
2022-06-22 16:42:48 -05:00
..
markdown Render copy-to-clipboard text in element attribute [ci-skip] 2021-07-23 12:52:10 -05:00
generator.rb Unify LTR / RTL CSS for guides 2022-06-22 16:42:48 -05:00
helpers.rb Cleanup credits related code as it is removed now in PR #32429 2018-04-03 15:19:57 +05:30
kindle.rb use ruby 2.7's filter_map instead of select + map 2021-04-26 17:55:33 -04:00
markdown.rb feat(rubocop): Add Style/RedundantRegexpEscape 2020-12-08 18:57:09 +00:00