Responsive variant recipes #1586
timkinsman
started this conversation in
Show and tell
Replies: 0 comments
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Howdy! 🤠
I've created a package which is an extension of
@vanilla-extract/recipes
that adds responsive variants. Tailwind variants is the inspiration behind theresponsiveVariants
functionality (before it was discontinued)How it works
Setup
createHomemadeRecipe
accepts key/value pairs where the keys become your responsive modifiers, and the values are the min-width where that breakpoint should start.homemadeRecipe
extends recipe that accepts an optionalresponsiveVariants
.appendCss will generate (at runtime).
With this homemade recipe, you can now use it for your button component.
Usage
The following CSS classes will be applied to your
Button
component.The classes
The example.
Full README
Source code
More examples
Feel free to fork, use, or contribute by raising discussions or issues. Since I use this package in my personal projects, I'm committed to continually improving it. 😃
Installation
Beta Was this translation helpful? Give feedback.
All reactions