-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Emotion Native #759
Emotion Native #759
Changes from 12 commits
6b9f575
91380c2
38d3012
db3d964
d545607
6ec1ff3
94b0c28
25d75bc
ae75fe3
b80e73f
fc1beb9
ddb2dd2
ee2181c
f839c70
95c28d3
47f5035
fdc1876
abca5e7
c656626
b967b7d
2cf1a06
1073a66
341e192
f427e40
f8483e2
fdaf228
00881d1
df1d259
be12b5c
6a1b33b
32b27c1
f87c05d
975bc68
4f3f998
4e8ca76
8c6694e
84c1bb9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,169 +1,146 @@ | ||
{ | ||
"private": true, | ||
"version": "7.0.13", | ||
"scripts": { | ||
"build:watch": "node scripts/build/watch", | ||
"build": "node scripts/build", | ||
"test:size": "npm-run-all build size", | ||
"test:debug": "node --inspect-brk ./node_modules/jest/bin/jest.js --runInBand --watch", | ||
"test": "npm-run-all -p lint:check coverage test:size test:typescript flow && npm run test:prod", | ||
"test:typescript": "lerna run test:typescript --parallel", | ||
"coverage": "jest --coverage --no-cache --ci --runInBand", | ||
"test:prod": "npm run build && jest -c jest.dist.js --no-cache --ci --runInBand", | ||
"lint:check": "eslint .", | ||
"test:watch": "jest --watch --no-cache", | ||
"size": "bundlesize", | ||
"release": "npm run build && lerna publish", | ||
"lint": "eslint . --fix", | ||
"benchmark": "lerna exec --scope benchmarks npm run benchmark", | ||
"start:site": "lerna exec --scope emotion-site npm run start:site", | ||
"build:site": "lerna exec --scope emotion-site npm run build:site", | ||
"bootstrap": "lerna bootstrap", | ||
"flow": "flow check" | ||
}, | ||
"resolutions": { | ||
"**/react": "^16.3.2", | ||
"**/react-dom": "^16.3.2", | ||
"**/browserslist": "^3.2.8" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "7.0.0-beta.51", | ||
"@babel/plugin-external-helpers": "7.0.0-beta.51", | ||
"@babel/preset-env": "7.0.0-beta.51", | ||
"@babel/preset-flow": "7.0.0-beta.51", | ||
"@babel/preset-react": "7.0.0-beta.51", | ||
"@babel/preset-stage-0": "7.0.0-beta.51", | ||
"babel-check-duplicated-nodes": "^1.0.0", | ||
"babel-cli": "^6.24.1", | ||
"babel-core": "^6.24.1", | ||
"babel-eslint": "^8.2.3", | ||
"babel-flow-types": "^1.2.3", | ||
"babel-jest": "^23.2.0", | ||
"babel-plugin-closure-elimination": "^1.3.0", | ||
"babel-plugin-codegen": "^1.2.0", | ||
"babel-plugin-external-helpers": "^6.22.0", | ||
"babel-plugin-macros": "^2.0.0", | ||
"babel-polyfill": "^6.26.0", | ||
"babel-preset-env": "^1.5.1", | ||
"babel-preset-flow": "^6.23.0", | ||
"babel-preset-react": "^6.24.1", | ||
"babel-preset-stage-0": "^6.24.1", | ||
"bundlesize": "^0.13.2", | ||
"codecov": "^2.3.1", | ||
"css": "^2.2.1", | ||
"cssjanus": "^1.2.0", | ||
"enzyme": "^3.1.1", | ||
"enzyme-adapter-react-16": "^1.0.4", | ||
"enzyme-to-json": "^3.2.1", | ||
"eslint": "^4.5.0", | ||
"eslint-config-prettier": "^2.3.0", | ||
"eslint-config-react": "^1.1.7", | ||
"eslint-config-standard": "^10.2.1", | ||
"eslint-config-standard-react": "^5.0.0", | ||
"eslint-plugin-import": "^2.7.0", | ||
"eslint-plugin-node": "^5.1.1", | ||
"eslint-plugin-prettier": "^2.2.0", | ||
"eslint-plugin-promise": "^3.5.0", | ||
"eslint-plugin-react": "^7.3.0", | ||
"eslint-plugin-standard": "^3.0.1", | ||
"flow-bin": "^0.73.0", | ||
"gatsby-react-router-scroll": "^1.0.7", | ||
"get-lerna-packages": "^0.1.0", | ||
"hoist-non-react-statics": "^2.3.1", | ||
"jest": "^23.2.0", | ||
"jest-in-case": "^1.0.2", | ||
"jest-serializer-html": "^4.0.1", | ||
"jest-watch-typeahead": "^0.1.0", | ||
"jsdom": "^11.3.0", | ||
"lerna": "^2.2.0", | ||
"lerna-alias": "^3.0.1", | ||
"module-alias": "^2.0.1", | ||
"npm-run-all": "^4.0.2", | ||
"polished": "^1.2.1", | ||
"prettier": "1.10.2", | ||
"raf": "^3.4.0", | ||
"react": "^16.3.2", | ||
"react-dom": "^16.3.2", | ||
"react-router-dom": "^4.2.2", | ||
"react-test-renderer": "^16.3.2" | ||
}, | ||
"author": "Kye Hohenberger", | ||
"homepage": "https://github.com/tkh44/emotion#readme", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/tkh44/emotion.git" | ||
}, | ||
"directories": { | ||
"test": "tests" | ||
}, | ||
"keywords": [ | ||
"styles", | ||
"emotion", | ||
"react", | ||
"css", | ||
"css-in-js" | ||
], | ||
"eslintConfig": { | ||
"extends": [ | ||
"standard", | ||
"standard-react", | ||
"prettier", | ||
"prettier/react" | ||
], | ||
"plugins": [ | ||
"prettier" | ||
], | ||
"parser": "babel-eslint", | ||
"rules": { | ||
"prettier/prettier": "error", | ||
"react/prop-types": 0, | ||
"react/no-unused-prop-types": 0, | ||
"standard/computed-property-even-spacing": 0, | ||
"no-template-curly-in-string": 0, | ||
"camelcase": 0, | ||
"import/no-duplicates": 0 | ||
}, | ||
"env": { | ||
"browser": true | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": [ | ||
"*.test.js", | ||
"**/__tests__/*" | ||
], | ||
"env": { | ||
"jest": true | ||
} | ||
}, | ||
{ | ||
"files": [ | ||
"**/packages/*/src/*", | ||
"**/packages/*/src/**/*" | ||
], | ||
"rules": { | ||
"import/no-commonjs": 2 | ||
} | ||
} | ||
] | ||
}, | ||
"workspaces": [ | ||
"packages/*", | ||
"site", | ||
"scripts/*" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/tkh44/emotion/issues" | ||
}, | ||
"bundlesize": [ | ||
{ | ||
"path": "./packages/emotion/dist/emotion.umd.min.js", | ||
"threshold": "7 Kb" | ||
}, | ||
{ | ||
"path": "./packages/react-emotion/dist/emotion.umd.min.js", | ||
"threshold": "9.7 Kb" | ||
} | ||
] | ||
"private": true, | ||
"version": "7.0.13", | ||
"scripts": { | ||
"build:watch": "node scripts/build/watch", | ||
"build": "node scripts/build", | ||
"test:size": "npm-run-all build size", | ||
"test:debug": "node --inspect-brk ./node_modules/jest/bin/jest.js --runInBand --watch", | ||
"test": "npm-run-all -p lint:check coverage test:size test:typescript flow && npm run test:prod", | ||
"test:typescript": "lerna run test:typescript --parallel --env=jsdom", | ||
"coverage": "jest --coverage --no-cache --ci --runInBand", | ||
"test:prod": "npm run build && jest -c jest.dist.js --no-cache --ci --runInBand --env=jsdom", | ||
"lint:check": "eslint .", | ||
"test:watch": "jest --watch --no-cache --env=jsdom", | ||
"size": "bundlesize", | ||
"release": "npm run build && lerna publish", | ||
"lint": "eslint . --fix", | ||
"benchmark": "lerna exec --scope benchmarks npm run benchmark", | ||
"start:site": "lerna exec --scope emotion-site npm run start:site", | ||
"build:site": "lerna exec --scope emotion-site npm run build:site", | ||
"bootstrap": "lerna bootstrap", | ||
"flow": "flow check" | ||
}, | ||
"resolutions": { | ||
"**/react": "^16.3.2", | ||
"**/react-dom": "^16.3.2", | ||
"**/browserslist": "^3.2.8" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "7.0.0-beta.51", | ||
"@babel/plugin-external-helpers": "7.0.0-beta.51", | ||
"@babel/preset-env": "7.0.0-beta.51", | ||
"@babel/preset-flow": "7.0.0-beta.51", | ||
"@babel/preset-react": "7.0.0-beta.51", | ||
"@babel/preset-stage-0": "7.0.0-beta.51", | ||
"babel-check-duplicated-nodes": "^1.0.0", | ||
"babel-cli": "^6.24.1", | ||
"babel-core": "^6.24.1", | ||
"babel-eslint": "^8.2.3", | ||
"babel-flow-types": "^1.2.3", | ||
"babel-jest": "^23.2.0", | ||
"babel-plugin-closure-elimination": "^1.3.0", | ||
"babel-plugin-codegen": "^1.2.0", | ||
"babel-plugin-external-helpers": "^6.22.0", | ||
"babel-plugin-macros": "^2.0.0", | ||
"babel-polyfill": "^6.26.0", | ||
"babel-preset-env": "^1.5.1", | ||
"babel-preset-flow": "^6.23.0", | ||
"babel-preset-react": "^6.24.1", | ||
"babel-preset-stage-0": "^6.24.1", | ||
"bundlesize": "^0.13.2", | ||
"codecov": "^2.3.1", | ||
"css": "^2.2.1", | ||
"cssjanus": "^1.2.0", | ||
"enzyme": "^3.1.1", | ||
"enzyme-adapter-react-16": "^1.0.4", | ||
"enzyme-to-json": "^3.2.1", | ||
"eslint": "^4.5.0", | ||
"eslint-config-prettier": "^2.3.0", | ||
"eslint-config-react": "^1.1.7", | ||
"eslint-config-standard": "^10.2.1", | ||
"eslint-config-standard-react": "^5.0.0", | ||
"eslint-plugin-import": "^2.7.0", | ||
"eslint-plugin-node": "^5.1.1", | ||
"eslint-plugin-prettier": "^2.2.0", | ||
"eslint-plugin-promise": "^3.5.0", | ||
"eslint-plugin-react": "^7.3.0", | ||
"eslint-plugin-standard": "^3.0.1", | ||
"flow-bin": "^0.73.0", | ||
"gatsby-react-router-scroll": "^1.0.7", | ||
"get-lerna-packages": "^0.1.0", | ||
"hoist-non-react-statics": "^2.3.1", | ||
"jest": "^23.2.0", | ||
"jest-in-case": "^1.0.2", | ||
"jest-serializer-html": "^4.0.1", | ||
"jest-watch-typeahead": "^0.1.0", | ||
"jsdom": "^11.3.0", | ||
"lerna": "^2.2.0", | ||
"lerna-alias": "^3.0.1", | ||
"module-alias": "^2.0.1", | ||
"npm-run-all": "^4.0.2", | ||
"polished": "^1.2.1", | ||
"prettier": "1.10.2", | ||
"raf": "^3.4.0", | ||
"react": "^16.3.2", | ||
"react-dom": "^16.3.2", | ||
"react-router-dom": "^4.2.2", | ||
"react-test-renderer": "^16.3.2" | ||
}, | ||
"author": "Kye Hohenberger", | ||
"homepage": "https://github.com/tkh44/emotion#readme", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/tkh44/emotion.git" | ||
}, | ||
"directories": { | ||
"test": "tests" | ||
}, | ||
"keywords": ["styles", "emotion", "react", "css", "css-in-js"], | ||
"eslintConfig": { | ||
"extends": ["standard", "standard-react", "prettier", "prettier/react"], | ||
"plugins": ["prettier"], | ||
"parser": "babel-eslint", | ||
"rules": { | ||
"prettier/prettier": "error", | ||
"react/prop-types": 0, | ||
"react/no-unused-prop-types": 0, | ||
"standard/computed-property-even-spacing": 0, | ||
"no-template-curly-in-string": 0, | ||
"camelcase": 0, | ||
"import/no-duplicates": 0 | ||
}, | ||
"env": { | ||
"browser": true | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": ["*.test.js", "**/__tests__/*"], | ||
"env": { | ||
"jest": true | ||
} | ||
}, | ||
{ | ||
"files": ["**/packages/*/src/*", "**/packages/*/src/**/*"], | ||
"rules": { | ||
"import/no-commonjs": 2 | ||
} | ||
} | ||
] | ||
}, | ||
"workspaces": ["packages/*", "site", "scripts/*"], | ||
"bugs": { | ||
"url": "https://github.com/tkh44/emotion/issues" | ||
}, | ||
"bundlesize": [ | ||
{ | ||
"path": "./packages/emotion/dist/emotion.umd.min.js", | ||
"threshold": "7 Kb" | ||
}, | ||
{ | ||
"path": "./packages/react-emotion/dist/emotion.umd.min.js", | ||
"threshold": "9.7 Kb" | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# @emotion/native | ||
|
||
> Style and render React Native components using emotion | ||
|
||
## Install | ||
|
||
``` | ||
npm install @emotion/native | ||
``` | ||
|
||
or if you use yarn | ||
|
||
``` | ||
yarn add @emotion/native | ||
``` | ||
|
||
This package also depends on `react`, `react-native` and `prop-types` so make sure you've them installed. | ||
|
||
## Example | ||
|
||
```js | ||
import React from 'react' | ||
import { AppRegistry } from 'react-native'; | ||
import styled, { css } from '@emotion/native' | ||
|
||
const Container = styled.View` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
margin: 50px; | ||
` | ||
|
||
const Description = styled.Text({ | ||
color: 'hotpink' | ||
}) | ||
|
||
const Image = styled.Image` | ||
padding: 40px; | ||
` | ||
|
||
const emotionLogo = | ||
'https://cdn.rawgit.com/emotion-js/emotion/master/emotion.png' | ||
|
||
class App extends React.Component { | ||
render() { | ||
return ( | ||
<Container | ||
style={css` | ||
border-radius: 10px; | ||
`} | ||
> | ||
<Description style={{ fontSize: 45, fontWeight: 'bold' }}> | ||
Emotion Primitives | ||
</Description> | ||
<Image | ||
source={{ | ||
uri: emotionLogo, | ||
height: 150, | ||
width: 150 | ||
}} | ||
/> | ||
</Container> | ||
) | ||
} | ||
} | ||
|
||
AppRegistry.registerComponent('ExampleApp', () => App); | ||
``` | ||
|
||
The API surface remains same for `@emotion/native` which means you can use all the API methods similar to `emotion`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reading this is confusing, the same as what? emotion? or There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops! I missed those parts of emotion API. I'll fix it. |
||
|
||
## Theming | ||
|
||
Use `emotion-theming` for theming support. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. An example maybe? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm... That'd be great! I'll add it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you be able to revert these formatting changes in the package.jsons?