Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

postcss-grid-system

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-grid-system - npm Package Compare versions

Comparing version 0.4.1 to 0.4.2

33

lib/blocs-query.js

@@ -21,8 +21,13 @@ 'use strict';

var blocWidth = {};
var blocLeft = {};
var blocRight = {};
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]);
_utils2.default.selectorsAdd(blocLeft[width], blocs[unit][width][1]);
}
if (blocs[unit] && blocs[unit][width] && blocs[unit][width][0]) {
_utils2.default.selectorsAdd(blocWidth[width], blocs[unit][width][0]);
_utils2.default.selectorsAdd(blocRight[width], blocs[unit][width][0]);
}

@@ -32,8 +37,16 @@ };

for (var width = 1; width <= breakpoint; width++) {
blocLeft[width] = _postcss2.default.rule();
blocRight[width] = _postcss2.default.rule();
blocWidth[width] = _postcss2.default.rule();
var blocWidthValue = opts.width * width - opts.gutter;
if (opts.display === 'flex') {
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' });
blocWidth[width].append({ prop: 'width', value: blocWidthValue + 'rem' });
} else {
blocRight[width].append({ prop: 'margin-left', value: 'auto' });
blocWidth[width].append({ prop: 'flex', value: '0 1 ' + blocWidthValue + 'rem' });
} else if (opts.display === 'float') {
blocWidth[width].append({ prop: 'width', value: blocWidthValue + 'rem' });
}

@@ -43,8 +56,8 @@ }

for (var unit = 0; unit <= opts.max; unit++) {
if (unit === breakpoint) {
if (unit < breakpoint) {
blocWidthFill(unit, breakpoint);
} else if (unit === breakpoint) {
for (var _width = 0; _width <= breakpoint; _width++) {
blocWidthFill(unit, _width);
}
} else if (unit < breakpoint) {
blocWidthFill(unit, breakpoint);
}

@@ -57,2 +70,10 @@ }

}
if (blocRight[_width2].selector && blocRight[_width2].nodes.length) {
node.append(blocRight[_width2]);
}
if (blocLeft[_width2].selector && blocLeft[_width2].nodes.length) {
node.append(blocLeft[_width2]);
}
}

@@ -59,0 +80,0 @@ })();

5

lib/grid-system.js

@@ -43,6 +43,2 @@ 'use strict';

var _blocsAlignQuery = require('./blocs-align-query');
var _blocsAlignQuery2 = _interopRequireDefault(_blocsAlignQuery);
var _columnsQuery = require('./columns-query');

@@ -75,3 +71,2 @@

(0, _blocsAlignQuery2.default)(e.blocs, mediaQuery, opts, breakpoint);
(0, _blocsQuery2.default)(e.blocs, mediaQuery, opts, breakpoint);

@@ -78,0 +73,0 @@

{
"name": "postcss-grid-system",
"version": "0.4.1",
"version": "0.4.2",
"description": "A PostCSS plugin to create grids based on a fixed column width.",

@@ -5,0 +5,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc