postcss-typescale
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -29,19 +29,17 @@ 'use strict'; | ||
if (node.type === 'atrule' && node.name.match(/^typescale/)) { | ||
(function () { | ||
var name = node.params ? node.params : 'default'; | ||
var name = node.params ? node.params : 'default'; | ||
options[name] = options[name] || {}; | ||
options[name] = options[name] || {}; | ||
node.walkDecls(function (decl) { | ||
if (decl.prop.match(/^scale$/)) { | ||
options[name].scale = decl.value; | ||
} else if (decl.prop.match(/^font-size$/)) { | ||
options[name].fontSize = decl.value; | ||
} else if (decl.prop.match(/^line-height$/)) { | ||
options[name].lineHeight = decl.value; | ||
} | ||
}); | ||
node.walkDecls(function (decl) { | ||
if (decl.prop.match(/^scale$/)) { | ||
options[name].scale = decl.value; | ||
} else if (decl.prop.match(/^font-size$/)) { | ||
options[name].fontSize = decl.value; | ||
} else if (decl.prop.match(/^line-height$/)) { | ||
options[name].lineHeight = decl.value; | ||
} | ||
}); | ||
node.remove(); | ||
})(); | ||
node.remove(); | ||
} else if (node.type === 'decl' && node.prop.match(/^typescale/)) { | ||
@@ -48,0 +46,0 @@ var values = node.value.split(/\s+(?![^\[]*\]|[^(]*\)|[^\{]*})/); |
{ | ||
"name": "postcss-typescale", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "A PostCSS plugin to set type based on a typographic scale.", | ||
@@ -23,3 +23,3 @@ "keywords": [ | ||
"dependencies": { | ||
"postcss": "^5.0.21" | ||
"postcss": "^6.0.1" | ||
}, | ||
@@ -32,11 +32,11 @@ "scripts": { | ||
"devDependencies": { | ||
"ava": "^0.15.2", | ||
"babel-cli": "^6.10.1", | ||
"babel-preset-es2015": "^6.9.0", | ||
"babel-register": "^6.9.0", | ||
"eslint": "^3.0.1", | ||
"eslint-config-airbnb": "^9.0.1", | ||
"eslint-plugin-import": "^1.10.2", | ||
"eslint-plugin-jsx-a11y": "^1.5.5", | ||
"eslint-plugin-react": "^5.2.2" | ||
"ava": "^0.19.1", | ||
"babel-cli": "^6.24.1", | ||
"babel-preset-es2015": "^6.24.1", | ||
"babel-register": "^6.24.1", | ||
"eslint": "^3.19.0", | ||
"eslint-config-airbnb": "^15.0.1", | ||
"eslint-plugin-import": "^2.2.0", | ||
"eslint-plugin-jsx-a11y": "^5.0.3", | ||
"eslint-plugin-react": "^7.0.1" | ||
}, | ||
@@ -43,0 +43,0 @@ "eslintConfig": { |
@@ -21,2 +21,40 @@ # postcss-typescale | ||
## Examples | ||
``` css | ||
@typescale { | ||
scale: 1.25; | ||
font-size: 1rem; | ||
line-height: 1.5rem; | ||
} | ||
.xxl { | ||
typescale: 3 2; | ||
} | ||
.xl { | ||
typescale: 2 1.5; | ||
} | ||
.l { | ||
typescale: 1 1.5; | ||
} | ||
.m { | ||
typescale: 0 1; | ||
} | ||
.s { | ||
typescale: -1 1; | ||
} | ||
.xs { | ||
typescale: -2 0.5; | ||
} | ||
``` | ||
01: [input](https://github.com/francoisromain/postcss-typescale/blob/gh-pages/test/src/01.css), [output](https://github.com/francoisromain/postcss-typescale/blob/gh-pages/test/dist/01.css), [markup](https://github.com/francoisromain/postcss-typescale/blob/gh-pages/test/01.html), [demo](https:/francoisromain.github.io/postcss-typescale/test/01.html) | ||
* * * | ||
## Installation | ||
@@ -64,7 +102,2 @@ | ||
* * * | ||
## Examples | ||
01: [input](https://github.com/francoisromain/postcss-typescale/blob/gh-pages/test/src/01.css), [output](https://github.com/francoisromain/postcss-typescale/blob/gh-pages/test/dist/01.css), [markup](https://github.com/francoisromain/postcss-typescale/blob/gh-pages/test/01.html), [demo](https:/francoisromain.github.io/postcss-typescale/test/01.html) | ||
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
8244
102
67
+ Addedansi-styles@3.2.1(transitive)
+ Addedchalk@2.4.2(transitive)
+ Addedcolor-convert@1.9.3(transitive)
+ Addedcolor-name@1.1.3(transitive)
+ Addedhas-flag@3.0.0(transitive)
+ Addedpostcss@6.0.23(transitive)
+ Addedsource-map@0.6.1(transitive)
+ Addedsupports-color@5.5.0(transitive)
- Removedansi-regex@2.1.1(transitive)
- Removedansi-styles@2.2.1(transitive)
- Removedchalk@1.1.3(transitive)
- Removedhas-ansi@2.0.0(transitive)
- Removedhas-flag@1.0.0(transitive)
- Removedjs-base64@2.6.4(transitive)
- Removedpostcss@5.2.18(transitive)
- Removedsource-map@0.5.7(transitive)
- Removedstrip-ansi@3.0.1(transitive)
- Removedsupports-color@2.0.03.2.3(transitive)
Updatedpostcss@^6.0.1