Last active
May 18, 2023 19:00
-
-
Save WoLfulus/6a2a2f762794ced3b0bc286836d5476c to your computer and use it in GitHub Desktop.
naci.js evolution (syntax)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// -------------------------------------------------------- | |
// v1 | |
$button: component( | |
name("Button"), | |
type("button"), | |
props( | |
prop(size, (default large)), | |
), | |
); | |
@include stylesheet($button) { | |
@apply py-1 px-2; | |
@include when(size is large) { | |
@apply py-4 px-6; | |
} | |
} | |
// -------------------------------------------------------- | |
// v2 | |
$button: definition(Button, ( | |
element: button, | |
variants: ( | |
size: options(default large) | |
) | |
)); | |
@include styles($button) { | |
@apply py-1 px-2; | |
@include variants(size is large) { | |
@apply py-4 px-6; | |
} | |
} | |
@include export($button); | |
// -------------------------------------------------------- | |
// v3 | |
@include component(Button, ( | |
element: button, | |
variants: ( | |
size: options(default large) | |
) | |
)) { | |
@apply py-1 px-2; | |
@include variants(size is large) { | |
@apply py-4 px-6; | |
} | |
} | |
// -------------------------------------------------------- | |
// v4 (now) | |
@include component(Button) { | |
@include element(button); | |
@include variants { | |
@include new(size, default large); | |
} | |
@include stylesheet { | |
@apply py-1 px-2; | |
@include variant(size is large) { | |
@apply py-4 px-6; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment