-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
b.var()
to generate CSS variable references
#25
Comments
More like $.keyframes perhaps? Could you make some pseudo code of how you imagined usage? |
Yes, much the same. Remember we were talking about the problem of accidental downstream collisions? Straw man: export const color = b.var('buttonColour')
export const Button = b`
border-radius: 3px;
color : var(${ color });
`
//
import { Button, color } from './Button'
export const Modal = {
view: ({attrs, children}) =>
m(Etc,
children,
m('button' + Button, {
[color] : 'green',
onclick : attrs.update(true),
}),
m('button' + Button, {
[color] : 'red',
onclick : attrs.update(false),
}),
),
} |
Yeah exactly. That's a really good way to solve it! In your example the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
…the same way BSS currently does for class names. That way we can avoid accidental cascades!
The text was updated successfully, but these errors were encountered: