forked from tailwindlabs/tailwindcss
-
Notifications
You must be signed in to change notification settings - Fork 0
/
processTailwindFeatures.js
28 lines (24 loc) · 1.15 KB
/
processTailwindFeatures.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import _ from 'lodash'
import postcss from 'postcss'
import substituteTailwindAtRules from './lib/substituteTailwindAtRules'
import evaluateTailwindFunctions from './lib/evaluateTailwindFunctions'
import substituteVariantsAtRules from './lib/substituteVariantsAtRules'
import substituteResponsiveAtRules from './lib/substituteResponsiveAtRules'
import substituteScreenAtRules from './lib/substituteScreenAtRules'
import substituteClassApplyAtRules from './lib/substituteClassApplyAtRules'
import corePlugins from './corePlugins'
import processPlugins from './util/processPlugins'
export default function(getConfig) {
return function(css) {
const config = getConfig()
const processedPlugins = processPlugins([...corePlugins(config), ...config.plugins], config)
return postcss([
substituteTailwindAtRules(config, processedPlugins),
evaluateTailwindFunctions(config),
substituteVariantsAtRules(config, processedPlugins),
substituteResponsiveAtRules(config),
substituteScreenAtRules(config),
substituteClassApplyAtRules(config, processedPlugins.utilities),
]).process(css, { from: _.get(css, 'source.input.file') })
}
}