Comments

mherchel created an issue. See original summary.

mherchel’s picture

Status: Active » Postponed
mherchel’s picture

Started 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.

mherchel’s picture

Assigned: Unassigned » mherchel

Next step is to integrate PostCSS processors to see if it can fix everything for IE11.

mherchel’s picture

I 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 and inset-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!

mherchel’s picture

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.
mherchel’s picture

Title: Evaluate the user of CSS logical properties for RTL support » Convert codebase to use CSS logical properties for RTL support
mherchel’s picture

Status: Active » Reviewed & tested by the community
FileSize
479.6 KB

  • mherchel committed 731b9be on 8.x-1.x
    Issue #3095673 by mherchel: Convert codebase to use CSS logical...
mherchel’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.