diff --git a/package.json b/package.json index 1c07a30..dc86cbc 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,8 @@ "stylecow-plugin-prefixes": "^6.0.5", "stylecow-plugin-variables": "^5.1.1", "stylus": "^0.54.5", - "through2": "^2.0.3" + "through2": "^2.0.3", + "stylis": "^3.0.5" }, "scripts": { "lint-staged": "lint-staged", diff --git a/parsers.js b/parsers.js index 7d59d65..0acbb36 100644 --- a/parsers.js +++ b/parsers.js @@ -29,6 +29,7 @@ var gonzales = require('gonzales'); var parserlib = require('parserlib'); var gonzalesPe = require('gonzales-pe'); var csstree = require('css-tree'); +var stylis = require('stylis'); module.exports = { name: 'Bootstrap', @@ -105,6 +106,12 @@ module.exports = { fn: function () { stylecow.parse(css).toString(); } + }, + { + name: 'Stylis', + fn: function () { + stylis('', css) + } } ] }; diff --git a/prefixers.js b/prefixers.js index d0b0f65..bdb6287 100644 --- a/prefixers.js +++ b/prefixers.js @@ -45,6 +45,9 @@ var scss = '@import \'compass/css3\';\n' + css var scssFile = path.join(__dirname, 'cache/bootstrap.prefixers.scss'); fs.writeFileSync(scssFile, scss); +// Stylis +var stylis = require('stylis') + module.exports = { name: 'Bootstrap', maxTime: 15, @@ -90,6 +93,14 @@ module.exports = { done.resolve(); }); } + }, + { + name: 'Stylis', + defer: true, + fn: function (done) { + stylis('', css); + done.resolve(); + } } ] }; diff --git a/preprocessors.js b/preprocessors.js index 1dddb16..80b1843 100644 --- a/preprocessors.js +++ b/preprocessors.js @@ -103,6 +103,17 @@ for ( i = 0; i < 100; i++ ) { lcss += '.search { fill: black; .icon() }'; } +// Stylis +var stylis = require('stylis'); +var styi = css; +styi += ':root { --size: 100px; }'; +for ( i = 0; i < 100; i++ ) { + styi += 'body h1 a { color: black; }'; + styi += 'h2 { width: var(--size); }'; + styi += 'h1 { width: calc(2 * var(--size)); }'; + styi += '.search { fill: black; width: 16px; height: 16px; }'; +} + module.exports = { name: 'Bootstrap', maxTime: 15, @@ -170,6 +181,12 @@ module.exports = { done.resolve(); }); } + }, + { + name: 'Stylis', + fn: function () { + stylis('', styi); + } } ] };