Socket
Socket
Sign inDemoInstall

jss-px

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jss-px - npm Package Compare versions

Comparing version 0.1.4 to 0.2.0

.babelrc

6

history.md

@@ -0,1 +1,7 @@

## 0.2.0 / 2015-09-21
- migrate to es6
- move examples to jss-examples repository
- simplify packaging
## 0.1.2 / 2015-02-10

@@ -2,0 +8,0 @@

43

package.json
{
"name": "jss-px",
"description": "Adds default px unit to numeric values where needed.",
"version": "0.1.4",
"description": "JSS plugin that adds default px unit to numeric values where needed",
"version": "0.2.0",
"author": {

@@ -19,18 +19,33 @@ "name": "Oleg Slobodskoi",

"engines": {},
"scripts": {},
"licenses": [
{
"type": "MIT",
"url": "http://www.opensource.org/licenses/mit-license.php"
}
],
"scripts": {
"all": "npm run lint && npm run build",
"test": "opener ./test/index.html",
"build": "npm run clean && npm run build:lib && npm run build:max && npm run build:min",
"clean": "rimraf ./lib/*",
"build:lib": "babel src --out-dir lib",
"build:max": "NODE_ENV=development webpack src/index.js dist/jss-px.js",
"build:min": "NODE_ENV=production webpack src/index.js dist/jss-px.min.js",
"lint": "eslint ./src",
"prepublish": "npm run all && git push --tags"
},
"license": "MIT",
"main": "./lib/index.js",
"devDependencies": {
"browserify": "6.0.3",
"babel": "^5.6.14",
"babel-core": "^5.6.20",
"babel-eslint": "^3.1.23",
"babel-loader": "^5.3.1",
"eslint": "^0.24.1",
"eslint-config-airbnb": "^0.0.6",
"eslint-config-jss": "^0.1.0",
"eslint-plugin-react": "^2.7.0",
"jss": "^2.3.4",
"opener": "^1.4.1",
"qunitjs": "1.15.0",
"xpkg": "0.2.0",
"jss": "^2.1.0"
"rimraf": "^2.4.3",
"webpack": "^1.11.0"
},
"peerDependencies": {
"jss": "^2.1.0"
"jss": "^2.3.4"
}
}
}

@@ -1,43 +0,56 @@

## Default value unit plugin for JSS
![JSS logo](http://avatars1.githubusercontent.com/u/9503099?v=3&s=60)
This plugin adds `px` to values for [jss](https://github.com/jsstyles/jss).
## JSS plugin that adds default px unit to numeric values where needed
Take a look at [examples](http://jsstyles.github.io/jss-px/examples/index.html) directory.
This plugin lets you omit the `px` unit from values of style properties.
[Demo](http://jsstyles.github.io/jss-examples/index.html#plugin-jss-px) -
[JSS](https://github.com/jsstyles/jss)
[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/jsstyles/jss?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
## Usage example
```javascript
exports.styles = {
button: {
'font-size': 20,
'z-index': 1,
'line-height': 1.2
}
}
import jss from 'jss'
import px from 'jss-px'
jss.use(px)
const styleSheet = jss.createStyleSheet({
container: {
'font-size': 20,
'z-index': 1,
'line-height': 1.2
}
})
```
```javascript
console.log(styleSheet.toString())
```
```css
button {
font-size: 20px;
z-index: 1;
line-height: 1.2
.jss-0-0 {
font-size: 20px;
z-index: 1;
line-height: 1.2;
}
```
## Register plugin
```javascript
var jss = require('jss')
var px = require('jss-px')
jss.use(px)
console.log(styleSheet.classes)
```
```javascript
{ container: "jss-0-0" }
```
## Run tests
### Locally
```bash
npm i
open test/local.html
npm run test
```
### From github
[Tests](https://jsstyles.github.com/jss-px/test)

@@ -44,0 +57,0 @@ ## License

Sorry, the diff of this file is not supported yet

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