Build a stack/Flow component #1629
Unanswered
gavinthomas-valtech
asked this question in
Q&A
Replies: 2 comments
-
You could use sprinkles to create a “flow” sprinkle that uses a CSS var to set the margin. And then you can use In the future we will be able to use margin-trim |
Beta Was this translation helpful? Give feedback.
0 replies
-
I ended up going down this route using globalStyle
Which now allows me to keep the existing stack component |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I;',m trying to build a Flow/Stack component which would be very useful
https://piccalil.li/blog/flow-utility/
https://every-layout.dev/layouts/stack/
The component looks like this
and the vanilla extract css
I get an error from vanilla extract as it won't allow the selector
[vite-plugin-vanilla-extract] Invalid selector: & > * + *
Style selectors must target the '&' character (along with any modifiers), e.g.
$ {parent} &
or${parent} &:hover
.This is to ensure that each style block only affects the styling of a single clas
s.
If your selector is targeting another class, you should move it to the style defi
nition for that class, e.g. given we have styles for 'parent' and 'child' element
s, instead of adding a selector of
& ${child}
) to 'parent', you should add${p arent} &
to 'child').If your selector is targeting something global, use the 'globalStyle' function in
stead, e.g. if you wanted to write
& h1
, you should instead write 'globalStyle(${parent} h1
, { ... })'Any ideas how i can implement this as a component and use vanilla extract?
Beta Was this translation helpful? Give feedback.
All reactions