Closed Tahul closed 2 years ago
This is initial work towards something else than having a global "design-tokens" layer for Nuxt.
This PR allows lots of new possibilities such as:
colors.lila
colors.grape
tokens.config.ts
css({ color: '' })
{colors.lila}
<style lang="ts">
css()
<style scoped lang="ts"> css({ button: { display: 'flex', alignItems: 'center', justifyContent: 'center', borderRadius: '16px', width: '320px', height: '320px', border: '4px solid {colors.black}', position: 'relative', '&:hover': { border: '4px solid {colors.velvet}' }, '& > p': { fontSize: '24px', }, variants: { primary: { backgroundColor: '{colors.primary.900}', }, black: { backgroundColor: '{colors.black}', }, lavender: { backgroundColor: '{colors.lavender}' }, lila: { backgroundColor: '{colors.lila}' }, velvet: { backgroundColor: '{colors.velvet}' }, grape: { backgroundColor: '{colors.grape}' }, rounded: { borderRadius: '50%' }, padded: { padding: '4rem' }, } } }) </style>
$dt()
I will probably merge this PR fast, but I wanted to keep track of this direction change for the module.
I believe this is going to be a very strong solution for Nuxt theming projects, but now applies to a lot more of usecases.
TODO:
Thank you so much @johnsoncodehk for the initial help on the Volar plugin setup!
The experience is amazing! 😍
❓ Type of change
📚 Description
This is initial work towards something else than having a global "design-tokens" layer for Nuxt.
This PR allows lots of new possibilities such as:
colors.lila
andcolors.grape
intokens.config.ts
, writingcss({ color: '' })
will give{colors.lila}
|colors.grape
as suggestion<style lang="ts">
css()
API cabled to theme tokenscss()
styles feeds from MDN datas (through CSSTypes) and local theme tokens defined intokens.config.ts
css()
has 0 runtime impact (gets compiled to raw CSS)$dt()
now autocompletes in CSS<style lang="ts">
I will probably merge this PR fast, but I wanted to keep track of this direction change for the module.
I believe this is going to be a very strong solution for Nuxt theming projects, but now applies to a lot more of usecases.
📝 Checklist
TODO:
💚 Credits
Thank you so much @johnsoncodehk for the initial help on the Volar plugin setup!
The experience is amazing! 😍