Add disabled variant

This commit adds a `disabled` variant to the Tailwind core. Not sure if/where this would be used by default.
This commit is contained in:
Geoff Selby 2019-03-07 22:37:44 -06:00
parent a7a95b15c8
commit 64cea138ee
2 changed files with 22 additions and 0 deletions

View file

@ -30,6 +30,27 @@ test('it can generate hover variants', () => {
})
})
test('it can generate disabled variants', () => {
const input = `
@variants disabled {
.banana { color: yellow; }
.chocolate { color: brown; }
}
`
const output = `
.banana { color: yellow; }
.chocolate { color: brown; }
.disabled\\:banana:disabled { color: yellow; }
.disabled\\:chocolate:disabled { color: brown; }
`
return run(input).then(result => {
expect(result.css).toMatchCss(output)
expect(result.warnings().length).toBe(0)
})
})
test('it can generate active variants', () => {
const input = `
@variants active {

View file

@ -25,6 +25,7 @@ const defaultVariantGenerators = {
'focus-within': generatePseudoClassVariant('focus-within'),
focus: generatePseudoClassVariant('focus'),
active: generatePseudoClassVariant('active'),
disabled: generatePseudoClassVariant('disabled'),
}
export default function(config, { variantGenerators: pluginVariantGenerators }) {