Closed sebald closed 11 months ago
Some Questions from me for understanding the issue Description
<StyledButton/>
and a 'normal' <Button/>
?Generel We use emotions ThemeProvider, does that mean we don't need one if we use Stitches JS? Because it's with the createStitches covered? Also the basic/default theme is there written?
From what I understand the obvious advantages are:
In my opinion (as far as I get it), I think we could implement this after we made next.js work 🙂 I haven't seen much conflicts. PS: I also think in this case we should make the tokens (e.g. color00 and color.00) consistent.
@sarahgm
Why do we need to replace the pseudo selectors? Do you mean the way they are implemented? Because pseudo elements and pseudo selectors are supported? here in docs
I meant how our pseudos work (e.g. :hover
-> :hover, [data-hover]
We would need to keep/adjust that. Not that big of deal.
The Default Theme would be the Global css settings?
Not sure what you mean.
Also does that mean we need a
<StyledButton/>
and a 'normal'<Button/>
?
IDK depends how we implement it, I guess.
And to the other comment. Yeah, if we switch, we should take the opportunity and make stuff more consistent.
Since there might not be good support in the CSS-in-JS libs we might to consider other alternatives
Other components libs are currently moving away from CSS-in-JS library. One of the prominent ones is NextUI. Even the maintainer of Emotion says that
Server Components were designed in a way that is at fundamental odds with CSS-in-JS. So don't expect Emotion (or other popular CSS-in-JS libs) to introduce support for them. They just don't allow us to integrate with them anyhow. see this comment here: https://github.com/mui/material-ui/issues/34905
While you can make them compatible, it might no optimal or worthwhile in the future. On the other hand we currently don't really have any Next apps in productions, except the Marigold docs. This might change in the future though.
Investigate Tailwind? The spiritual successor of Bootstrap has a enormous community already and might be an option that also solves a lot of our challenges.
In order to have the same feature and high compatibility with our current styling approach (variants and size), there are two options:
Reference how other Design Systems use Stitches: https://github.com/radix-ui/design-system/tree/master/components
Questions tailwind:
breakpoints
in tests, because the type supports just name and components. the tokens are defined in tailwind.config.cjs
how to use and test them -> have to add in config but how? (example: colors: purple10 -> I can't just import the colors.ts
in tailwind config build failes -> cannot find module)useTheme
with className type definitionMarigold.Provider
Note:
useComponentStyles
there are two versions of it because if remove it breaks all -preview.ts
same (set default to unicorn)Next Steps:
what about extending a theme? How should this be handled?
can we use tailwind presets for this?
@sebald I mean the function extendTheme
as I understand Presets are something else
@sarahgm ah, I think we can not use that any longer. Extending a theme has to be done via tailwind/postcss I guess
@sebald really? but the tests worked correctly I see no problem 🤔
Okay, then I am clearly wrong and I have to see the implementation 😄
Library to evaluate: https://stitches.dev/
Reasons:
border
)Cons:
__baseCSS
), we might still make use ofuseComponentStylse
API:
We might use it like this:
Reuse our API?
Is this good? We maybe need to make a "factory"?