In #3312481: Update core's browserlist we updated the browserlist database which determines what CSS properties PostCSS will transpile. With this update, Drupal core is not transpiling any logical properties.

However, there are certain properties which our supported browsers do not support, including flow relative properties such as `float: inline-end`, and `clear: inline-start`. You can see current browser support for these properties at https://caniuse.com/mdn-css_properties_clear_flow_relative_values.

The Chromium issue to implement this is at https://bugs.chromium.org/p/chromium/issues/detail?id=850004. I can’t find the webkit issue.

I created an upstream bug for PostCSS Logical at https://github.com/csstools/postcss-plugins/issues/632

Edit after the fact

This will likely never be fixed within PostCSS. I created an issue upstream at https://github.com/csstools/postcss-plugins/issues/958, where I discovered that PostCSS Logical doesn't compile to both RTL and LTR anymore. You have to pick one or the other (this is new to version 8 of PostCSS Logical). This doesn't affect Drupal except within the float and clear properties. We'll have to manually add the dir attributes when using those.

Task

It'd be nice if either 1) this could be fixed upstream or 2) we could set PostCSS Logical to always transpile these values. But, for now, I think we need to change the float values to use non-logical CSS properties. This should be an easy task, as they're only used in a few places within Olivero.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mherchel created an issue. See original summary.

mherchel’s picture

Issue summary: View changes
mherchel’s picture

Issue summary: View changes
mherchel’s picture

Status: Active » Needs review
FileSize
11.99 KB

Patch posted. This affects both the Olivero theme and Workspaces module.

andy-blum’s picture

FileSize
12.01 KB

Code changes look good, but the CSS failed linting due some indentation problems. Fixed those and adding a new patch.

ckrina’s picture

Status: Needs review » Reviewed & tested by the community

I just tested it and LGTM!

alexpott’s picture

Version: 10.1.x-dev » 10.0.x-dev
Status: Reviewed & tested by the community » Fixed

This makes me sad as logical properties are so nice... but hey ho...

Committed and pushed 33c59bbc68 to 10.1.x and 7e8c3b8bb1 to 10.0.x. Thanks!

  • alexpott committed 33c59bb on 10.1.x
    Issue #3313146 by mherchel, andy-blum:  PostCSS Logical not transpiling...

  • alexpott committed 7e8c3b8 on 10.0.x
    Issue #3313146 by mherchel, andy-blum:  PostCSS Logical not transpiling...
Wim Leers’s picture

Status: Fixed » Needs work
Issue tags: +Needs change record updates

Shouldn't this update https://www.drupal.org/node/3312967? 🤔

mherchel’s picture

Status: Needs work » Fixed
Issue tags: -Needs change record updates

You're right. Change record is updated!

mherchel’s picture

Applying credit to @ckrina who reviewed the patch.

Status: Fixed » Closed (fixed)

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

mherchel’s picture

Issue summary: View changes

Adding note to IS about upstream issue:

This will likely never be fixed within PostCSS. I created an issue upstream at https://github.com/csstools/postcss-plugins/issues/958, where I discovered that PostCSS Logical doesn't compile to both RTL and LTR anymore. You have to pick one or the other (this is new to version 8 of PostCSS Logical). This doesn't affect Drupal except within the float and clear properties. We'll have to manually add the dir attributes when using those.

mherchel’s picture

Note here for posterity: Browsers now support flow relative logical properties. See https://caniuse.com/mdn-css_properties_clear_flow_relative_values