mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
Merge pull request #732 from GeoffSelby/add-disabled-variant
Add `disabled` variant
This commit is contained in:
commit
5080129b71
@ -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 {
|
||||
|
||||
@ -36,6 +36,7 @@ const defaultVariantGenerators = {
|
||||
'focus-within': generatePseudoClassVariant('focus-within'),
|
||||
focus: generatePseudoClassVariant('focus'),
|
||||
active: generatePseudoClassVariant('active'),
|
||||
disabled: generatePseudoClassVariant('disabled'),
|
||||
}
|
||||
|
||||
export default function(config, { variantGenerators: pluginVariantGenerators }) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user