Change priority order to (from the highest): focus-active-hover

This commit is contained in:
fedeTibaldo 2018-02-16 18:09:20 +01:00
parent eec03465f4
commit 62cf25f718
2 changed files with 7 additions and 7 deletions

View File

@ -101,12 +101,12 @@ test('it can generate hover, active and focus variants', () => {
const output = `
.banana { color: yellow; }
.chocolate { color: brown; }
.focus\\:banana:focus { color: yellow; }
.focus\\:chocolate:focus { color: brown; }
.active\\:banana:active { color: yellow; }
.active\\:chocolate:active { color: brown; }
.hover\\:banana:hover { color: yellow; }
.hover\\:chocolate:hover { color: brown; }
.active\\:banana:active { color: yellow; }
.active\\:chocolate:active { color: brown; }
.focus\\:banana:focus { color: yellow; }
.focus\\:chocolate:focus { color: brown; }
`
return run(input).then(result => {
@ -127,10 +127,10 @@ test('it wraps the output in a responsive at-rule if responsive is included as a
@responsive {
.banana { color: yellow; }
.chocolate { color: brown; }
.focus\\:banana:focus { color: yellow; }
.focus\\:chocolate:focus { color: brown; }
.hover\\:banana:hover { color: yellow; }
.hover\\:chocolate:hover { color: brown; }
.focus\\:banana:focus { color: yellow; }
.focus\\:chocolate:focus { color: brown; }
}
`

View File

@ -61,7 +61,7 @@ export default function(config) {
atRule.before(atRule.clone().nodes)
_.forEach(['focus', 'active', 'hover', 'group-hover'], variant => {
_.forEach(['hover', 'active', 'focus', 'group-hover'], variant => {
if (variants.includes(variant)) {
variantGenerators[variant](atRule, unwrappedConfig)
}