Repository navigation
Spacing scale as CSS variables (--mw-space-*) in sass/spacing.css - #670
Merged
Merged
Conversation
The $spacing-values steps become --mw-space-0 to --mw-space-6 in :root, in em, in a separate sass/spacing.css forwarded from materialize.scss. The map points at the variables, so the m-* and p-* helpers follow a client-side override. Six declarations in _global.scss that were off the scale now use the nearest step at the 14px root (blockquote, footer, footer copyright, table cells, responsive table rows); the footer margin snaps to 3em. Refs materializecss#665
Member
|
ok LGTM |
PetriLahdelma
added a commit
to PetriLahdelma/stylelint-plugin-rhythmguard
that referenced
this pull request
Oct 14, 2026
scale: "auto" reads --spacing-xs..2xl from @mozilla-protocol/tokens, and the Mozilla Protocol benchmark row is measured against 7.0.0 (19 off-scale), as a Protocol contributor pointed out in mozilla/protocol#1132. The playground bundle is rebuilt for the new allowlist entry. The outreach log records the merge of materializecss/materialize#670. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PetriLahdelma
added a commit
to PetriLahdelma/stylelint-plugin-rhythmguard
that referenced
this pull request
Oct 14, 2026
scale: "auto" reads --spacing-xs..2xl from @mozilla-protocol/tokens, and the Mozilla Protocol benchmark row is measured against 7.0.0 (19 off-scale), as a Protocol contributor pointed out in mozilla/protocol#1132. The playground bundle is rebuilt for the new allowlist entry. The outreach log records the merge of materializecss/materialize#670. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As discussed in #665: the spacing scale as native CSS variables in a separate file, with screenshots.
sass/spacing.css(new, forwarded frommaterialize.scssafter the M3 tokens):$spacing-valuesnow points at these variables, so them-*andp-*helpers follow any client-side override.The six declarations that were off the scale. Your root font size is 14px, so the steps are 3.5, 7, 10.5, 14, 21 and 42px. My comment in #665 assumed 16px; at 14px three of the nearest steps are different, so I used those:
blockquotemargin20px 0var(--mw-space-5) 0.page-footermargin-top5remvar(--mw-space-6).footer-copyrightpadding10px 0pxvar(--mw-space-3) 0td, thpadding15px 5pxvar(--mw-space-4) var(--mw-space-1).responsive-table thead trpadding0 10px 0 00 var(--mw-space-3) 0 0.responsive-table trpadding0 10px0 var(--mw-space-3)Helper classes. At the 14px root,
emandremgive the same result, so.p-1to.p-6and the margin helpers render exactly as before in normal text. The difference is inside an element with its own font size, such as a heading or a small chip: there the helpers now scale with that text. That is whatemmeans, and it may be worth a line in the release notes.Screenshots of v2-dev and this branch side by side, built with
npm run build. The responsive table is shown below 992px.Light:
Dark:
npm run lintandnpm test(50 tests) pass.