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
[RFC] Make unit scales consistent #33
Comments
Here's where I am so far:
Feels consistent enough while adding semantic value where it could be useful. Other than the font size scale we already have descriptive values for typography (font weights, measures, etc) and it feels natural to continue that for line heights and letter spacing, where you don't have an extensive scale like with In places with more that 4-5 values, a scale from |
I agree that for line-height and border-radius making the values consistent is great. With the widths however, I feel that meaning is lost and incorrect meaning is implied (such that width-2 is half of width-4). I think it would be better to have an alias for or otherwise emphasize commonly used breakpoints (768px, 544px, 1200px) such as width-tablet, -mobile, -screen-sm. Maybe then the numbered units can be tied to something more immediately understandable. Best example for now: |
Hmm good point. I don't know that tying it to devices/breakpoints would be best, because you can't use CSS variables in media queries anyway, and there are 10 values for widths so you'd run out of device names pretty quick. The width scale is for setting max widths of containers on a page (for example). There are other places in Pollen where a numerical scale doesn't have the same proportional relationship as the Size scale, but I agree that widths are pretty closely tied to sizes, semantically, that it could be a gotcha. The only alternative I see is sticking to the original |
Yeah, I'm also not a fan of the If you think the 10 values you have are the ones you want, I did a little research into other systems but no inspiration struck yet. |
yeah it's tricky. I guess we could reduce the width scale, I only ever use a few myself in the prod sites I've used Pollen on, and even then |
Carrying on from #32, with a probable v3 breaking change coming it could be a good opportunity to rethink some fundamentals that Pollen blindly inherited from Tailwind. Namely, inconsistent unit scales.
We currently use:
--size-2
)width-xs
)tracking-tight
).If Pollen was to standardise on a scale I feel like it should be numeric, since that's the most obvious, extensible, and easiest to understand.
Great discussion on Tailwind that was abandoned due to breaking change friction on a large project: tailwindlabs/tailwindcss#1277
The text was updated successfully, but these errors were encountered: