postcss-grid-system
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -19,38 +19,49 @@ 'use strict'; | ||
if (blocs && blocs.length) { | ||
var blocLeft = {}; | ||
var blocRight = {}; | ||
(function () { | ||
var blocLeft = {}; | ||
var blocRight = {}; | ||
var blocWidthFill = function blocWidthFill(unit, width) { | ||
if (blocs[unit] && blocs[unit][width] && blocs[unit][width][1]) { | ||
_utils2.default.selectorsAdd(blocLeft[width], blocs[unit][width][1]); | ||
} | ||
if (blocs[unit] && blocs[unit][width] && blocs[unit][width][0]) { | ||
_utils2.default.selectorsAdd(blocRight[width], blocs[unit][width][0]); | ||
} | ||
}; | ||
for (var width = 1; width <= breakpoint; width++) { | ||
blocLeft[width] = _postcss2.default.rule(); | ||
blocRight[width] = _postcss2.default.rule(); | ||
if (opts.display === 'float') { | ||
blocLeft[width].append({ prop: 'float', value: 'left' }); | ||
blocLeft[width].append({ prop: 'clear', value: 'none' }); | ||
for (var width = 1; width <= breakpoint; width++) { | ||
blocLeft[width] = _postcss2.default.rule(); | ||
blocRight[width] = _postcss2.default.rule(); | ||
if (opts.display === 'float') { | ||
blocLeft[width].append({ prop: 'float', value: 'left' }); | ||
blocLeft[width].append({ prop: 'clear', value: 'none' }); | ||
blocRight[width].append({ prop: 'float', value: 'right' }); | ||
blocRight[width].append({ prop: 'clear', value: 'none' }); | ||
} else { | ||
blocRight[width].append({ prop: 'margin-left', value: 'auto' }); | ||
blocRight[width].append({ prop: 'float', value: 'right' }); | ||
blocRight[width].append({ prop: 'clear', value: 'none' }); | ||
} else { | ||
blocRight[width].append({ prop: 'margin-left', value: 'auto' }); | ||
} | ||
} | ||
} | ||
for (var _width = 0; _width <= breakpoint; _width++) { | ||
if (blocs[breakpoint] && blocs[breakpoint][_width] && blocs[breakpoint][_width][1]) { | ||
_utils2.default.selectorsAdd(blocLeft[_width], blocs[breakpoint][_width][1]); | ||
for (var unit = 0; unit <= opts.max; unit++) { | ||
if (unit === breakpoint) { | ||
for (var _width = 0; _width <= breakpoint; _width++) { | ||
blocWidthFill(unit, _width); | ||
} | ||
} else if (unit < breakpoint) { | ||
blocWidthFill(unit, breakpoint); | ||
} | ||
} | ||
if (blocs[breakpoint] && blocs[breakpoint][_width] && blocs[breakpoint][_width][0]) { | ||
_utils2.default.selectorsAdd(blocRight[_width], blocs[breakpoint][_width][0]); | ||
} | ||
} | ||
for (var _width2 = 1; _width2 <= breakpoint; _width2++) { | ||
if (blocRight[_width2].selector && blocRight[_width2].nodes.length) { | ||
node.append(blocRight[_width2]); | ||
} | ||
for (var _width2 = 1; _width2 <= breakpoint; _width2++) { | ||
if (blocRight[_width2].selector && blocRight[_width2].nodes.length) { | ||
node.append(blocRight[_width2]); | ||
} | ||
if (blocLeft[_width2].selector && blocLeft[_width2].nodes.length) { | ||
node.append(blocLeft[_width2]); | ||
if (blocLeft[_width2].selector && blocLeft[_width2].nodes.length) { | ||
node.append(blocLeft[_width2]); | ||
} | ||
} | ||
} | ||
})(); | ||
} | ||
}; |
@@ -19,29 +19,40 @@ 'use strict'; | ||
if (blocs.length) { | ||
var blocWidth = {}; | ||
(function () { | ||
var blocWidth = {}; | ||
var blocWidthFill = function blocWidthFill(unit, width) { | ||
if (blocs[unit] && blocs[unit][width] && blocs[unit][width][1]) { | ||
_utils2.default.selectorsAdd(blocWidth[width], blocs[unit][width][1]); | ||
} | ||
if (blocs[unit] && blocs[unit][width] && blocs[unit][width][0]) { | ||
_utils2.default.selectorsAdd(blocWidth[width], blocs[unit][width][0]); | ||
} | ||
}; | ||
for (var width = 1; width <= breakpoint; width++) { | ||
blocWidth[width] = _postcss2.default.rule(); | ||
var blocWidthValue = opts.width * width - opts.gutter; | ||
if (opts.display === 'flex') { | ||
blocWidth[width].append({ prop: 'flex', value: '0 1 ' + blocWidthValue + 'rem' }); | ||
} else if (opts.display === 'float') { | ||
blocWidth[width].append({ prop: 'width', value: blocWidthValue + 'rem' }); | ||
for (var width = 1; width <= breakpoint; width++) { | ||
blocWidth[width] = _postcss2.default.rule(); | ||
var blocWidthValue = opts.width * width - opts.gutter; | ||
if (opts.display === 'flex') { | ||
blocWidth[width].append({ prop: 'flex', value: '0 1 ' + blocWidthValue + 'rem' }); | ||
} else if (opts.display === 'float') { | ||
blocWidth[width].append({ prop: 'width', value: blocWidthValue + 'rem' }); | ||
} | ||
} | ||
} | ||
for (var _width = 0; _width <= breakpoint; _width++) { | ||
if (blocs[breakpoint] && blocs[breakpoint][_width] && blocs[breakpoint][_width][1]) { | ||
_utils2.default.selectorsAdd(blocWidth[_width], blocs[breakpoint][_width][1]); | ||
for (var unit = 0; unit <= opts.max; unit++) { | ||
if (unit === breakpoint) { | ||
for (var _width = 0; _width <= breakpoint; _width++) { | ||
blocWidthFill(unit, _width); | ||
} | ||
} else if (unit < breakpoint) { | ||
blocWidthFill(unit, breakpoint); | ||
} | ||
} | ||
if (blocs[breakpoint] && blocs[breakpoint][_width] && blocs[breakpoint][_width][0]) { | ||
_utils2.default.selectorsAdd(blocWidth[_width], blocs[breakpoint][_width][0]); | ||
} | ||
} | ||
for (var _width2 = 1; _width2 <= breakpoint; _width2++) { | ||
if (blocWidth[_width2].selector && blocWidth[_width2].nodes.length) { | ||
node.append(blocWidth[_width2]); | ||
for (var _width2 = 1; _width2 <= breakpoint; _width2++) { | ||
if (blocWidth[_width2].selector && blocWidth[_width2].nodes.length) { | ||
node.append(blocWidth[_width2]); | ||
} | ||
} | ||
} | ||
})(); | ||
} | ||
}; |
{ | ||
"name": "postcss-grid-system", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "A PostCSS plugin to create grids based on a fixed column width.", | ||
@@ -27,3 +27,3 @@ "keywords": [ | ||
"dependencies": { | ||
"postcss": "^5.0.21" | ||
"postcss": "^5.1.0" | ||
}, | ||
@@ -37,9 +37,9 @@ "scripts": { | ||
"ava": "^0.15.2", | ||
"babel-cli": "^6.10.1", | ||
"babel-cli": "^6.11.4", | ||
"babel-preset-es2015": "^6.9.0", | ||
"babel-register": "^6.9.0", | ||
"eslint": "^3.0.1", | ||
"eslint": "^3.1.1", | ||
"eslint-config-airbnb": "^9.0.1", | ||
"eslint-plugin-import": "^1.10.2", | ||
"eslint-plugin-jsx-a11y": "^1.5.5", | ||
"eslint-plugin-import": "^1.11.1", | ||
"eslint-plugin-jsx-a11y": "^2.0.1", | ||
"eslint-plugin-react": "^5.2.2" | ||
@@ -46,0 +46,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
28270
510
Updatedpostcss@^5.1.0