Skip to content

fix: preserve logical CSS cascade and upgrade postcss-logical to v9 - #1

Merged
oe merged 6 commits into
mainfrom
fix/maintenance-compatibility
Oct 3, 2026
Merged

oe merged 6 commits into
mainfrom
fix/maintenance-compatibility

Conversation

@oe

@oe oe commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

Direction-rule optimization could change CSS cascade results. For example, .x { margin-inline-start: 10px; margin: 0 } rendered with a 10px left margin in LTR after compilation, although native CSS renders 0px. Gradient replacement also rewrote names such as var(--inline-start) and url("inline-start.png"), and text-based direction detection misclassified negation and quoted attribute values.

Resolve duplicate physical declarations by importance and source order. Keep common declarations shared, while retaining overlapping shorthand/longhand dependencies in the relevant direction rules at their winning source positions. This preserves cascade results without introducing repeated property names within an optimized rule. Fix the existing border-inline fixture: its later width/style/color declarations must remain effective after direction-specific border shorthands. The plugin API and default options stay unchanged.

Use selector and value parsers to preserve selector conditions, custom-property names and strings. Handle repeated/chained/escaped custom markers and configured selector lists. Keep prefixed keyframes intact, retain unexpanded nested rules with a preprocessing warning, preserve rule comments and accurately map generated declarations to their original source lines. Handle function values, comments, invalid scroll shorthands and case-insensitive CSS property/value spellings.

Align the advertised requirements with the existing postcss-logical dependency (Node >=20.19.0, PostCSS ^8.4). Update README, technical docs and CHANGELOG, including nesting, horizontal writing mode and direction-selector specificity constraints. Clarify who needs a dual-direction logical-property polyfill and compare native CSS, fixed-direction compilation and RTL mirroring. Add ESM and explicit HTML direction setup, repair documentation links and incorrect integration options, and update npm metadata. Configure the documentation site URL to generate its sitemap. Upgrade postcss-logical to ^9.0.2, preserving our CommonJS and ES module entry points. Forward upstream warnings to the outer PostCSS result and deduplicate direction-pass warnings. Correct documentation about existing transition support. CI tests Node 20.19.0/22/24, uses packageManager-pinned pnpm and frozen installs, checks packed consumers and browser cascade, and deploys documentation only on main pushes. The two parser dependencies are explicitly declared; Playwright core is a development dependency and uses the installed Chromium/Chrome browser.

Validation:

  • 406 tests pass on Node 20.19.0, including three v9 integration cases for logical transitions and the upstream expansion-limit warning; the prior 403-test suite also passed on Node 22/24.
  • 162 Chromium native/compiled computed-style comparisons pass across both directions, inline sides, importance combinations and source orders. Running this browser check against the prior implementation reproduces the incorrect 10px margin above.
  • Type checks, library builds, frozen installation and documentation build pass.
  • Packed-package CommonJS, ES module and TypeScript consumers pass on Node 20.19.0 and 22.23.3 with the v9 dependency. Node 18 is no longer supported.
  • Eight documented transformation examples match the built plugin; 279 internal links on the updated generated pages resolve, README repository targets exist, and the sitemap is generated.
  • Package version is still 0.6.1; this PR does not publish a release.

@codecov

codecov Bot commented Oct 3, 2026

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@oe oe changed the title fix: preserve CSS fallbacks and scroll shorthand functions fix: honor declaration priority and parse scroll shorthand functions Oct 3, 2026
@oe oe changed the title fix: honor declaration priority and parse scroll shorthand functions fix: correct logical CSS cascade and selector parsing Oct 3, 2026
@oe oe changed the title fix: correct logical CSS cascade and selector parsing fix: preserve logical CSS cascade and upgrade postcss-logical to v9 Oct 3, 2026
@oe
oe merged commit 8f2879f into main Oct 3, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant