Skip to content
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

Composition with pseudoselectors #10

Open
1 task
joshwnj opened this issue Oct 23, 2017 · 0 comments
Open
1 task

Composition with pseudoselectors #10

joshwnj opened this issue Oct 23, 2017 · 0 comments

Comments

@joshwnj
Copy link
Owner

joshwnj commented Oct 23, 2017

  • rethink this feature, and decide whether to reinstate it:

Composition with pseudoselectors

Sometimes you have an atom that you want to compose, but within the scope of a pseudoselector. Traditionally, if you wanted to change the classes applied to an element on hover, you'd need to do that with javascript.

cmz.pseudo allows us to create new atoms from old ones that are wrapped in a pseudoselector. For example:

// say we've got an existing atom:
const pinkFancyText = cmz(`
  color: hotpink
  font-style: italic
`)

// but we only want our element to be pink and fancy when it is hovered:
const elemStyle = cmz([`
  width: 500px
`,
  cmz.pseudo('hover', pinkFancyText)
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant