Merge pull request #732 from GeoffSelby/add-disabled-variant
Add `disabled` variant
This commit is contained in:
commit
5080129b71
2 changed files with 22 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue