Skip to content

Document --spacing #2215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kocv59 opened this issue Apr 19, 2025 · 6 comments
Open

Document --spacing #2215

kocv59 opened this issue Apr 19, 2025 · 6 comments

Comments

@kocv59
Copy link

kocv59 commented Apr 19, 2025

Theme documentation says --spacing is used for px and max-h but not the others. A list of all utilities that use it should be somewhere on the page.

@rozsazoltan

This comment has been minimized.

@kocv59
Copy link
Author

kocv59 commented Apr 20, 2025

The pages that use --spacing show it like your screenshots but there's no place with a list of all those pages.

https://tailwindcss.com/docs/theme#theme-variable-namespaces says Spacing and sizing utilities like px-4, max-h-16, and many more. There could be an extra section about --spacing that links all the pages that use it like https://tailwindcss.com/docs/padding and https://tailwindcss.com/docs/min-height and the pages from your screenshots.

@philipp-spiess
Copy link
Member

@kocv59 I understand the motivation but I'm not sure about the practicality of what you're suggesting. When we work on adding new utilities we usually only update the page of the specific utility so it I worry that it would make things a bit complex to have to remember to add all the backlinks to another page.

I'm curious why you want an exhaustive list for this, though?

@kocv59
Copy link
Author

kocv59 commented Apr 24, 2025

I'm curious why you want an exhaustive list for this, though?

If you want to change the --spacing number you know all the places to look where to see the changes.

When we work on adding new utilities we usually only update the page of the specific utility so it I worry that it would make things a bit complex to have to remember to add all the backlinks to another page.

It's more complex for all users to click on all the utility pages and see if --spacing is anywhere in the page instead of developers changing it once in rare cases new utility that uses --spacing is added.

If you add a new utility that uses --spacing you only need to make one change to the list of --spacing utilities to add link to the new page for the new utility. What more backlinks are there?

@rozsazoltan
Copy link
Contributor

I think this only needs to be learned once.

Perhaps an instructional post could be published about it. In this case, I'm thinking of either:

  • A) a static, non-updating post, e.g., a blog entry; or
  • B) a dynamic list that can generate the necessary links to the settings based on the docs API table. (maybe by calc(var(--spacing) * <number>) expression)

@kocv59
Copy link
Author

kocv59 commented May 14, 2025

It doesn't need to be dynamic. A manually created documentation page that is updated occasionally would suffice, as new utilities utilizing --spacing are infrequently added.

Ideally, each utility would have the ability to override --spacing with its own scale, such as --margin-spacing and --padding-spacing. However, since this isn't possible, adjustments to spacing can significantly impact the entire project, so it's crucial to document all utilities that rely upon it.

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

No branches or pull requests

3 participants