Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This is a lot more work than I initially thought. A couple caveats with the postcssLogical plugin.
It can't handle transform: translatex(x). PostCSS RTL did this automatically.
It doesn't automatically handle margin shorthand CSS property. This doesn't seem to work with the logical properties, and the margin-block and margin-inline shortcut syntax doesn't seem to work with this.
It doesn't handle things like box shadows, linear gradients, etc. PostCSS RTL did this automatically.
Comments
Comment #2
mherchelComment #3
mherchelStarted working on this a bit with https://github.com/csstools/stylelint-use-logical
Used the
--fix
command to automatically convert the syntax.Changes are pushed up to https://git.drupalcode.org/project/olivero/-/commits/css-logical-properties
Tugboat preview for this branch is at https://css-logical-properties-ugcf7gjd8lxjvfdkwe13zx5h0jaqn5hl.tugboat.qa/
The preview is fairly broken in the latest stable Chrome because of lack of support, but much better in Chrome Canary.
Comment #4
mherchelNext step is to integrate PostCSS processors to see if it can fix everything for IE11.
Comment #5
mherchelI think I have this working!
I added postcssLogical and postcssDirPseudoClass plugins (see https://git.drupalcode.org/project/olivero/-/commit/654451011d2b9751b823...), and then had to refactor out
inset-start
andinset-end
, which were not supported (see https://git.drupalcode.org/project/olivero/-/commit/4508f47f63cdca000bde...).I added visual diffs to the tugboat repo to catch any issues (https://git.drupalcode.org/project/olivero/-/commit/ce1ea1e19a164a78e696...), but we'll still need to do plenty of testing in RTL mode!
Comment #6
mherchelThis is a lot more work than I initially thought. A couple caveats with the postcssLogical plugin.
transform: translatex(x)
. PostCSS RTL did this automatically.margin
shorthand CSS property. This doesn't seem to work with the logical properties, and themargin-block
andmargin-inline
shortcut syntax doesn't seem to work with this.Comment #7
mherchelComment #8
mherchelComment #10
mherchel