This repository was archived by the owner on Sep 30, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial import with working poc for loading images
- Loading branch information
0 parents
commit 260d7b6
Showing
42 changed files
with
754 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# OS directory cache files | ||
Thumbs.db | ||
.DS_Store | ||
|
||
# npm | ||
/node_modules/* | ||
!/node_modules/testi-projekti | ||
|
||
npm-debug.log | ||
|
||
# Built sources | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
## Webpack asset bundling proof-of-concept test | ||
|
||
Based on <https://github.com/patrikholcak/webpack-demo>, which in turn is based on <https://github.com/css-modules/webpack-demo> | ||
|
||
## Run the example | ||
|
||
```bash | ||
$ npm install | ||
$ npm start & open http://localhost:8080 | ||
``` | ||
|
||
## License | ||
|
||
[MIT] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
var webpack = require('webpack'), | ||
WebpackDevServer = require('webpack-dev-server'), | ||
config = require('./webpack.config'), | ||
host = 'localhost', | ||
port = 8080; | ||
|
||
|
||
var server = new WebpackDevServer(webpack(config), { | ||
publicPath: config.output.publicPath, | ||
hot: true, | ||
historyApiFallback: true | ||
}); | ||
|
||
server.listen(port, host, function (err, result) { | ||
if (err) console.err(err) | ||
|
||
console.log("Listening at %s:%s", host, port) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<html> | ||
<head> | ||
<title>CSS Modules Webpack Demo</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"/> | ||
</head> | ||
<body> | ||
<div id="outlet"></div> | ||
<script src="/index.js"></script> | ||
</body> | ||
</html> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"name": "webpack-demo", | ||
"description": "Working demo of CSS Modules, using Webpack's css-loader in module mode.", | ||
"version": "1.0.0", | ||
"private": true, | ||
"license": "MIT", | ||
"main": "index.js", | ||
"homepage": "https://github.com/css-modules/webpack-demo", | ||
"author": "Mark Dalgleish", | ||
"contributors": [ | ||
"Patrik Holcak <[email protected]> (http://holcak.com)" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/css-modules/webpack-demo/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/css-modules/webpack-demo" | ||
}, | ||
"devDependencies": { | ||
"babel-core": "^5.8.25", | ||
"babel-loader": "^5.3.2", | ||
"css-loader": "^0.19.0", | ||
"file-loader": "^0.8.4", | ||
"postcss-loader": "^0.6.0", | ||
"raw-loader": "^0.5.1", | ||
"react-hot-loader": "^1.3.0", | ||
"style-loader": "^0.12.4", | ||
"url-loader": "^0.5.6", | ||
"webpack": "^1.12.2", | ||
"webpack-dev-server": "^1.12.0" | ||
}, | ||
"scripts": { | ||
"start": "node hot-reload.js", | ||
"deploy": "npm run build && gh-pages -d dist -m \"Updates --skip-ci\"" | ||
}, | ||
"dependencies": { | ||
"react": "^0.13.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.logo { | ||
background: url('./logo.svg'); | ||
background-size: 200px 200px; | ||
width: 200px; | ||
height: 200px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import React, {Component} from 'react'; | ||
import styles from './Logo.css'; | ||
|
||
|
||
export default class Logo extends Component { | ||
render() { | ||
return <div className={styles.logo} />; | ||
} | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.root { | ||
border-width: 2px; | ||
border-style: solid; | ||
border-color: #777; | ||
padding: 0 20px; | ||
margin: 0 6px; | ||
max-width: 400px; | ||
} | ||
|
||
.text { | ||
color: #777; | ||
font-size: 24px; | ||
font-family: helvetica, arial, sans-serif; | ||
font-weight: 600; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React, {Component} from 'react'; | ||
import styles from './ScopedSelectors.css'; | ||
|
||
|
||
export default class ScopedSelectors extends Component { | ||
render() { | ||
return ( | ||
<div className={ styles.root }> | ||
<p className={ styles.text }>Scoped Selectors</p> | ||
</div> | ||
); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import ScopedSelectors from './ScopedSelectors'; | ||
|
||
import React, { Component } from 'react'; | ||
|
||
import js from '!!raw!./ScopedSelectors.js'; | ||
import css from '!!raw!./ScopedSelectors.css'; | ||
import Snippet from 'shared/Snippet/Snippet'; | ||
|
||
export default class ScopedSelectorsDemo extends Component { | ||
|
||
render() { | ||
const files = [ | ||
{ name: 'ScopedSelectors.js', source: js }, | ||
{ name: 'ScopedSelectors.css', source: css } | ||
]; | ||
|
||
return ( | ||
<Snippet files={files}> | ||
<ScopedSelectors /> | ||
</Snippet> | ||
); | ||
} | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.root { | ||
border-width: 2px; | ||
border-style: solid; | ||
border-color: brown; | ||
padding: 0 20px; | ||
margin: 0 6px; | ||
max-width: 400px; | ||
} | ||
|
||
.root :global .text { | ||
color: brown; | ||
font-size: 24px; | ||
font-family: helvetica, arial, sans-serif; | ||
font-weight: 600; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React, {Component} from 'react'; | ||
import styles from './GlobalSelectors.css'; | ||
|
||
|
||
export default class GlobalSelectors extends Component { | ||
render() { | ||
return ( | ||
<div className={ styles.root }> | ||
<p className="text">Global Selectors</p> | ||
</div> | ||
); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import GlobalSelectors from './GlobalSelectors'; | ||
|
||
import React, { Component } from 'react'; | ||
|
||
import js from '!!raw!./GlobalSelectors.js'; | ||
import css from '!!raw!./GlobalSelectors.css'; | ||
import Snippet from 'shared/Snippet/Snippet'; | ||
|
||
export default class GlobalSelectorsDemo extends Component { | ||
|
||
render() { | ||
const files = [ | ||
{ name: 'GlobalSelectors.js', source: js }, | ||
{ name: 'GlobalSelectors.css', source: css } | ||
]; | ||
|
||
return ( | ||
<Snippet files={files}> | ||
<GlobalSelectors /> | ||
</Snippet> | ||
); | ||
} | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React, {Component} from 'react'; | ||
|
||
import StyleVariantA from './StyleVariantA/StyleVariantA'; | ||
import StyleVariantB from './StyleVariantB/StyleVariantB'; | ||
|
||
export default class ClassComposition extends Component { | ||
render() { | ||
return ( | ||
<div> | ||
<StyleVariantA /> | ||
<br /> | ||
<StyleVariantB /> | ||
</div> | ||
); | ||
} | ||
}; |
Oops, something went wrong.