Spacing scale: where do your spacing tokens live? (audit from the Rhythmguard benchmark) #9179
Unanswered
PetriLahdelma
asked this question in
Q&A
Replies: 1 comment 1 reply
|
Mantine does have a canonical spacing scale. It lives in Source: The Mantine provider emits those values as global CSS variables: --mantine-spacing-xs
--mantine-spacing-sm
--mantine-spacing-md
--mantine-spacing-lg
--mantine-spacing-xlThe variable names are constructed by the default resolver and emitted from For Rhythmguard's auto-detection, I would prioritize, in order:
Component-local variables such as Avatar or Chip dimensions should not extend the global spacing scale, even when their numeric values happen to resemble spacing tokens. Against the pinned commit, the canonical default numeric scale is therefore |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Spacing scale: where do your spacing tokens live? (audit from the Rhythmguard benchmark)
Hi. I maintain stylelint-plugin-rhythmguard, a Stylelint rule that checks spacing values against a project's own scale. To keep it quiet on code I do not control, I run it against public design systems on pinned commits and publish the numbers. This repository is one of them, and I would rather you saw the audit here than in a report first.
What was run.
npx rhythmguard audit . --scale autoat3862b09overpackages/@mantine/core/src. Hairlines of one pixel or less, percentages, and generated or test paths are excluded. Anyone can reproduce it in a checkout of that commit.What it found. Scale inference picked up variables that do not form a spacing scale (it derived
0, 1, 2, 10, 12, 16, 20, 22, 32frompackages/@mantine/core/src/components/Avatar/Avatar.module.css,packages/@mantine/core/src/components/Chip/Chip.module.cssand others), most likely component-local spacing variables rather than your tokens. Measured against that, it reported 30 values, which is my tool's mistake and not a number I will quote.The ask. If you can point me at where the spacing scale is defined (a token file, a Sass map, a package), I will teach the tool to prefer it, re-run the audit on the real scale, and post the result here. If spacing is intentionally not on a scale, saying so is just as useful and I will mark the row that way.
The row for this repository will appear in a periodic "State of Spacing" table in the Rhythmguard repository, with this issue linked. If you would rather not be listed, say so here and I will remove it.
Feel free to close this if it is not useful. Thanks for the CSS.
All reactions