postcss-grid-fluid
Advanced tools
Comparing version 0.1.11 to 0.1.12
{ | ||
"name": "postcss-grid-fluid", | ||
"version": "0.1.11", | ||
"version": "0.1.12", | ||
"description": "A PostCSS plugin to create fluid grids.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -38,4 +38,14 @@ # postcss-grid-fluid | ||
Global settings rule (and default values): | ||
#### Option 1: In javascript | ||
``` javascript | ||
{ | ||
width: 1; /* width/total of one blob integer if there is a _total_ or a float smaller than 1. */ | ||
gutter: 0; /* width of the gutter */ | ||
display: 'flex'; /* 'float' or 'flex' */ | ||
} | ||
``` | ||
#### Option 2: in css | ||
``` css | ||
@@ -49,2 +59,4 @@ @gf { | ||
If no configuration, the default value. | ||
* * * | ||
@@ -51,0 +63,0 @@ |
import postcss from 'postcss'; | ||
export default (decl, margin, display) => { | ||
export default (decl, gutter, display) => { | ||
const clearfixRule = postcss.rule({ selector: `${decl.parent.selector}::after` }); | ||
@@ -12,5 +12,10 @@ clearfixRule.append({ prop: 'content', value: '""' }); | ||
postcss.decl({ prop: 'clear', value: 'both' }), | ||
postcss.decl({ prop: 'margin-right', value: `-${margin}` }), | ||
]; | ||
if (gutter !== '0') { | ||
declNew = declNew.concat([ | ||
postcss.decl({ prop: 'margin-right', value: `-${gutter}` }), | ||
]); | ||
} | ||
if (display === 'flex') { | ||
@@ -17,0 +22,0 @@ declNew = declNew.concat([ |
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
12670
187
83