├── .gitignore ├── example ├── basic │ ├── template.html │ ├── hot.js │ ├── index.js │ └── components │ │ ├── Main.js │ │ └── Styled.js └── minimal │ └── index.html ├── dist ├── react-sc.es.min.js.gz ├── react-sc.es.min.js └── react-sc.min.js ├── src ├── hash.js ├── index.js ├── process.js ├── Styled.js └── elements.js ├── .babelrc ├── rollup.config.umd.js ├── rollup.config.es.js ├── LICENSE ├── webpack.config.dev.js ├── README.md ├── package.json └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /example/basic/template.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | -------------------------------------------------------------------------------- /dist/react-sc.es.min.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/didierfranc/react-sc/HEAD/dist/react-sc.es.min.js.gz -------------------------------------------------------------------------------- /example/basic/hot.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom' 3 | 4 | import { App, root } from './' 5 | 6 | ReactDOM.render(
59 |
60 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-sc",
3 | "version": "0.2.1",
4 | "main": "./dist/react-sc.min.js",
5 | "jsnext:main": "./dist/react-sc.es.min.js",
6 | "author": "Didier Franc",
7 | "license": "MIT",
8 | "scripts": {
9 | "start": "webpack-dev-server --open --config webpack.config.dev.js",
10 | "build": "rm -rf ./dist && yarn build:es && yarn build:umd && yarn gzip",
11 | "build:es": "rollup -c rollup.config.es.js",
12 | "build:umd": "rollup -c rollup.config.umd.js",
13 | "gzip": "gzip -c ./dist/react-sc.es.min.js > ./dist/react-sc.es.min.js.gz && gzip -lv ./dist/react-sc.es.min.js.gz",
14 | "precommit": "lint-staged"
15 | },
16 | "lint-staged": {
17 | "src/*.js": [
18 | "prettier --write --no-semi --single-quote --trailing-comma all",
19 | "git add"
20 | ]
21 | },
22 | "dependencies": {
23 | "babel-plugin-transform-object-rest-spread": "^6.23.0",
24 | "react": "^15.5.4",
25 | "react-dom": "^15.5.4",
26 | "stylis": ">=2.0.11"
27 | },
28 | "devDependencies": {
29 | "babel-cli": "^6.23.0",
30 | "babel-core": "^6.23.1",
31 | "babel-loader": "^6.3.1",
32 | "babel-plugin-add-module-exports": "^0.2.1",
33 | "babel-polyfill": "^6.23.0",
34 | "babel-preset-es2015": "^6.22.0",
35 | "babel-preset-latest": "^6.24.1",
36 | "babel-preset-react": "^6.24.1",
37 | "babel-preset-stage-0": "^6.22.0",
38 | "html-webpack-plugin": "^2.28.0",
39 | "husky": "^0.13.3",
40 | "lint-staged": "^3.4.1",
41 | "prettier": "^1.3.1",
42 | "rollup": "^0.41.6",
43 | "rollup-plugin-babel": "^2.7.1",
44 | "rollup-plugin-commonjs": "^8.0.2",
45 | "rollup-plugin-node-resolve": "^3.0.0",
46 | "rollup-plugin-uglify": "^1.0.2",
47 | "uglify-js-harmony": "^2.7.7",
48 | "webpack": "^2.2.1",
49 | "webpack-dev-server": "^2.3.0"
50 | },
51 | "peerDependencies": {
52 | "react": "^15.5.4",
53 | "react-dom": "^15.5.4"
54 | },
55 | "description": "A tiny library to create styled components, it's inspired by the great [styled-components](https://github.com/styled-components/styled-components) and [styled-jsx](https://github.com/zeit/styled-jsx). These two libraries use [postcss](https://github.com/postcss/postcss) to generate proper scoped CSS, **react-sc** use the new kid in town: [stylis](https://github.com/thysultan/stylis.js).",
56 | "repository": {
57 | "type": "git",
58 | "url": "git+https://github.com/didierfranc/react-sc.git"
59 | },
60 | "keywords": [
61 | "react",
62 | "styled",
63 | "components"
64 | ],
65 | "bugs": {
66 | "url": "https://github.com/didierfranc/react-sc/issues"
67 | },
68 | "homepage": "https://github.com/didierfranc/react-sc#readme"
69 | }
70 |
--------------------------------------------------------------------------------
/dist/react-sc.es.min.js:
--------------------------------------------------------------------------------
1 | function createCommonjsModule(e,t){return t={exports:{}},e(t,t.exports),t.exports}function _objectWithoutProperties(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}import React from"react";var elements=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],commonjsGlobal="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},stylis=createCommonjsModule(function(e,t){!function(t){e.exports=t(commonjsGlobal)}(function(e){"use strict";function t(e,y,x,A,C){e+="";var k,O,j,w=C,N="",T="",P=e.charCodeAt(0);switch(P<33&&(P=(e=e.trim()).charCodeAt(0)),P){case 35:case 46:T=(N=e).substring(1);break;case 91:O=e.substring(1,e.length-1).split("="),k=(T=O[1]||O[0]).charCodeAt(0),34!==k&&39!==k||(T=T.substring(1,T.length-1)),N="["+O[0]+(O.length>1?'="'+T+'"]':"]");break;default:T=N=e}P=0,x===!0||void 0===x||null===x?(x=!0,j=T.replace(p,"-")):(j="",x=!1);var R,S=void 0!==w&&null!==w,$=l.length;S===!0&&(R=(typeof w).charCodeAt(0),111===R?r(w):102===R?l[$++]=w:S=!1),0!==$&&(w=1===$?l[0]:n,S=!0);var E,G,_,z,F,q,D,M,W,Z,B,H,I,J,K,L,Q,U="",V="",X="",Y=0,ee=0,te=0,re=0,ne=0,le=0,ae=0,ie=0,se=0,oe=0,ce=0,de=0,he=0,ue=0;S===!0&&(q=w(0,y,me,pe,N,0),null!=q&&(y=q),K="");for(var fe=0,ge=0,pe=0,me=1,be=y.length,ve="";fe