postcss-structure
Advanced tools
Comparing version 0.8.1 to 0.8.2
@@ -17,4 +17,4 @@ 'use strict'; | ||
exports.default = function (blobs, node, opts, breakpoint) { | ||
if (blobs.length && blobs[breakpoint] && blobs[breakpoint].length && opts.display === 'float') { | ||
exports.default = function (blobs, node, opts) { | ||
if (blobs && blobs.length && opts.display === 'float') { | ||
var blobFloat = _postcss2.default.rule(); | ||
@@ -25,6 +25,6 @@ | ||
for (var total = 2; total <= blobs[breakpoint].length; total++) { | ||
if (blobs[breakpoint][total]) { | ||
for (var ratio = 1; ratio < blobs[breakpoint][total].length; ratio++) { | ||
_utils2.default.selectorsAdd(blobFloat, blobs[breakpoint][total][ratio]); | ||
for (var total = 2; total <= blobs.length; total++) { | ||
if (blobs[total]) { | ||
for (var ratio = 1; ratio < blobs[total].length; ratio++) { | ||
_utils2.default.selectorsAdd(blobFloat, blobs[total][ratio]); | ||
} | ||
@@ -31,0 +31,0 @@ } |
@@ -17,8 +17,8 @@ 'use strict'; | ||
exports.default = function (blobs, node, opts, breakpoint) { | ||
if (blobs.length && blobs[breakpoint] && blobs[breakpoint].length) { | ||
for (var total = 2; total <= blobs[breakpoint].length; total++) { | ||
if (blobs[breakpoint][total]) { | ||
for (var ratio = 1; ratio < blobs[breakpoint][total].length; ratio++) { | ||
if (blobs[breakpoint][total][ratio]) { | ||
exports.default = function (blobs, node, opts) { | ||
if (blobs && blobs.length) { | ||
for (var total = 2; total <= blobs.length; total++) { | ||
if (blobs[total]) { | ||
for (var ratio = 1; ratio < blobs[total].length; ratio++) { | ||
if (blobs[total][ratio]) { | ||
var blobWidth = _postcss2.default.rule(); | ||
@@ -28,3 +28,3 @@ var blobWidthValue = 100 * ratio / total; | ||
_utils2.default.selectorsAdd(blobWidth, blobs[breakpoint][total][ratio]); | ||
_utils2.default.selectorsAdd(blobWidth, blobs[total][ratio]); | ||
@@ -31,0 +31,0 @@ if (opts.display === 'flex') { |
@@ -17,4 +17,4 @@ 'use strict'; | ||
exports.default = function (blocs, node, opts, breakpoint) { | ||
if (blocs.length && blocs[breakpoint] && blocs[breakpoint].length && opts.display === 'float') { | ||
exports.default = function (blocs, node, opts) { | ||
if (blocs && blocs.length && opts.display === 'float') { | ||
var blocFloat = _postcss2.default.rule(); | ||
@@ -26,10 +26,10 @@ | ||
for (var width = opts.max; width > 0; width--) { | ||
if (blocs[breakpoint][width]) { | ||
if (blocs[breakpoint][width][0]) { | ||
_utils2.default.selectorsAdd(blocFloat, blocs[breakpoint][width][0]); | ||
if (blocs[width]) { | ||
if (blocs[width][0]) { | ||
_utils2.default.selectorsAdd(blocFloat, blocs[width][0]); | ||
} | ||
if (width > 1 && width < opts.max) { | ||
for (var offset = 1; offset <= opts.max - width; offset++) { | ||
if (blocs[breakpoint][width][offset]) { | ||
_utils2.default.selectorsAdd(blocFloat, blocs[breakpoint][width][offset]); | ||
if (blocs[width][offset]) { | ||
_utils2.default.selectorsAdd(blocFloat, blocs[width][offset]); | ||
} | ||
@@ -36,0 +36,0 @@ } |
@@ -7,8 +7,8 @@ "use strict"; | ||
exports.default = function (customStyles, node, breakpoint) { | ||
if (customStyles[breakpoint]) { | ||
for (var rule = 0; rule < customStyles[breakpoint].length; rule++) { | ||
node.append(customStyles[breakpoint][rule]); | ||
exports.default = function (customStyles, node) { | ||
if (customStyles) { | ||
for (var rule = 0; rule < customStyles.length; rule++) { | ||
node.append(customStyles[rule]); | ||
} | ||
} | ||
}; |
@@ -13,7 +13,7 @@ 'use strict'; | ||
exports.default = function (hides, node, breakpoint) { | ||
if (hides.length && hides[breakpoint] && hides[breakpoint].length) { | ||
exports.default = function (hides, node) { | ||
if (hides.length && hides && hides.length) { | ||
var hide = _postcss2.default.rule(); | ||
hide.selectors = hides[breakpoint]; | ||
hide.selectors = hides; | ||
hide.append({ prop: 'display', value: 'none' }); | ||
@@ -20,0 +20,0 @@ hide.append({ prop: 'visibility', value: 'hidden' }); |
@@ -13,7 +13,7 @@ 'use strict'; | ||
exports.default = function (rights, node, opts, breakpoint) { | ||
if (rights.length && rights[breakpoint] && rights[breakpoint].length) { | ||
exports.default = function (rights, node, opts) { | ||
if (rights.length && rights && rights.length) { | ||
var right = _postcss2.default.rule(); | ||
right.selectors = rights[breakpoint]; | ||
right.selectors = rights; | ||
@@ -20,0 +20,0 @@ if (opts.display === 'flex') { |
@@ -13,7 +13,7 @@ 'use strict'; | ||
exports.default = function (shows, node, breakpoint) { | ||
if (shows.length && shows[breakpoint] && shows[breakpoint].length) { | ||
exports.default = function (shows, node) { | ||
if (shows.length && shows && shows.length) { | ||
var show = _postcss2.default.rule(); | ||
show.selectors = shows[breakpoint]; | ||
show.selectors = shows; | ||
show.append({ prop: 'display', value: 'block' }); | ||
@@ -20,0 +20,0 @@ show.append({ prop: 'visibility', value: 'visible' }); |
@@ -81,6 +81,6 @@ 'use strict'; | ||
(0, _blocs2.default)(e.blobs, rootCss, opts); | ||
(0, _blobsFloatQuery2.default)(e.blobs, rootCss, opts, 0); | ||
(0, _blobsQuery2.default)(e.blobs, rootCss, opts, 0); | ||
(0, _blobsFloatQuery2.default)(e.blobs[0], rootCss, opts); | ||
(0, _blobsQuery2.default)(e.blobs[0], rootCss, opts); | ||
(0, _columns2.default)(e.columns, rootCss, opts); | ||
(0, _customStyles2.default)(e.customStyles, rootCss, 0); | ||
(0, _customStyles2.default)(e.customStyles[0], rootCss); | ||
@@ -92,11 +92,11 @@ for (var breakpoint = opts.min; breakpoint <= opts.max; breakpoint++) { | ||
(0, _containersQuery2.default)(e.containers, mediaQuery, opts, breakpoint); | ||
(0, _blocsFloatQuery2.default)(e.blocs, mediaQuery, opts, breakpoint); | ||
(0, _blocsFloatQuery2.default)(e.blocs[breakpoint], mediaQuery, opts); | ||
(0, _blocsQuery2.default)(e.blocs, mediaQuery, opts, breakpoint); | ||
(0, _blobsFloatQuery2.default)(e.blobs, mediaQuery, opts, breakpoint); | ||
(0, _blobsQuery2.default)(e.blobs, mediaQuery, opts, breakpoint); | ||
(0, _showsQuery2.default)(e.shows, mediaQuery, breakpoint); | ||
(0, _hidesQuery2.default)(e.hides, mediaQuery, breakpoint); | ||
(0, _rightsQuery2.default)(e.rights, mediaQuery, opts, breakpoint); | ||
(0, _blobsFloatQuery2.default)(e.blobs[breakpoint], mediaQuery, opts); | ||
(0, _blobsQuery2.default)(e.blobs[breakpoint], mediaQuery, opts); | ||
(0, _showsQuery2.default)(e.shows[breakpoint], mediaQuery); | ||
(0, _hidesQuery2.default)(e.hides[breakpoint], mediaQuery); | ||
(0, _rightsQuery2.default)(e.rights[breakpoint], mediaQuery, opts); | ||
(0, _columnsQuery2.default)(e.columns, mediaQuery, opts, breakpoint); | ||
(0, _customStyles2.default)(e.customStyles, mediaQuery, breakpoint); | ||
(0, _customStyles2.default)(e.customStyles[breakpoint], mediaQuery); | ||
@@ -103,0 +103,0 @@ rootCss.append(mediaQuery); |
{ | ||
"name": "postcss-structure", | ||
"version": "0.8.1", | ||
"version": "0.8.2", | ||
"description": "A PostCSS plugin to create CSS grids based on a fixed block width.", | ||
@@ -38,5 +38,5 @@ "keywords": [ | ||
"babel-register": "^6.7.2", | ||
"eslint": "^2.7.0", | ||
"eslint-config-airbnb": "^6.2.0", | ||
"eslint-plugin-react": "^4.3.0" | ||
"eslint": "^2.8.0", | ||
"eslint-config-airbnb": "^7.0.0", | ||
"eslint-plugin-react": "^5.0.1" | ||
}, | ||
@@ -43,0 +43,0 @@ "eslintConfig": { |
@@ -11,2 +11,3 @@ # postcss-structure [![Build Status][ci-img]][ci] | ||
* * * | ||
@@ -41,2 +42,4 @@ ## Installation | ||
* * * | ||
## Configuration | ||
@@ -61,2 +64,4 @@ | ||
* * * | ||
## Usage | ||
@@ -63,0 +68,0 @@ |
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
249
60737