Socket
Socket
Sign inDemoInstall

emotion

Package Overview
Dependencies
Maintainers
1
Versions
144
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

emotion - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

LICENSE

98

package.json
{
"name": "emotion",
"version": "1.0.0",
"description": "emotion React component",
"main": "lib/index.js",
"module": "es/index.js",
"version": "1.0.1",
"description": "👩‍🎤 Glam + React",
"jsnext:main": "dist/emotion.es.js",
"module": "dist/emotion.es.js",
"main": "dist/glam.js",
"umd:main": "dist/emotion.umd.js",
"files": [
"css",
"es",
"lib",
"umd"
"src",
"glam.js"
],
"scripts": {
"build": "nwb build-react-component",
"clean": "nwb clean-module && npm clean-demo",
"start": "nwb serve-react-demo",
"test": "nwb test-react",
"test:coverage": "nwb test-react --coverage",
"test:watch": "nwb test-react --server"
"build": "npm-run-all clean -p rollup -p minify:* -s size",
"clean": "rimraf dist",
"test": "standard src test && jest --coverage",
"test:watch": "jest --watch",
"rollup": "rollup -c",
"minify:cjs": "uglifyjs $npm_package_main -cm toplevel -o $npm_package_main -p relative --in-source-map ${npm_package_main}.map --source-map ${npm_package_main}.map",
"minify:umd": "uglifyjs $npm_package_umd_main -cm -o $npm_package_umd_main -p relative --in-source-map ${npm_package_umd_main}.map --source-map ${npm_package_umd_main}.map",
"size": "echo \"Gzipped Size: $(strip-json-comments --no-whitespace $npm_package_main | gzip-size)\"",
"release": "npm run test && npm run build && npm version patch && npm publish && git push --tags"
},
"dependencies": {},
"peerDependencies": {
"react": "15.x"
"dependencies": {
"babel-plugin-syntax-jsx": "^6.18.0",
"glam": "^4.0.3"
},
"devDependencies": {
"nwb": "0.15.x",
"babel-cli": "^6.24.1",
"babel-core": "^6.24.1",
"babel-eslint": "^7.2.3",
"babel-jest": "^20.0.3",
"babel-loader": "^7.0.0",
"babel-preset-env": "^1.5.1",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"gzip-size-cli": "^2.0.0",
"jest": "^20.0.4",
"jest-cli": "^20.0.4",
"jest-glamor-react": "^1.4.0",
"npm-run-all": "^4.0.2",
"pretty-bytes-cli": "^2.0.0",
"react": "^15.5.4",
"react-dom": "^15.5.4"
"react-addons-test-utils": "^15.5.1",
"react-dom": "^15.5.4",
"react-test-renderer": "^15.5.4",
"rimraf": "^2.6.1",
"rollup": "^0.41.6",
"rollup-plugin-babel": "^2.7.1",
"rollup-plugin-buble": "^0.15.0",
"rollup-plugin-commonjs": "^8.0.2",
"rollup-plugin-node-resolve": "^3.0.0",
"standard": "^10.0.2",
"strip-json-comments-cli": "^1.0.1",
"uglify-js": "2.8.23"
},
"author": "",
"homepage": "",
"author": "Kye Hohenberger",
"homepage": "https://github.com/tkh44/emotion#readme",
"license": "MIT",
"repository": "",
"repository": {
"type": "git",
"url": "git+https://github.com/tkh44/emotion.git"
},
"directories": {
"test": "tests"
},
"keywords": [
"react-component"
]
"styles",
"emotion",
"react",
"css",
"css-in-js"
],
"eslintConfig": {
"extends": "standard",
"parser": "babel-eslint"
},
"standard": {
"parser": "babel-eslint",
"ignore": [
"/dist/"
]
},
"bugs": {
"url": "https://github.com/tkh44/emotion/issues"
}
}
# emotion
[![Travis][build-badge]][build]
[![npm package][npm-badge]][npm]
[![Coveralls][coveralls-badge]][coveralls]
## 👩‍🎤 Glam + React
Describe emotion here.
[![npm version](https://badge.fury.io/js/emotion.svg)](https://badge.fury.io/js/emotion)
[![Build Status](https://travis-ci.org/tkh44/emotion.svg?branch=master)](https://travis-ci.org/tkh44/emotion)
[![codecov](https://codecov.io/gh/tkh44/emotion/branch/master/graph/badge.svg)](https://codecov.io/gh/tkh44/emotion)
[build-badge]: https://img.shields.io/travis/user/repo/master.png?style=flat-square
[build]: https://travis-ci.org/user/repo
[npm-badge]: https://img.shields.io/npm/v/npm-package.png?style=flat-square
[npm]: https://www.npmjs.org/package/npm-package
- [Install](#install)
- [Example Project](https://github.com/tkh44/emotion/tree/master/examples/glam)
[coveralls-badge]: https://img.shields.io/coveralls/user/repo/master.png?style=flat-square
[coveralls]: https://coveralls.io/github/user/repo
## Install
```bash
npm install -S emotion glam
```
**.babelrc**
```json
{
"plugins": [
"emotion/glam",
"glam/babel"
]
}
```
## API
### emotion
```jsx
import { emotion } from 'emotion'
const H1 = emotion('h1')`
color: 'blue';
font-size: 48px;
transform: scale(${props => props.scale});
`
function Greeting ({ name }) {
return <H1 scale={2}>Hello {name}</H1> // blue, 48px, and scaled 2x text
}
// You can also pass components in
const H2 = emotion(H1)`
font-size: ${fontSize * 2/3}px;
color: 'red';
`
function Greeting ({ name }) {
return <H2>Hello {name}</H2> // red, 32px, and scaled 2x text
}
// this works too
const H3 = emotion.h3`
font-size: ${fontSize * 1/3}px;
color: 'red';
`
function Greeting ({ name }) {
return <H3>Hello {name}</H3> // red, 16px text
}
```
### css prop
When using the emotion babel plugin, any `css` prop is converted to a class name via glam and appended to any existing class names.
**Similar to importing React when using jsx, `import css from 'glam'` must be at the top of your source files.**
```jsx harmony
const Name = ({ color, name }) => <h1 css={`color: ${color};`}>{name}</h1>
// is converted to
const Name = ({ color, name }) => <h1 className={css`color: ${color};`}>{name}</h1>
```
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