Skip to content

Sort gap, place-* and other missing shorthands before their longhands - #126

Closed
bardrop wants to merge 1 commit into
hudochenkov:masterfrom
bardrop-oss:fix-modern-shorthands
Closed

bardrop wants to merge 1 commit into
hudochenkov:masterfrom
bardrop-oss:fix-modern-shorthands

Conversation

@bardrop

@bardrop bardrop commented Nov 15, 2026

Copy link
Copy Markdown

With properties-order: 'alphabetical', gap, place-content, place-items, place-self and contain-intrinsic-size were not in shorthandData.js. They sort after some of their longhands, so this:

a { column-gap: 2px; gap: 1px; }

stayed as is, and correct input gap: 1px; column-gap: 2px; was reordered to put column-gap first. Either way the shorthand ends up overriding the longhand. This is also what stylelint-order's properties-alphabetical-order --fix uses, reported in hudochenkov/stylelint-order#224.

I added them, plus the other real shorthands from Stylelint's list that were missing: font-variant, font-synthesis, scroll-margin / scroll-padding (and their -block / -inline forms), and text-decoration-thickness under text-decoration. The data is the same as in hudochenkov/stylelint-order#225, so the two copies stay in sync.

Tests: a new properties-alphabetical-shorthand-modern fixture and isShorthand cases. 11 fail on master, all 117 pass with the change. pnpm run lint and pnpm run types are clean. I also added a line to the Unreleased section of the changelog.

With properties-order: 'alphabetical', gap, place-content, place-items,
place-self and contain-intrinsic-size were sorted after some of their
longhands (column-gap, align-content, ...), because they were missing
from the shorthand list. The shorthand then overrides the longhand.

Also add the other shorthands from Stylelint's list: font-variant,
font-synthesis, scroll-margin, scroll-padding (and their block/inline
forms), and text-decoration-thickness for text-decoration.

Refs hudochenkov/stylelint-order#224
@hudochenkov

Copy link
Copy Markdown
Owner

Thank you for your contribution!

I'm closing this PR, because I've done more extensive shorthand data update:

1991e05
78f5f09

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.

2 participants