Skip to content

Commit

Permalink
remove replaceAnimations from noscope option, exports csjs instead …
Browse files Browse the repository at this point in the history
…of csjs()
  • Loading branch information
neurosnap committed Aug 15, 2016
1 parent e4bc564 commit ac4e1d5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
var csjs = require('./csjs');

module.exports = csjs();
module.exports.csjs = csjs();
module.exports.csjs = csjs;
module.exports.noScope = csjs({ noscope: true });
module.exports.getCss = require('./get-css');
8 changes: 1 addition & 7 deletions lib/csjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,7 @@ module.exports = function csjsTemplate(opts) {
var css = joiner(strings, values.map(selectorize));
var ignores = ignoreComposition(values);

var scope;
if (noscope) {
scope = extractExports(css);
} else {
scope = scopify(css, ignores);
}

var scope = noscope ? extractExports(css) : scopify(css, ignores);
var extracted = extractExtends(scope.css);
var localClasses = without(scope.classes, ignores);
var localKeyframes = without(scope.keyframes, ignores);
Expand Down
5 changes: 2 additions & 3 deletions lib/extract-exports.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
'use strict';

var replaceAnimations = require('./replace-animations');
var regex = require('./regex');
var classRegex = regex.classRegex;
var keyframesRegex = regex.keyframesRegex;

module.exports = extractExports;

function extractExports(css) {
return replaceAnimations({
return {
css: css,
keyframes: getExport(css, keyframesRegex),
classes: getExport(css, classRegex)
});
};
}

function getExport(css, regex) {
Expand Down

0 comments on commit ac4e1d5

Please sign in to comment.