mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
fix code style issues
This commit is contained in:
parent
498c53c582
commit
ed71ee438d
@ -30,13 +30,19 @@ it('does not add any CSS if no Tailwind features are used', () => {
|
||||
})
|
||||
|
||||
it('generates the right CSS with implicit screen utilities', () => {
|
||||
const input = fs.readFileSync(path.resolve(`${__dirname}/fixtures/tailwind-input-with-explicit-screen-utilities.css`), 'utf8')
|
||||
const input = fs.readFileSync(
|
||||
path.resolve(`${__dirname}/fixtures/tailwind-input-with-explicit-screen-utilities.css`),
|
||||
'utf8'
|
||||
)
|
||||
|
||||
return postcss([tailwind()])
|
||||
.process(input)
|
||||
.then(result => {
|
||||
const expected = fs.readFileSync(path.resolve(`${__dirname}/fixtures/tailwind-output-with-explicit-screen-utilities.css`), 'utf8')
|
||||
const expected = fs.readFileSync(
|
||||
path.resolve(`${__dirname}/fixtures/tailwind-output-with-explicit-screen-utilities.css`),
|
||||
'utf8'
|
||||
)
|
||||
|
||||
expect(result.css).toBe(expected)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@ -29,13 +29,15 @@ export default function(config) {
|
||||
return cloned
|
||||
})
|
||||
)
|
||||
finalRules.push(mediaQuery)
|
||||
|
||||
if (mediaQuery.nodes.length) {
|
||||
css.append(mediaQuery)
|
||||
}
|
||||
finalRules.push(mediaQuery)
|
||||
})
|
||||
|
||||
const hasScreenRules = finalRules.some(i => i.nodes.length !== 0)
|
||||
if (!hasScreenRules) {
|
||||
return
|
||||
}
|
||||
|
||||
let includesScreenUtilitiesExplicitly = false
|
||||
css.walkAtRules('tailwind', atRule => {
|
||||
if (atRule.params === 'screens') {
|
||||
@ -44,7 +46,7 @@ export default function(config) {
|
||||
}
|
||||
})
|
||||
|
||||
if(! includesScreenUtilitiesExplicitly) {
|
||||
if (!includesScreenUtilitiesExplicitly) {
|
||||
css.append(finalRules)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user