Skip to content

Commit

Permalink
Don't do any merging of config values at all
Browse files Browse the repository at this point in the history
Leave this up to the user; their config file is a JS file and we give
them access to the default config, so they can do as much merging of
defaults as they like.
  • Loading branch information
adamwathan committed Oct 24, 2017
1 parent 4215082 commit 4478b04
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 156 deletions.
83 changes: 0 additions & 83 deletions __tests__/mergeConfig.test.js

This file was deleted.

3 changes: 1 addition & 2 deletions src/build.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import fs from 'fs'
import postcss from 'postcss'
import tailwind from '..'
import defaultConfig from '../defaultConfig'
import CleanCSS from 'clean-css'

console.info('Building Tailwind!')

fs.readFile('./css/tailwind.css', (err, css) => {
postcss([tailwind(defaultConfig)])
postcss([tailwind()])
.process(css, {
from: './css/tailwind.css',
to: './dist/tailwind.css',
Expand Down
9 changes: 3 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import postcss from 'postcss'
import stylefmt from 'stylefmt'

import defaultConfig from '../defaultConfig'
import mergeConfig from './util/mergeConfig'

import substituteResetAtRule from './lib/substituteResetAtRule'
import evaluateTailwindFunctions from './lib/evaluateTailwindFunctions'
Expand All @@ -17,13 +16,11 @@ import substituteResponsiveAtRules from './lib/substituteResponsiveAtRules'
import substituteScreenAtRules from './lib/substituteScreenAtRules'
import substituteClassApplyAtRules from './lib/substituteClassApplyAtRules'

const plugin = postcss.plugin('tailwind', (options = {}) => {
if (_.isString(options)) {
options = require(path.resolve(options))
const plugin = postcss.plugin('tailwind', (config = defaultConfig) => {
if (_.isString(config)) {
config = require(path.resolve(config))
}

const config = mergeConfig(defaultConfig, options)

return postcss([
substituteResetAtRule(config),
evaluateTailwindFunctions(config),
Expand Down
65 changes: 0 additions & 65 deletions src/util/mergeConfig.js

This file was deleted.

0 comments on commit 4478b04

Please sign in to comment.