mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
26 lines
638 B
JavaScript
26 lines
638 B
JavaScript
import postcss from 'postcss'
|
|
import plugin from '../src/lib/substituteFocusableAtRules'
|
|
|
|
function run(input, opts = {}) {
|
|
return postcss([plugin(opts)]).process(input)
|
|
}
|
|
|
|
test("it adds a focusable variant to each nested class definition", () => {
|
|
const input = `
|
|
@focusable {
|
|
.banana { color: yellow; }
|
|
.chocolate { color: brown; }
|
|
}
|
|
`
|
|
|
|
const output = `
|
|
.banana, .focus\\:banana:focus { color: yellow; }
|
|
.chocolate, .focus\\:chocolate:focus { color: brown; }
|
|
`
|
|
|
|
return run(input, {}).then(result => {
|
|
expect(result.css).toEqual(output)
|
|
expect(result.warnings().length).toBe(0)
|
|
})
|
|
})
|