Skip to content

Conversation

@adamwathan
Copy link
Member

Adds the ability to generate hover and focus variants of a utility at once:

@variants hover, focus {
  .bg-brand { ... }
}

This will likely replace the @hoverable directive in the next breaking release. We've also had a intentionally undocumented @focusable at-rule for a while, but the issue was combining hoverable and focusable didn't work as expected because you had to nest them:

@hoverable {
  @focusable {
    .bg-brand { ... }
  }
}

This would generate a bunch of insane crap, so this PR fixes that by allowing you to generate them at the same time on the same set of source rules instead of running them on top of each other.

The main purpose of this PR is to lay the groundwork for a config-based approach to specifying which utilities should have hover, focus, and responsive variants. The work there is mostly done, just needs some tweaks after this gets merged.

Currently supports focus and hover, need to add responsive which will be a whole horrible can of worms.
@adamwathan adamwathan merged commit 9c72969 into master Nov 23, 2017
@adamwathan adamwathan deleted the variants-rule branch November 23, 2017 16:15
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

Successfully merging this pull request may close these issues.

2 participants