Skip to content

Navigation Menu

Sign in
Sign up

Consider non-grouped styles as base #29

hennessyevan started this conversation in Ideas
Discussion options

In Stitches, we put "base" styles in the object like so

const RedBox = styled('div', {
 backgroundColor: '$red'
})

In macaron, following vanilla-extract, we use the base keyword

const RedBox = styled('div', {
 base: {
 backgroundColor: '$red'
 }
})

I'm not sure what the benefit of using base is here, perhaps there is some good reason but could we possibly support both syntaxes? It would surely make it just a little easier for our team to migrate from stitches to macaron.

You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

Hey, so the main reason for having base here is that it allows you to use pre-defined styles/classes as the base styles for some element, so you can do

const RedBox = styled('div', {
 base: "some-class-name",
})

We could support both syntaxes though

You must be logged in to vote
1 reply
Comment options

Oh that's cool 👍

When we get to it, I'll see whether we might just do a codemod and if we do, I'll contribute that codemod here of course

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /