mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
Default's declarations are now processed and merged even when there is no tailwind base directive included in the stylesheet. Without this applying tailwind utilities in css modules would break if they relied on defaults rules. Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
21 lines
638 B
JavaScript
21 lines
638 B
JavaScript
import path from 'path'
|
|
import postcss from 'postcss'
|
|
import tailwind from '../../src'
|
|
import { DEFAULTS_LAYER } from '../../src/lib/expandTailwindAtRules'
|
|
|
|
export function run(input, config, plugin = tailwind) {
|
|
let { currentTestName } = expect.getState()
|
|
|
|
if (typeof config === 'object' && Object.keys(config).length > 0) {
|
|
config[DEFAULTS_LAYER] = config[DEFAULTS_LAYER] ?? input.includes('@tailwind base')
|
|
}
|
|
|
|
return postcss(plugin(config)).process(input, {
|
|
from: `${path.resolve(__filename)}?test=${currentTestName}`,
|
|
})
|
|
}
|
|
|
|
export let css = String.raw
|
|
export let html = String.raw
|
|
export let javascript = String.raw
|