fela-beautifier
Advanced tools
Comparing version 5.0.7 to 5.0.8
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
import cssbeautify from 'cssbeautify'; | ||
import { objectReduce } from 'fela-utils'; | ||
import { objectReduce, objectEach } from 'fela-utils'; | ||
function addBeautifier(renderer, options) { | ||
renderer.subscribe(function () { | ||
renderer.fontFaces = cssbeautify(renderer.fontFaces, options); | ||
renderer.keyframes = cssbeautify(renderer.keyframes, options); | ||
renderer.statics = cssbeautify(renderer.statics, options); | ||
renderer.rules = cssbeautify(renderer.rules, options); | ||
renderer.mediaRules = objectReduce(renderer.mediaRules, function (mediaRules, rules, query) { | ||
mediaRules[query] = cssbeautify(rules, options); | ||
return mediaRules; | ||
}, {}); | ||
return objectEach(renderer.styleNodes, function (node, key) { | ||
node.textContent = cssbeautify(node.textContent, options); | ||
}); | ||
}); | ||
@@ -18,0 +12,0 @@ |
@@ -21,11 +21,5 @@ 'use strict'; | ||
renderer.subscribe(function () { | ||
renderer.fontFaces = (0, _cssbeautify2.default)(renderer.fontFaces, options); | ||
renderer.keyframes = (0, _cssbeautify2.default)(renderer.keyframes, options); | ||
renderer.statics = (0, _cssbeautify2.default)(renderer.statics, options); | ||
renderer.rules = (0, _cssbeautify2.default)(renderer.rules, options); | ||
renderer.mediaRules = (0, _felaUtils.objectReduce)(renderer.mediaRules, function (mediaRules, rules, query) { | ||
mediaRules[query] = (0, _cssbeautify2.default)(rules, options); | ||
return mediaRules; | ||
}, {}); | ||
return (0, _felaUtils.objectEach)(renderer.styleNodes, function (node, key) { | ||
node.textContent = (0, _cssbeautify2.default)(node.textContent, options); | ||
}); | ||
}); | ||
@@ -32,0 +26,0 @@ |
{ | ||
"name": "fela-beautifier", | ||
"version": "5.0.7", | ||
"version": "5.0.8", | ||
"description": "Fela enhancer to beautify CSS output", | ||
@@ -29,4 +29,4 @@ "main": "lib/index.js", | ||
"cssbeautify": "^0.3.1", | ||
"fela-utils": "^6.0.1" | ||
"fela-utils": "^7.0.0" | ||
} | ||
} |
# fela-beautifier | ||
<img alt="npm downloads" src="https://img.shields.io/npm/dm/fela-beautifier.svg"> <img alt="gzipped size" src="https://img.shields.io/badge/gzipped-1.91kb-brightgreen.svg"> | ||
<img alt="npm version" src="https://badge.fury.io/js/fela-beautifier.svg"> <img alt="npm downloads" src="https://img.shields.io/npm/dm/fela-beautifier.svg"> | ||
@@ -5,0 +5,0 @@ The beautifier enhancer is a developer tool that automatically formats the rendered CSS markup on every change. It uses [cssbeautify](https://github.com/senchalabs/cssbeautify) to achieve this. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5594
49
+ Addedcss-in-js-utils@2.0.0(transitive)
+ Addedfela-utils@7.0.5(transitive)
- Removedcss-in-js-utils@2.0.1(transitive)
- Removedfela-utils@6.0.1(transitive)
- Removedisobject@3.0.1(transitive)
Updatedfela-utils@^7.0.0