forked from tailwindlabs/tailwindcss
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert new stuff to use ES6 modules
- Loading branch information
1 parent
c57b43a
commit 2ef0183
Showing
22 changed files
with
266 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/node_modules | ||
yarn.lock | ||
lib |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,24 +5,68 @@ | |
"license": "MIT", | ||
"contributors": [ | ||
"Adam Wathan <[email protected]>", | ||
"Jonathan Reinink <[email protected]>" | ||
"Jonathan Reinink <[email protected]>", | ||
"David Hemphill <[email protected]>" | ||
], | ||
"scripts": { | ||
"build": "node ./build.js", | ||
"prebabelify": "rimraf lib", | ||
"babelify": "babel src --out-dir lib", | ||
"prepare": "npm run babelify", | ||
"build": "npm run prepare && node lib/build.js", | ||
"test": "jest" | ||
}, | ||
"dependencies": { | ||
"devDependencies": { | ||
"babel-cli": "^6.6.5", | ||
"babel-core": "^6.7.2", | ||
"babel-loader": "^6.2.4", | ||
"babel-preset-env": "^1.0.0", | ||
"babel-preset-react": "^6.5.0", | ||
"babel-preset-stage-3": "^6.24.1", | ||
"jest": "^20.0.4", | ||
"rimraf": "^2.6.1", | ||
"stylefmt": "^6.0.0" | ||
}, | ||
"dependencies": { | ||
"lodash": "^4.17.4", | ||
"normalize.css": "^6.0.0", | ||
"postcss": "^6.0.9", | ||
"postcss-cssnext": "^3.0.2", | ||
"postcss-prettify": "^0.3.4", | ||
"suitcss-base": "^3.0.0" | ||
}, | ||
"devDependencies": { | ||
"stylefmt": "^6.0.0" | ||
}, | ||
"browserslist": [ | ||
"> 1%" | ||
] | ||
], | ||
"babel": { | ||
"presets": [ | ||
"babel-preset-react", | ||
[ | ||
"babel-preset-env", | ||
{ | ||
"targets": { | ||
"node": "7.0" | ||
} | ||
} | ||
], | ||
"babel-preset-stage-3" | ||
], | ||
"env": { | ||
"browsers": { | ||
"presets": [ | ||
"babel-preset-react", | ||
[ | ||
"babel-preset-env", | ||
{ | ||
"targets": { | ||
"browsers": [ | ||
"last 5 versions" | ||
] | ||
} | ||
} | ||
], | ||
"babel-preset-stage-3" | ||
] | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import fs from 'fs' | ||
import postcss from 'postcss' | ||
import tailwind from './tailwind' | ||
import defaultConfig from './defaultConfig' | ||
|
||
console.info('Building Tailwind!') | ||
|
||
fs.readFile('./src/tailwind.css', (err, css) => { | ||
postcss([tailwind(defaultConfig)]) | ||
.process(css, { | ||
from: './tailwind.css', | ||
to: './dist/tailwind.css', | ||
map: {inline: false}, | ||
}) | ||
.then(result => { | ||
fs.writeFileSync('./dist/tailwind.css', result.css) | ||
if (result.map) fs.writeFileSync('./dist/tailwind.css.map', result.map) | ||
}) | ||
.catch(error => console.log(error)) | ||
}) | ||
|
||
console.log('Finished Building Tailwind!') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,25 @@ | ||
const _ = require('lodash') | ||
const defineClass = require('../util/defineClass') | ||
const findColor = require('../util/findColor') | ||
import _ from 'lodash' | ||
import defineClass from '../util/defineClass' | ||
import findColor from '../util/findColor' | ||
|
||
module.exports = function ({ colors, backgroundColors }) { | ||
export default function({colors, backgroundColors}) { | ||
if (_.isArray(backgroundColors)) { | ||
backgroundColors = _(backgroundColors).flatMap(color => { | ||
if (_.isString(color)) { | ||
return [[color, color]] | ||
} | ||
return _.toPairs(color) | ||
}).fromPairs() | ||
backgroundColors = _(backgroundColors) | ||
.flatMap(color => { | ||
if (_.isString(color)) { | ||
return [[color, color]] | ||
} | ||
return _.toPairs(color) | ||
}) | ||
.fromPairs() | ||
} | ||
|
||
return _(backgroundColors).toPairs().map(([className, colorName]) => { | ||
return defineClass(`bg-${className}`, { | ||
backgroundColor: findColor(colors, colorName), | ||
return _(backgroundColors) | ||
.toPairs() | ||
.map(([className, colorName]) => { | ||
return defineClass(`bg-${className}`, { | ||
backgroundColor: findColor(colors, colorName), | ||
}) | ||
}) | ||
}).value() | ||
.value() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
const _ = require('lodash') | ||
const defineClass = require('../util/defineClass') | ||
import _ from 'lodash' | ||
import defineClass from '../util/defineClass' | ||
|
||
module.exports = function ({ shadows }) { | ||
return _(shadows).toPairs().map(([className, shadow]) => { | ||
return defineClass(`shadow-${className}`, { | ||
boxShadow: shadow, | ||
export default function({shadows}) { | ||
return _(shadows) | ||
.toPairs() | ||
.map(([className, shadow]) => { | ||
return defineClass(`shadow-${className}`, { | ||
boxShadow: shadow, | ||
}) | ||
}) | ||
}).value() | ||
.value() | ||
} |
Oops, something went wrong.