mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
Fix tests and style
This commit is contained in:
parent
12dd81b906
commit
ebb8633809
File diff suppressed because it is too large
Load Diff
@ -6,17 +6,16 @@ expect.extend({
|
||||
return str.replace(/\s/g, '')
|
||||
}
|
||||
|
||||
if (stripped(received) == stripped(argument)) {
|
||||
if (stripped(received) === stripped(argument)) {
|
||||
return {
|
||||
message: () =>
|
||||
`expected ${received} not to match CSS ${argument}`,
|
||||
message: () => `expected ${received} not to match CSS ${argument}`,
|
||||
pass: true,
|
||||
};
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
message: () => `expected ${received} to match CSS ${argument}`,
|
||||
pass: false,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
import cloneNodes from '../util/cloneNodes'
|
||||
|
||||
export default function() {
|
||||
return function(css) {
|
||||
css.walkAtRules('hoverable', atRule => {
|
||||
|
||||
@ -2,23 +2,23 @@ import _ from 'lodash'
|
||||
import postcss from 'postcss'
|
||||
|
||||
const variantGenerators = {
|
||||
hover: (rule) => {
|
||||
const clonedRule = rule.clone()
|
||||
hover: container => {
|
||||
const cloned = container.clone()
|
||||
|
||||
clonedRule.walkRules(rule => {
|
||||
cloned.walkRules(rule => {
|
||||
rule.selector = `.hover\\:${rule.selector.slice(1)}:hover`
|
||||
})
|
||||
|
||||
return clonedRule.nodes
|
||||
return cloned.nodes
|
||||
},
|
||||
focus: (rule) => {
|
||||
const clonedRule = rule.clone()
|
||||
focus: container => {
|
||||
const cloned = container.clone()
|
||||
|
||||
clonedRule.walkRules(rule => {
|
||||
cloned.walkRules(rule => {
|
||||
rule.selector = `.focus\\:${rule.selector.slice(1)}:focus`
|
||||
})
|
||||
|
||||
return clonedRule.nodes
|
||||
return cloned.nodes
|
||||
},
|
||||
}
|
||||
|
||||
@ -29,7 +29,7 @@ export default function() {
|
||||
|
||||
atRule.before(atRule.clone().nodes)
|
||||
|
||||
_.forEach(['focus', 'hover'], (variant) => {
|
||||
_.forEach(['focus', 'hover'], variant => {
|
||||
if (variants.includes(variant)) {
|
||||
atRule.before(variantGenerators[variant](atRule))
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user