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

postcss-typescale

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-typescale - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

26

lib/index.js

@@ -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)
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