├── ReadmeSrc ├── .env_example ├── scripts │ ├── updateData.js │ └── fetchData.js ├── img │ ├── info.svg │ ├── download.svg │ ├── tag.svg │ └── star.svg ├── Readme.js ├── package.json ├── Readme.md ├── Rows.js └── yarn.lock ├── es-css-modules ├── .babelrc ├── index.html ├── button.js ├── button.css ├── package.json └── gulpfile.babel.js ├── stylable ├── .babelrc ├── index.html ├── button.js ├── button.st.css ├── webpack.config.js ├── package.json └── main.css ├── pre-style ├── _vars.scss ├── app.scss ├── .babelrc ├── PreStyleConfig.js ├── index.html ├── webpack.config.js ├── button.js └── package.json ├── cxs ├── .babelrc ├── index.html ├── webpack.config.js ├── package.json └── button.js ├── linaria ├── .babelrc ├── index.html ├── webpack.config.js ├── package.json └── button.js ├── .gitignore ├── webpage ├── public │ ├── favicon.ico │ ├── manifest.json │ └── index.html ├── src │ ├── App.test.js │ ├── index.js │ ├── components │ │ ├── Navbar.js │ │ ├── Filter.js │ │ ├── Seo.js │ │ └── Table.js │ ├── App.js │ └── registerServiceWorker.js ├── .gitignore └── package.json ├── .prettierrc ├── react-css-components ├── .babelrc ├── index.html ├── webpack.config.js ├── button.js ├── styles.react.css └── package.json ├── babel-plugin-pre-style ├── PreStyleConfig.js ├── atomic.css ├── index.html ├── webpack.config.js ├── atomic.css.classNames.js ├── package.json └── button.js ├── babel-plugin-css-in-js ├── .babelrc ├── webpack.config.js ├── index.html ├── package.json └── button.js ├── stilr ├── makefile ├── webpack.config.js ├── index.html ├── package.json └── button.js ├── aphrodite ├── bootstrap.js ├── webpack.config.js ├── index.html ├── other │ └── generate-css-file.js ├── package.json └── button.js ├── style-it ├── webpack.config.js ├── index.html ├── package.json └── button.js ├── j2c ├── webpack.config.js ├── index.html ├── package.json └── button.js ├── css-ns ├── css-ns.js ├── webpack.config.js ├── index.html ├── button.js ├── package.json └── button.css ├── cssobj ├── webpack.config.js ├── index.html ├── package.json └── button.js ├── react-jss ├── webpack.config.js ├── index.html ├── jss.js ├── package.json └── button.js ├── smart-css ├── webpack.config.js ├── index.html ├── package.json └── button.js ├── classy ├── webpack.config.js ├── index.html ├── package.json └── button.js ├── csjs ├── webpack.config.js ├── index.html ├── button.js ├── package.json └── styles.js ├── electron-css ├── index.html ├── webpack.config.js ├── package.json └── index.js ├── freestyler ├── index.html ├── webpack.config.js ├── package.json └── button.js ├── nano-css ├── index.html ├── nano.js ├── webpack.config.js ├── package.json └── button.js ├── radium ├── webpack.config.js ├── index.html ├── package.json └── button.js ├── css-light ├── index.html ├── webpack.config.js ├── base.js ├── package.json └── button.js ├── hiccup-css ├── webpack.config.js ├── index.html ├── button.js ├── package.json └── styles.js ├── react-css-builder ├── webpack.config.js ├── index.html ├── package.json └── button.js ├── react-inline-css ├── webpack.config.js ├── index.html ├── package.json └── button.js ├── react-inline-style ├── webpack.config.js ├── index.html ├── package.json └── button.js ├── react-look ├── webpack.config.js ├── index.html ├── package.json └── button.js ├── react-statics-styles ├── webpack.config.js ├── index.html ├── gulpfile.js ├── package.json └── button.jsx ├── react-theme ├── webpack.config.js ├── index.html ├── package.json └── button.js ├── glamor ├── index.html ├── webpack.config.js ├── package.json └── button.js ├── react-free-style ├── webpack.config.js ├── index.html ├── package.json └── button.js ├── react-native-web ├── webpack.config.js ├── index.html ├── package.json └── button.js ├── react-stylematic ├── webpack.config.js ├── index.html ├── package.json └── button.js ├── scope-styles ├── webpack.config.js ├── index.html ├── package.json └── button.js ├── emotion ├── index.html ├── button.emotion.css ├── webpack.config.js ├── package.json └── button.js ├── glamorous ├── index.html ├── webpack.config.js ├── package.json └── button.js ├── jsxstyle ├── index.html ├── webpack.config.js ├── button.js └── package.json ├── reactcss ├── index.html ├── webpack.config.js ├── package.json └── button.js ├── restyles ├── index.html ├── webpack.config.js ├── package.json └── button.js ├── typestyle ├── index.html ├── webpack.config.js ├── package.json └── button.js ├── uranium ├── index.html ├── webpack.config.js ├── package.json └── button.js ├── cssx-loader ├── index.html ├── webpack.config.js ├── package.json └── button.js ├── react-styl ├── index.html ├── webpack.config.js ├── package.json └── button.js ├── styled-jsx ├── index.html ├── webpack.config.js ├── package.json └── button.js ├── superstyle ├── index.html ├── webpack.config.js ├── button.js └── package.json ├── css-constructor ├── index.html ├── webpack.config.js ├── package.json └── button.js ├── i-css ├── index.html ├── webpack.config.js ├── package.json └── button.js ├── bloody-react-styled ├── index.html ├── webpack.config.js ├── button.css ├── button.js └── package.json ├── styled-components ├── index.html ├── webpack.config.js ├── package.json └── button.js ├── stile-react-media-queries ├── index.html ├── webpack.config.js ├── package.json └── button.js ├── react-fela ├── index.html ├── webpack.config.js ├── package.json └── button.js ├── react-vstyle ├── index.html ├── webpack.config.js ├── package.json └── button.js ├── styling ├── index.html ├── button.js ├── button.styling.js ├── webpack.config.js └── package.json ├── css-loader ├── index.html ├── button.js ├── button.css ├── webpack.config.js └── package.json ├── hyperstyles ├── index.html ├── button.css ├── webpack.config.js ├── button.js └── package.json ├── react-style ├── index.html ├── webpack.config.js ├── package.json └── button.js ├── react-inline ├── index.html ├── package.json └── button.js ├── styletron-react ├── webpack.config.js ├── index.html ├── package.json └── button.js ├── react-styleable ├── index.html ├── button.css ├── button.js ├── webpack.config.js └── package.json ├── react-css-modules ├── index.html ├── button.css ├── button.js ├── webpack.config.js └── package.json ├── react-cssom ├── index.html ├── webpack.config.js ├── button.css ├── package.json └── button.js ├── .travis.yml └── LICENSE /ReadmeSrc/.env_example: -------------------------------------------------------------------------------- 1 | GITHUB_TOKEN = YOURKEY -------------------------------------------------------------------------------- /es-css-modules/.babelrc: -------------------------------------------------------------------------------- 1 | { "presets": ["es2015", "react"] } 2 | -------------------------------------------------------------------------------- /stylable/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["env", "react"] 3 | } 4 | -------------------------------------------------------------------------------- /pre-style/_vars.scss: -------------------------------------------------------------------------------- 1 | //Sass Variables 2 | $bgc: #ff0000; 3 | $hoverBgc: #fff; 4 | -------------------------------------------------------------------------------- /cxs/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "es2015", 4 | "react" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /linaria/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "env", 4 | "react" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | lib/ 2 | node_modules/ 3 | bundle.css 4 | bundle.js 5 | .idea 6 | .vscode 7 | .env -------------------------------------------------------------------------------- /webpage/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicheleBertoli/css-in-js/HEAD/webpage/public/favicon.ico -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "bracketSpacing": false, 4 | "semi": false, 5 | "printWidth": 80 6 | } 7 | -------------------------------------------------------------------------------- /react-css-components/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | presets: ['es2015', 'react'], 3 | plugins: ['transform-object-rest-spread'] 4 | } 5 | -------------------------------------------------------------------------------- /pre-style/app.scss: -------------------------------------------------------------------------------- 1 | @import 'vars'; // Can be used in Pre-Style with "prependedFiles" option 2 | @import 'atomic'; // <- Generated by Pre-Style 3 | -------------------------------------------------------------------------------- /pre-style/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015", "react"], 3 | "plugins": [ 4 | ["pre-style", { "config": "PreStyleConfig.js" }] 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /babel-plugin-pre-style/PreStyleConfig.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | destination: './', 3 | outputFile: 'atomic.css', 4 | nameSpaces: ['styled'], 5 | }; 6 | -------------------------------------------------------------------------------- /babel-plugin-css-in-js/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "es2015", 4 | "react" 5 | ], 6 | "plugins": [ 7 | "css-in-js" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /stilr/makefile: -------------------------------------------------------------------------------- 1 | extract-styles: 2 | @node -p "require('babel/register')({ignore: false});; var s = require('stilr'); require('./button.js'); s.render()" > ./bundle.css 3 | -------------------------------------------------------------------------------- /pre-style/PreStyleConfig.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | destination: './', 3 | outputFile: '_atomic.scss', 4 | prependedFiles: ['_vars.scss'], 5 | nameSpaces: ['styled'], 6 | }; 7 | -------------------------------------------------------------------------------- /aphrodite/bootstrap.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom' 3 | import Button from './button'; 4 | 5 | ReactDOM.render( 8 | 9 | ); 10 | 11 | ReactDOM.render(, document.getElementById('content')); 12 | -------------------------------------------------------------------------------- /stile-react-media-queries/webpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | module: { 3 | loaders: [{ 4 | test: /\.jsx?$/, 5 | exclude: /node_modules/, 6 | loader: "babel", 7 | query: { 8 | presets: ["es2015", "react"], 9 | plugins: ["transform-object-rest-spread"], 10 | }, 11 | }] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /bloody-react-styled/webpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | module: { 3 | loaders: [{ 4 | test: /\.jsx?$/, 5 | exclude: /(node_modules|bower_components)/, 6 | loader: 'babel?stage=0' 7 | }, { 8 | test: /\.css$/, 9 | loaders: [ 10 | 'style/useable', 11 | 'css' 12 | ] 13 | }] 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /css-ns/button.js: -------------------------------------------------------------------------------- 1 | const {React} = require('./css-ns')('Button'); 2 | 3 | const Button = React.createClass({ 4 | render() { 5 | return ( 6 |
7 | 8 |
9 | ); 10 | } 11 | }); 12 | 13 | React.render( 9 | 10 | ); 11 | } 12 | }); 13 | 14 | React.render( 9 | 10 | ); 11 | } 12 | }); 13 | 14 | React.render( 9 | 10 | ); 11 | } 12 | }); 13 | 14 | React.render( 11 | 12 | 13 | ); 14 | 15 | render(, document.getElementById('content')); 16 | -------------------------------------------------------------------------------- /emotion/button.emotion.css: -------------------------------------------------------------------------------- 1 | .css-Container-10pov3x { text-align: center; } 2 | .css-Button-1wslxb2 { background-color: #ff0000; 3 | width: 320px; 4 | padding: 20px; 5 | border-radius: 5px; 6 | border: none; 7 | outline: none; } 8 | .css-Button-1wslxb2:hover { color: #fff; } 9 | .css-Button-1wslxb2:active { position: relative; top: 2px; } 10 | @media (max-width: 480px) { 11 | .css-Button-1wslxb2 { width: 160px; } } -------------------------------------------------------------------------------- /hiccup-css/button.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import styles from './styles'; 3 | 4 | const Button = React.createClass({ 5 | render() { 6 | return ( 7 |
8 | 9 |
10 | ); 11 | } 12 | }); 13 | 14 | React.render( 10 | 11 | ); 12 | } 13 | }); 14 | 15 | render( 12 | 13 | ); 14 | } 15 | }; 16 | 17 | React.render( 11 | 12 | ); 13 | } 14 | }; 15 | 16 | React.render( 13 | 14 | ); 15 | } 16 | }; 17 | 18 | React.render( 15 | 16 | ); 17 | } 18 | }; 19 | 20 | React.render( 21 | , 22 | document.getElementById('content') 23 | ); 24 | -------------------------------------------------------------------------------- /jsxstyle/button.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import {Block} from 'jsxstyle'; 4 | 5 | const styles = { 6 | button: { 7 | backgroundColor: '#ff0000', 8 | width: '320px', 9 | padding: '20px', 10 | borderRadius: '5px', 11 | border: 'none', 12 | outline: 'none' 13 | } 14 | }; 15 | 16 | const Button = props => ( 17 | 18 | 19 | 20 | ); 21 | 22 | ReactDOM.render(; 16 | } 17 | } 18 | 19 | Button.displayName = 'Button'; 20 | 21 | ReactDOM.render( 22 | 23 | 24 | , 25 | document.getElementById('content') 26 | ); 27 | -------------------------------------------------------------------------------- /ReadmeSrc/img/tag.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | tag 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /glamorous/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "glamor-css-css-in-js", 3 | "version": "1.0.0", 4 | "description": "glamorous - CSS in JS", 5 | "scripts": { 6 | "build": "webpack ./button.js bundle.js" 7 | }, 8 | "author": "Michele Bertoli", 9 | "license": "MIT", 10 | "dependencies": { 11 | "glamor": "^2.2.0", 12 | "glamorous": "^4.12.5", 13 | "react": "^16.3", 14 | "react-dom": "^16.3" 15 | }, 16 | "devDependencies": { 17 | "babel-core": "^6.18.2", 18 | "babel-loader": "^6.2.4", 19 | "babel-preset-env": "^1.3.2", 20 | "babel-preset-react": "^6.11.1", 21 | "webpack": "^1.13.1" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /react-jss/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-jss-css-in-js", 3 | "version": "2.0.0", 4 | "description": "react-jss - CSS in JS", 5 | "scripts": { 6 | "build": "webpack ./button.js bundle.js" 7 | }, 8 | "author": "Michele Bertoli", 9 | "license": "MIT", 10 | "dependencies": { 11 | "jss": "^3.6.0", 12 | "jss-vendor-prefixer": "^2.0.0", 13 | "jss-camel-case": "^1.0.2", 14 | "jss-default-unit": "^2.1.1", 15 | "jss-nested": "^1.0.3", 16 | "react": "^0.13.3", 17 | "react-jss": "^2.0.5" 18 | }, 19 | "devDependencies": { 20 | "babel-loader": "^5.1.3", 21 | "webpack": "^1.9.9" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /cssx-loader/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cssx-loader-css-in-js", 3 | "version": "1.0.0", 4 | "description": "cssx-loader - CSS in JS", 5 | "scripts": { 6 | "build": "webpack ./button.js bundle.js" 7 | }, 8 | "author": "Michele Bertoli", 9 | "license": "MIT", 10 | "dependencies": { 11 | "cssx": "^3.8.0", 12 | "react": "^15.0.1", 13 | "react-dom": "^15.0.1" 14 | }, 15 | "devDependencies": { 16 | "babel-core": "^6.18.2", 17 | "babel-loader": "^6.2.4", 18 | "babel-preset-es2015": "^6.6.0", 19 | "babel-preset-react": "^6.5.0", 20 | "cssx-loader": "^3.8.0", 21 | "webpack": "^1.13.0" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /jsxstyle/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jsxstyle-css-in-js", 3 | "version": "1.0.0", 4 | "description": "jsxstyle - CSS in JS", 5 | "scripts": { 6 | "build": "webpack ./button.js -o bundle.js" 7 | }, 8 | "author": "Michele Bertoli", 9 | "license": "MIT", 10 | "dependencies": { 11 | "jsxstyle": "^2.1.1", 12 | "react": "^16.4.1", 13 | "react-dom": "^16.4.1" 14 | }, 15 | "devDependencies": { 16 | "babel-core": "^6.26.3", 17 | "babel-loader": "^7.1.4", 18 | "babel-preset-env": "^1.7.0", 19 | "babel-preset-react": "^6.24.1", 20 | "webpack": "^4.12.0", 21 | "webpack-command": "^0.2.1" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /react-fela/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-fela-css-in-js", 3 | "version": "1.0.0", 4 | "description": "react-fela - CSS in JS", 5 | "scripts": { 6 | "build": "webpack ./button.js bundle.js" 7 | }, 8 | "author": "Michele Bertoli", 9 | "license": "MIT", 10 | "dependencies": { 11 | "fela": "^1.1.0", 12 | "react": "^15.3.0", 13 | "react-dom": "^15.3.0", 14 | "react-fela": "^2.1.0" 15 | }, 16 | "devDependencies": { 17 | "babel-core": "^6.11.4", 18 | "babel-loader": "^6.2.4", 19 | "babel-preset-es2015": "^6.9.0", 20 | "babel-preset-react": "^6.11.1", 21 | "webpack": "^1.13.1" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /styled-components/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "styled-components-css-in-js", 3 | "version": "1.0.0", 4 | "description": "styled-components - CSS in JS", 5 | "scripts": { 6 | "build": "webpack ./button.js bundle.js" 7 | }, 8 | "author": "Michele Bertoli", 9 | "license": "MIT", 10 | "dependencies": { 11 | "react": "^16.3.0", 12 | "react-dom": "^16.3.0", 13 | "styled-components": "^3.2.6" 14 | }, 15 | "devDependencies": { 16 | "babel-core": "^6.11.4", 17 | "babel-loader": "^6.2.4", 18 | "babel-preset-es2015": "^6.9.0", 19 | "babel-preset-react": "^6.11.1", 20 | "webpack": "^1.13.1" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /stylable/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "stylable-css-in-js", 3 | "version": "1.0.0", 4 | "description": "stylable - css-in-js", 5 | "scripts": { 6 | "build": "webpack ./button.js bundle.js" 7 | }, 8 | "author": "Michele Bertoli", 9 | "license": "MIT", 10 | "dependencies": { 11 | "react": "^16.2.0", 12 | "react-dom": "^16.2.0", 13 | "stylable": "^5.0.2", 14 | "stylable-integration": "^6.0.1" 15 | }, 16 | "devDependencies": { 17 | "babel-core": "^6.26.0", 18 | "babel-loader": "^7.1.2", 19 | "babel-preset-env": "^1.6.1", 20 | "babel-preset-react": "^6.24.1", 21 | "webpack": "^3.10.0" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ReadmeSrc/Readme.js: -------------------------------------------------------------------------------- 1 | const moment = require('moment') 2 | const table = require('markdown-table') 3 | 4 | const {getRows, headers} = require('./Rows') 5 | 6 | function getDate() { 7 | return moment().format('LL') 8 | } 9 | 10 | function getTable() { 11 | const data = require('../webpage/src/data.json') 12 | 13 | const rows = getRows(data.rows) 14 | const align = headers.map(x => 'c') 15 | align[0] = 'l' 16 | align[headers.length - 1] = 'l' 17 | const pad = false 18 | 19 | rows.unshift(headers) 20 | 21 | return table(rows, { 22 | align, 23 | pad 24 | }) 25 | } 26 | 27 | module.exports = { 28 | getDate, 29 | getTable 30 | } 31 | -------------------------------------------------------------------------------- /babel-plugin-css-in-js/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "babel-plugin-css-in-js", 3 | "version": "1.0.0", 4 | "description": "babel-plugin-css-in-js - CSS in JS", 5 | "scripts": { 6 | "build": "webpack ./button.js bundle.js" 7 | }, 8 | "author": "Martin Andert", 9 | "license": "MIT", 10 | "dependencies": { 11 | "react": "^0.14.2", 12 | "react-dom": "^0.14.2" 13 | }, 14 | "devDependencies": { 15 | "babel-core": "^6.1.21", 16 | "babel-loader": "^6.1.0", 17 | "babel-plugin-css-in-js": "^1.2.2", 18 | "babel-preset-es2015": "^6.1.18", 19 | "babel-preset-react": "^6.1.18", 20 | "webpack": "^1.12.6" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /stylable/main.css: -------------------------------------------------------------------------------- 1 | .button1977411557💠root .button1977411557💠container { 2 | text-align: center; 3 | } 4 | 5 | .button1977411557💠root .button1977411557💠button { 6 | background-color: #ff0000; 7 | width: 320px; 8 | padding: 20px; 9 | border-radius: 5px; 10 | border: none; 11 | outline: none; 12 | } 13 | 14 | .button1977411557💠root .button1977411557💠button:hover { 15 | color: #fff; 16 | } 17 | 18 | .button1977411557💠root .button1977411557💠button:active { 19 | position: relative; 20 | top: 2px; 21 | } 22 | 23 | @media (max-width: 480px) { 24 | .button1977411557💠root .button1977411557💠button { 25 | width: 160px 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /stile-react-media-queries/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "stile-react-media-queries", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "button.js", 6 | "scripts": { 7 | "build": "webpack button.js bundle.js" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "devDependencies": { 12 | "babel-loader": "^6.2.1", 13 | "babel-plugin-transform-object-rest-spread": "^6.3.13", 14 | "babel-preset-es2015": "^6.3.13", 15 | "babel-preset-react": "^6.3.13", 16 | "react": "^0.14.6", 17 | "react-dom": "^0.14.6", 18 | "react-media-queries": "^2.0.1", 19 | "stile": "^2.0.0", 20 | "webpack": "^1.12.11" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /emotion/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "emotion-css-in-js", 3 | "version": "1.0.0", 4 | "description": "emotion - css-in-js", 5 | "scripts": { 6 | "build": "webpack ./button.js bundle.js" 7 | }, 8 | "author": "Michele Bertoli", 9 | "license": "MIT", 10 | "dependencies": { 11 | "emotion": "^6.0.3", 12 | "react": "^15.6.1", 13 | "react-dom": "^15.6.1" 14 | }, 15 | "devDependencies": { 16 | "babel-core": "^6.25.0", 17 | "babel-loader": "^7.1.1", 18 | "babel-preset-env": "^1.6.0", 19 | "babel-preset-react": "^6.24.1", 20 | "css-loader": "^0.28.4", 21 | "style-loader": "^0.18.2", 22 | "webpack": "^3.3.0" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /styletron-react/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "styletron-react-css-in-js", 3 | "version": "1.0.0", 4 | "description": "styletron-react - CSS in JS", 5 | "scripts": { 6 | "build": "webpack ./button.js bundle.js" 7 | }, 8 | "author": "Michele Bertoli", 9 | "license": "MIT", 10 | "dependencies": { 11 | "react": "^15.3.0", 12 | "react-dom": "^15.3.0", 13 | "styletron-client": "^2.1.2", 14 | "styletron-react": "^2.1.2" 15 | }, 16 | "devDependencies": { 17 | "babel-core": "^6.11.4", 18 | "babel-loader": "^6.2.4", 19 | "babel-preset-es2015": "^6.9.0", 20 | "babel-preset-react": "^6.11.1", 21 | "webpack": "^1.13.1" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /aphrodite/other/generate-css-file.js: -------------------------------------------------------------------------------- 1 | import {writeFileSync} from 'fs' 2 | import {resolve} from 'path' 3 | import React from 'react' 4 | import ReactDOMServer from 'react-dom/server' 5 | import {StyleSheetServer} from 'aphrodite' 6 | import Button from '../button' 7 | 8 | generateCSSFile( 9 | 27 | 28 | )); 29 | 30 | render( 23 | 24 | ); 25 | } 26 | }); 27 | 28 | React.render( 24 | 25 | ); 26 | 27 | ReactDOM.render( 31 | 32 | ); 33 | 34 | render(, document.getElementById('content')); 35 | -------------------------------------------------------------------------------- /nano-css/button.js: -------------------------------------------------------------------------------- 1 | import React, {Component} from 'react'; 2 | import {render} from 'react-dom'; 3 | import {rule} from './nano'; 4 | 5 | const container = rule({ 6 | textAlign: 'center' 7 | }); 8 | 9 | const button = rule({ 10 | background: 'red', 11 | width: '320px', 12 | padding: '20px', 13 | borderRadius: '5px', 14 | border: 'none', 15 | outline: 'none', 16 | ':hover': { 17 | color: '#fff', 18 | }, 19 | ':active': { 20 | position: 'relative', 21 | top: '2px', 22 | }, 23 | '@media (max-width: 480px)': { 24 | width: '160px', 25 | }, 26 | }); 27 | 28 | render( 29 |
30 | 31 |
32 | , document.getElementById('content')); 33 | -------------------------------------------------------------------------------- /style-it/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "style-it-css-in-js", 3 | "version": "1.0.0", 4 | "description": "Reactive Style - CSS in JS", 5 | "scripts": { 6 | "build": "webpack ./button.js bundle.js" 7 | }, 8 | "author": "Michele Bertoli", 9 | "license": "MIT", 10 | "dependencies": { 11 | "react": "^15.3.0", 12 | "react-dom": "^15.3.0", 13 | "style-it": "^1.2.9" 14 | }, 15 | "babel": { 16 | "presets": [ 17 | "es2015", 18 | "stage-1", 19 | "react" 20 | ] 21 | }, 22 | "devDependencies": { 23 | "babel-loader": "^6.2.4", 24 | "babel-preset-es2015": "^6.13.2", 25 | "babel-preset-react": "^6.11.1", 26 | "babel-preset-stage-1": "^6.13.0", 27 | "webpack": "^1.13.1" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /react-css-components/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-css-components-css-in-js", 3 | "version": "1.0.0", 4 | "description": "react-css-components - CSS in JS", 5 | "scripts": { 6 | "build": "webpack ./button.js bundle.js" 7 | }, 8 | "author": "Michele Bertoli", 9 | "license": "MIT", 10 | "dependencies": { 11 | "react": "^15.1.0", 12 | "react-dom": "^15.1.0" 13 | }, 14 | "devDependencies": { 15 | "babel-loader": "^6.2.4", 16 | "babel-plugin-transform-object-rest-spread": "^6.8.0", 17 | "babel-preset-es2015": "^6.9.0", 18 | "babel-preset-react": "^6.5.0", 19 | "css-loader": "^0.23.1", 20 | "react-css-components": "^0.6.9", 21 | "style-loader": "^0.13.1", 22 | "webpack": "^1.13.1" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /styled-components/button.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { render } from 'react-dom'; 3 | import styled from 'styled-components'; 4 | 5 | const Container = styled.div` 6 | text-align: center; 7 | `; 8 | 9 | const Button = styled.button` 10 | background-color: #ff0000; 11 | width: 320px; 12 | padding: 20px; 13 | border-radius: 5px; 14 | border: none; 15 | outline: none; 16 | &:hover { 17 | color: #fff; 18 | } 19 | &:active { 20 | position: relative; 21 | top: 2px; 22 | } 23 | @media (max-width: 480px) { 24 | width: 160px; 25 | } 26 | `; 27 | 28 | const App = () => ( 29 | 30 | 31 | 32 | ); 33 | 34 | render(, document.getElementById('content')); 35 | -------------------------------------------------------------------------------- /react-theme/button.js: -------------------------------------------------------------------------------- 1 | import React, {Component} from 'react' 2 | import Theme from 'react-theme' 3 | 4 | const theme = new Theme() 5 | 6 | theme.setSource('container', () => ({ 7 | textAlign: 'center' 8 | })) 9 | 10 | theme.setSource('button', () => ({ 11 | backgroundColor: '#ff0000', 12 | width: '320px', 13 | padding: '20px', 14 | borderRadius: '5px', 15 | border: 'none', 16 | outline: 'none' 17 | })) 18 | 19 | class Button extends Component { 20 | render() { 21 | return ( 22 |
23 | 26 |
27 | ) 28 | } 29 | } 30 | 31 | React.render( 26 | 27 | ); 28 | } 29 | } 30 | 31 | React.render( 31 | 32 | ); 33 | 34 | ReactDOM.render(, document.getElementById('content')); 35 | -------------------------------------------------------------------------------- /linaria/button.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { render } from 'react-dom'; 3 | import { css, include, styles } from 'linaria'; 4 | 5 | const container = css` 6 | text-align: center; 7 | `; 8 | 9 | const button = css` 10 | background-color: #ff0000; 11 | width: 320px; 12 | padding: 20px; 13 | border-radius: 5px; 14 | border: none; 15 | outline: none; 16 | &:hover { 17 | color: #fff; 18 | } 19 | &:active { 20 | position: relative; 21 | top: 2px; 22 | } 23 | @media (max-width: 480px) { 24 | width: 160px; 25 | } 26 | `; 27 | 28 | const App = () => ( 29 |
30 | 33 |
34 | ); 35 | 36 | render(, document.getElementById('content')); 37 | -------------------------------------------------------------------------------- /webpage/src/components/Filter.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | const Filter = props => { 4 | return ( 5 |
6 | {props.filters.map((x, index) => { 7 | return ( 8 |
9 | 18 |
19 | ); 20 | })} 21 |
22 | ); 23 | }; 24 | 25 | export default Filter; 26 | -------------------------------------------------------------------------------- /aphrodite/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "aphrodite-css-in-js", 3 | "version": "1.0.0", 4 | "description": "aphrodite - CSS in JS", 5 | "scripts": { 6 | "build": "webpack ./bootstrap.js bundle.js", 7 | "generate-css-file": "babel-node ./other/generate-css-file" 8 | }, 9 | "author": "Michele Bertoli", 10 | "license": "MIT", 11 | "dependencies": { 12 | "aphrodite": "1.2.3", 13 | "react": "15.1.0" 14 | }, 15 | "devDependencies": { 16 | "babel-cli": "6.9.0", 17 | "babel-core": "6.9.1", 18 | "babel-loader": "6.2.4", 19 | "babel-preset-es2015": "6.9.0", 20 | "babel-preset-react": "6.5.0", 21 | "react-dom": "15.1.0", 22 | "webpack": "^1.9.9" 23 | }, 24 | "babel": { 25 | "presets": [ 26 | "es2015", 27 | "react" 28 | ] 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /electron-css/index.js: -------------------------------------------------------------------------------- 1 | import React, {Component} from 'react'; 2 | import {render} from 'react-dom'; 3 | import {CSS, MediaQuery} from 'electron-css'; 4 | 5 | const mobileOnly = MediaQuery({ 6 | maxWidth: '480px' 7 | }) 8 | 9 | const container = CSS({ 10 | textAlign: 'center' 11 | }); 12 | 13 | const button = CSS({ 14 | background: 'red', 15 | width: '320px', 16 | padding: '20px', 17 | borderRadius: '5px', 18 | border: 'none', 19 | outline: 'none', 20 | onHover: { 21 | color: '#fff', 22 | }, 23 | onActive: { 24 | position: 'relative', 25 | top: '2px', 26 | }, 27 | [mobileOnly]: { 28 | width: '160px' 29 | } 30 | }); 31 | 32 | render( 33 |
34 | 35 |
36 | , document.getElementById('content')); -------------------------------------------------------------------------------- /react-styl/button.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactStyl from 'react-styl'; 3 | 4 | ReactStyl(` 5 | 6 | .container 7 | text-align: center 8 | 9 | .button 10 | background-color: #ff0000 11 | width: 320px 12 | padding: 20px 13 | border-radius: 5px 14 | border: none 15 | outline: none 16 | &:hover 17 | color: #fff 18 | &:active 19 | position: relative 20 | top: 2px 21 | 22 | @media (max-width: 480px) 23 | .button 24 | width: 160px 25 | 26 | `); 27 | 28 | const Button = React.createClass({ 29 | render() { 30 | return ( 31 |
32 | 33 |
34 | ); 35 | } 36 | }); 37 | 38 | ReactStyl.addStylesheet(); 39 | 40 | React.render( 34 | 35 | ); 36 | } 37 | } 38 | 39 | render(, document.getElementById('content')); 40 | -------------------------------------------------------------------------------- /es-css-modules/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gulp-es-css-modules-demo", 3 | "version": "0.0.1", 4 | "main": "index.js", 5 | "scripts": { 6 | "build": "gulp", 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "devDependencies": { 13 | "babel": "^6.5.2", 14 | "babel-loader": "^6.2.4", 15 | "babel-preset-es2015": "^6.6.0", 16 | "babel-preset-react": "^6.5.0", 17 | "del": "^2.2.0", 18 | "es-css-modules": "^1.2.1", 19 | "eslint": "^2.7.0", 20 | "eslint-config-airbnb": "^6.2.0", 21 | "eslint-plugin-react": "^4.3.0", 22 | "gulp": "^3.9.1", 23 | "gulp-postcss": "^6.1.1", 24 | "webpack": "^1.13.1" 25 | }, 26 | "dependencies": { 27 | "react": "^0.14.8", 28 | "react-dom": "^0.14.8" 29 | }, 30 | "description": "" 31 | } 32 | -------------------------------------------------------------------------------- /aphrodite/button.js: -------------------------------------------------------------------------------- 1 | import React, {Component} from 'react'; 2 | import {StyleSheet, css} from 'aphrodite'; 3 | 4 | const styles = StyleSheet.create({ 5 | container: { 6 | textAlign: 'center' 7 | }, 8 | button: { 9 | backgroundColor: '#ff0000', 10 | width: '320px', 11 | padding: '20px', 12 | borderRadius: '5px', 13 | border: 'none', 14 | outline: 'none', 15 | ':hover': { 16 | color: '#fff', 17 | }, 18 | ':active': { 19 | position: 'relative', 20 | top: '2px' 21 | }, 22 | '@media (max-width: 480px)': { 23 | width: '160px' 24 | } 25 | } 26 | }); 27 | 28 | export default class Button extends Component { 29 | render() { 30 | return ( 31 |
32 | 33 |
34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /pre-style/button.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './app.scss'; 4 | 5 | const styles = { 6 | container: PreStyle` 7 | text-align: center; 8 | `, 9 | button: PreStyle` 10 | background-color: $bgc; //<- Look Sass in my JS :D 11 | border: none; 12 | border-radius: 5px; 13 | outline: none; 14 | padding: 20px; 15 | width: 320px; 16 | 17 | &:hover { 18 | color: $hoverBgc; 19 | } 20 | 21 | &:active { 22 | position: relative; 23 | top: 2px; 24 | } 25 | 26 | @media (max-width: 480px) { 27 | width: 160px; 28 | } 29 | ` 30 | }; 31 | 32 | const Component = () => ( 33 |
34 | 35 |
36 | ); 37 | 38 | ReactDOM.render(, document.getElementById('content')); 39 | -------------------------------------------------------------------------------- /babel-plugin-css-in-js/button.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { render } from 'react-dom'; 3 | 4 | const styles = cssInJS({ 5 | container: { 6 | textAlign: 'center' 7 | }, 8 | button: { 9 | backgroundColor: '#ff0000', 10 | width: 320, 11 | padding: 20, 12 | borderRadius: 5, 13 | border: 'none', 14 | outline: 'none', 15 | ':hover': { 16 | color: '#fff' 17 | }, 18 | ':active': { 19 | position: 'relative', 20 | top: 2 21 | }, 22 | '@media (max-width: 480px)': { 23 | width: 160 24 | } 25 | } 26 | }); 27 | 28 | class Button extends React.Component { 29 | render() { 30 | return ( 31 |
32 | 33 |
34 | ); 35 | } 36 | } 37 | 38 | render( 34 | 35 | ); 36 | } 37 | } 38 | 39 | React.render( 33 | 34 | ); 35 | } 36 | } 37 | 38 | React.render( 29 | 30 | ); 31 | } 32 | }); 33 | 34 | if (typeof window !== 'undefined') { 35 | React.render( 30 | 31 | ); 32 | } 33 | } 34 | 35 | if (typeof window !== 'undefined') { 36 | React.render( 35 | 36 | ); 37 | } 38 | } 39 | 40 | React.render( 35 | 36 | 37 | ); 38 | } 39 | }); 40 | 41 | React.render( 35 | 36 | ); 37 | } 38 | } 39 | 40 | ReactDOM.render( 37 | 38 | ); 39 | } 40 | }); 41 | 42 | Button = useSheet(Button, styles); 43 | 44 | React.render( 39 | 40 | ); 41 | } 42 | }); 43 | 44 | SmartCSS.injectStyles(); 45 | 46 | React.render( 37 | 38 | ); 39 | } 40 | } 41 | 42 | ReactDOM.render( 35 | 36 | 37 | ); 38 | } 39 | }; 40 | 41 | React.render( 40 | 41 | ); 42 | 43 | const App = () => ( 44 | 45 | 46 | 47 | ); 48 | 49 | render(, document.getElementById('content')); 50 | -------------------------------------------------------------------------------- /styletron-react/button.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { render } from 'react-dom'; 3 | import { styled, StyletronProvider } from 'styletron-react'; 4 | import Styletron from 'styletron-client'; 5 | 6 | const Container = styled('div', { 7 | textAlign: 'center', 8 | }); 9 | 10 | const Button = styled('button', { 11 | backgroundColor: '#ff0000', 12 | width: '320px', 13 | padding: '20px', 14 | borderRadius: '5px', 15 | border: 'none', 16 | outline: 'none', 17 | ':hover': { 18 | color: '#fff', 19 | }, 20 | ':active': { 21 | position: 'relative', 22 | top: '2px', 23 | }, 24 | '@media (max-width: 480px)': { 25 | width: '160px', 26 | }, 27 | }); 28 | 29 | const App = () => ( 30 | 31 | 32 | 33 | ); 34 | 35 | const styleElements = document.getElementsByClassName('_styletron_hydrate_'); 36 | 37 | render( 38 | 39 | 40 | , 41 | document.getElementById('content') 42 | ); 43 | -------------------------------------------------------------------------------- /css-constructor/button.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { render } from 'react-dom'; 3 | import css from 'css-constructor'; 4 | 5 | class Container extends Component { 6 | 7 | @css` 8 | text-align: center; 9 | `; 10 | 11 | render() { 12 | return
{this.props.children}
; 13 | } 14 | 15 | } 16 | 17 | class Button extends Component { 18 | 19 | @css` 20 | background-color: #ff0000; 21 | width: 320px; 22 | padding: 20px; 23 | border-radius: 5px; 24 | border: none; 25 | outline: none; 26 | &:hover { 27 | color: #fff; 28 | } 29 | &:active { 30 | position: relative; 31 | top: 2px; 32 | } 33 | @media (max-width: 480px) { 34 | & { 35 | width: 160px; 36 | } 37 | } 38 | `; 39 | 40 | render() { 41 | return ; 42 | } 43 | 44 | } 45 | 46 | const App = () => ( 47 | 48 | 49 | 50 | ); 51 | 52 | render(, document.getElementById('content')); 53 | -------------------------------------------------------------------------------- /react-inline-css/button.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import InlineCss from 'react-inline-css'; 3 | 4 | const Button = React.createClass({ 5 | render() { 6 | return ( 7 | 32 |
33 | 34 |
35 |
36 | ); 37 | } 38 | }); 39 | 40 | React.render( 39 | 40 | ); 41 | } 42 | } 43 | 44 | render(, document.getElementById('content')); 45 | -------------------------------------------------------------------------------- /react-inline-style/button.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Style from 'react-inline-style'; 3 | 4 | let styles = Style.define({ 5 | container: { 6 | textAlign: 'center' 7 | }, 8 | button: { 9 | backgroundColor: '#ff0000', 10 | width: '320px', 11 | padding: '20px', 12 | borderRadius: '5px', 13 | border: 'none', 14 | outline: 'none', 15 | hover: { 16 | color: '#fff' 17 | }, 18 | pressed: { 19 | position: 'relative', 20 | top: '2px' 21 | } 22 | } 23 | }); 24 | 25 | styles = styles.global({ 26 | '@media (max-width: 480px)': { 27 | 'button': { 28 | width: '160px !important' 29 | } 30 | } 31 | }) 32 | 33 | const Button = React.createClass({ 34 | mixins: [styles()], 35 | render() { 36 | return ( 37 |
38 | 41 |
42 | ); 43 | } 44 | }); 45 | 46 | React.render( 18 | 43 | 44 | ); 45 | 46 | const App = () => ( 47 | 48 | 49 | 50 | ); 51 | 52 | render(, document.getElementById('content')); 53 | -------------------------------------------------------------------------------- /i-css/button.js: -------------------------------------------------------------------------------- 1 | import React, {Component} from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import {renderCss, addStyles} from 'i-css'; 4 | 5 | const button = addStyles({ 6 | container: { 7 | textAlign: 'center' 8 | }, 9 | item: { 10 | backgroundColor: '#ff0000', 11 | width: 320, 12 | padding: 20, 13 | borderRadius: 5, 14 | border: 'none', 15 | outline: 'none', 16 | '&:hover': { 17 | color: '#fff' 18 | }, 19 | '&:active': { 20 | position: 'relative', 21 | top: 2 22 | }, 23 | '@media (min-width: 480px)': { 24 | width: 160 25 | } 26 | }, 27 | _global: { 28 | 'html, body, #root': { 29 | padding: 0, 30 | margin: 0 31 | } 32 | }, 33 | }); 34 | 35 | class Button extends Component { 36 | render() { 37 | return ( 38 |
39 | 40 |
41 | ); 42 | } 43 | } 44 | 45 | renderCss(document.getElementById('rootCss')); //call it once in root component 46 | ReactDOM.render( 51 | 52 | ) 53 | } 54 | } 55 | 56 | React.render( 37 | 38 | )); 39 | 40 | const renderer = createRenderer(); 41 | const mountNode = document.getElementById('stylesheet'); 42 | 43 | render( 44 | 45 | 19 | 20 | ) 21 | 22 | const styles = createStyleSheet({ 23 | container: { 24 | textAlign: "center", 25 | }, 26 | button: { 27 | backgroundColor: "#ff0000", 28 | width: 320, 29 | padding: 20, 30 | borderRadius: 5, 31 | border: "none", 32 | outline: "none", 33 | }, 34 | smallButton: { 35 | width: 160, 36 | }, 37 | }) 38 | 39 | const WrappedButton = matchMedia()(Button) 40 | 41 | const mediaQueries = { 42 | small: "(max-width:480px)", 43 | } 44 | 45 | const mediaQueryGetter = createMediaQueryGetter(mediaQueries) 46 | const mediaQueryListener = createMediaQueryListener(mediaQueries) 47 | 48 | ReactDOM.render( 49 | 53 | 54 | , 55 | document.getElementById('content') 56 | ) 57 | -------------------------------------------------------------------------------- /react-vstyle/button.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import { createStylesRenderer, StyleSheet, registerPlugin } from 'vstyle'; 4 | import { StylesRendererProvider, withRenderStyles } from 'react-vstyle'; 5 | import nestedSelectorPlugin from 'vstyle/lib/plugins/nested-selector'; 6 | import mediaQueryPlugin from 'vstyle/lib/plugins/media-query'; 7 | import prefixer from 'vstyle/lib/plugins/prefixer'; 8 | 9 | registerPlugin(nestedSelectorPlugin); 10 | registerPlugin(mediaQueryPlugin); 11 | registerPlugin(prefixer); 12 | 13 | const styles = StyleSheet.create({ 14 | container: { 15 | textAlign: 'center' 16 | }, 17 | button: { 18 | backgroundColor: '#ff0000', 19 | width: '320px', 20 | padding: '20px', 21 | borderRadius: '5px', 22 | border: 'none', 23 | outline: 'none', 24 | '&:hover': { 25 | color: '#fff' 26 | }, 27 | '&:active': { 28 | position: 'relative', 29 | top: '2px' 30 | }, 31 | '@media (max-width: 480px)': { 32 | width: '160px' 33 | } 34 | } 35 | }); 36 | 37 | const Button = withRenderStyles(({ renderStyles }) => ( 38 |
39 | 40 |
41 | )) 42 | 43 | const stylesRenderer = createStylesRenderer(); 44 | stylesRenderer.attach(document.getElementById('style')); 45 | 46 | ReactDOM.render( 47 | 48 |