mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
Merge pull request #241 from tailwindcss/mark-options-as-advanced
[0.3] Remove redundant default option fallbacks
This commit is contained in:
commit
a2f1cf099f
5
__tests__/defaultConfig.test.js
Normal file
5
__tests__/defaultConfig.test.js
Normal file
@ -0,0 +1,5 @@
|
||||
import config from '../defaultConfig.js'
|
||||
|
||||
test('the default config matches the stub', () => {
|
||||
expect(config()).toEqual(require('../defaultConfig.stub.js'))
|
||||
})
|
||||
@ -1,7 +0,0 @@
|
||||
import tailwind from '../src/index'
|
||||
import config from '../defaultConfig.js'
|
||||
|
||||
test('it can accept a config file', () => {
|
||||
tailwind('./defaultConfig.js')
|
||||
expect(require('../defaultConfig.stub.js')).toEqual(config())
|
||||
})
|
||||
@ -818,11 +818,11 @@ module.exports = {
|
||||
|
||||
/*
|
||||
|-----------------------------------------------------------------------------
|
||||
| Options https://tailwindcss.com/docs/configuration#options
|
||||
| Advanced Options https://tailwindcss.com/docs/configuration#options
|
||||
|-----------------------------------------------------------------------------
|
||||
|
|
||||
| Here is where you can set your Tailwind configuration options. For more
|
||||
| details about these options, visit the configuration options documentation.
|
||||
| Here is where you can tweak advanced configuration options. We recommend
|
||||
| leaving these options alone unless you absolutely need to change them.
|
||||
|
|
||||
*/
|
||||
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
import _ from 'lodash'
|
||||
import postcss from 'postcss'
|
||||
import applyClassPrefix from '../util/applyClassPrefix'
|
||||
import generateModules from '../util/generateModules'
|
||||
@ -16,7 +15,7 @@ export default function(config) {
|
||||
|
||||
const utilities = generateModules(utilityModules, unwrappedConfig.modules, unwrappedConfig)
|
||||
|
||||
if (_.get(unwrappedConfig, 'options.important', false)) {
|
||||
if (unwrappedConfig.options.important) {
|
||||
utilities.walkDecls(decl => (decl.important = true))
|
||||
}
|
||||
|
||||
@ -24,7 +23,7 @@ export default function(config) {
|
||||
nodes: [...container(unwrappedConfig), ...utilities.nodes],
|
||||
})
|
||||
|
||||
applyClassPrefix(tailwindClasses, _.get(unwrappedConfig, 'options.prefix', ''))
|
||||
applyClassPrefix(tailwindClasses, unwrappedConfig.options.prefix)
|
||||
|
||||
atRule.before(tailwindClasses)
|
||||
atRule.remove()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user