How to make sprinkles shorthands for multiple properties #461
Answered
by
tmm
mattstobbs
asked this question in
Q&A
-
When using sprinkles, is it possible to create shorthands to combine multiple properties? For example, tailwindcss has the class: .text-xs {
font-size: 0.75rem;
line-height: 1rem;
} Is it possible to create a 'textXS' shorthand? Kind of like a recipe but less specific. |
Beta Was this translation helpful? Give feedback.
Answered by
tmm
Nov 10, 2021
Replies: 1 comment 3 replies
-
Yup! Check out the docs. const properties = defineProperties({
conditions: {
// ...
},
properties: {
textStyle: {
xs: {
fontSize: '0.75rem',
lineHeight: '1rem',
},
sm: {
fontSize: '1rem',
lineHeight: '1.25rem',
},
md: {
fontSize: '1.25rem',
lineHeight: '1.5rem',
},
// ...
},
},
}) Usage: export const labelText = sprinkles({
textStyle: 'sm',
}) |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
mattstobbs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yup! Check out the docs.
Usage: