Skip to content
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

Tailwind preset improvements #862

Closed
mxstbr opened this issue Apr 20, 2020 · 11 comments
Closed

Tailwind preset improvements #862

mxstbr opened this issue Apr 20, 2020 · 11 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@mxstbr
Copy link
Member

mxstbr commented Apr 20, 2020

In order to make the Tailwind preset more approachable for people that already know Tailwind, we should:

  • Font sizes should have the same aliases (e.g. lg = 2)
  • Colors should be aliased to the same aliases * 100, e.g. purple.5 === purple.500
  • Breaking change for a major version: Make the padding scale match Tailwind's
@mxstbr mxstbr added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Apr 20, 2020
@jxnblk
Copy link
Member

jxnblk commented Apr 21, 2020

I'm guessing by "aliases" you mean adding keys to match based on the current keys to prevent breaking changes?

@mxstbr
Copy link
Member Author

mxstbr commented Apr 22, 2020

Yes exactly! 👍 Essentially:

let fontSizes = [...]
fontSizes.lg = 2;

let colors = {...};
colors.purple.500 = colors.purple[5];

In that way, you can choose whether you want to use the underlying system tailwind-style (if you're used to their classnames already) or theme-ui style.

@LekoArts
Copy link
Collaborator

LekoArts commented Apr 24, 2020

Not sure if this is a bug or if this is fixable, but the padding scale doesn't match Tailwind's for some reason

iirc this was just copied over from the other presets (maybe too be coherent?)

@mxstbr
Copy link
Member Author

mxstbr commented Apr 24, 2020

iirc this was just copied over from the other presets (maybe to be coherent?)

Should be copied from Tailwind, no? 🤔

@LekoArts
Copy link
Collaborator

LekoArts commented Apr 24, 2020

Edited my message to clarify

Yeah, even though this will be a breaking change, this should be done IMO if this is called the "tailwind preset". Jackson might have some opinions on that.

@mxstbr
Copy link
Member Author

mxstbr commented Apr 24, 2020

I strongly think if it's the Tailwind preset it should use the Tailwind system, not half of the Tailwind system and half random values 😉

@jxnblk
Copy link
Member

jxnblk commented May 5, 2020

If you want to use a lesser spacing scale, that's fine, but yeah it'd be a breaking change and would potentially make the preset less interoperable with other Theme UI presets

@LekoArts
Copy link
Collaborator

LekoArts commented May 5, 2020

and would potentially make the preset less interoperable with other Theme UI presets

That's a good point 👍 And I personally haven't missed Tailwind's scale.

@axe312ger
Copy link
Contributor

axe312ger commented Jul 20, 2020

Uhh nice, thanks for the mention @mxstbr

Next to the issue with the colors, I found out as well that values from sizes property are not correctly transformed into the format spacing of tailwind expects.

Also extending min/max sizes with our custom size variables, but thats personal opinion I guess.

https://github.com/axe312ger/gatsby-mdx-suite/blob/big-pre-beta-refactor/themes/core/gatsby-node.js#L26-L80

Note: My issues are probably within @theme-ui/tailwind, not in @theme-ui/preset-tailwind

@lachlanjc
Copy link
Member

Should also update with the new Tailwind 2 color palette 👍

@lachlanjc
Copy link
Member

Closed by #2357!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants