File tree Expand file tree Collapse file tree 9 files changed +86
-16
lines changed Expand file tree Collapse file tree 9 files changed +86
-16
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- .common
1
+ .common ,
2
+ .common : active
2
3
{
3
- padding : 0 13px ;
4
+ display : inline-block;
5
+
6
+ padding : 0 11px ;
4
7
5
8
cursor : pointer;
6
9
user-select : none;
10
+ transition : all .3s ;
7
11
text-align : center;
8
12
white-space : nowrap;
13
+ text-decoration : none;
9
14
15
+ color : # fff ;
10
16
border : none;
11
- border-radius : 3 px ;
17
+ border-radius : 5 px ;
12
18
outline : none;
13
- background : # ffdb4d ;
19
+ background : # 43a047 ;
20
+ box-shadow : 0 5px 0 # 2e7d32 ;
21
+
22
+ font : normal 20 px/38px Roboto;
23
+ }
14
24
15
- font-family : arial, sans-serif;
16
- font-size : 13px ;
17
- line-height : 28px ;
25
+ .common : hover
26
+ {
27
+ background : # 4caf50 ;
28
+ box-shadow : 0 5px 0 # 388e3c ;
18
29
}
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import base from './Button.css' ;
3
3
4
- export default ( { styles = base , ..._ } ) => (
5
- < button { ..._ } className = { styles . common } />
4
+ export default ( { href = '#' , styles = base , ..._ } ) => (
5
+ < a { ..._ } className = { styles . common } href = { href } />
6
6
) ;
Original file line number Diff line number Diff line change
1
+ : global (html )
2
+ {
3
+ height : 100% ;
4
+ }
5
+
6
+ .page
7
+ {
8
+ display : flex;
9
+ flex-direction : column;
10
+ flex-wrap : nowrap;
11
+ justify-content : center;
12
+ /*align-items: center;*/
13
+
14
+ min-height : 100% ;
15
+ margin : 0 ;
16
+ /*background: #efe0b9;*/
17
+
18
+ background : # fff ;
19
+ }
20
+
21
+ .wrapper
22
+ {
23
+ margin : 30px ;
24
+
25
+ text-align : left;
26
+ }
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import Button from './Button' ;
3
+ import Title from './Title' ;
4
+
5
+ import styles from './Page.css' ;
3
6
4
7
export default _ => (
5
8
< html lang = 'en' >
6
9
< head >
7
10
< title > Universal demo</ title >
8
11
< link rel = 'stylesheet' href = 'common.css' />
9
- < script type = 'text/javascript' src = 'browser.js' > </ script >
10
12
</ head >
11
- < body >
12
- < Button > Welcome to the future</ Button >
13
+ < body className = { styles . page } >
14
+ < section className = { styles . wrapper } >
15
+ < Title > CSS Modules</ Title >
16
+ < Button href = 'http://glenmaddern.com/articles/css-modules' > Welcome to the future</ Button >
17
+ </ section >
13
18
</ body >
14
19
</ html >
15
20
) ;
Original file line number Diff line number Diff line change
1
+ .common
2
+ {
3
+ margin : 20px 0 ;
4
+
5
+ color : # 333 ;
6
+
7
+ font : normal 42 px/48px 'Roboto Condensed' , helvetica, arial;
8
+ }
Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+ import base from './Title.css' ;
3
+
4
+ export default ( { styles = base , ..._ } ) => (
5
+ < h1 { ..._ } className = { styles . common } />
6
+ ) ;
Original file line number Diff line number Diff line change 5
5
"main" : " worker.js" ,
6
6
"scripts" : {
7
7
"compile" : " webpack" ,
8
+ "compile:watch" : " webpack --watch" ,
8
9
"start" : " node app/worker" ,
9
10
"test" : " echo \" Error: no test specified\" && exit 1"
10
11
},
24
25
"react-dom" : " ^0.14.7"
25
26
},
26
27
"devDependencies" : {
28
+ "autoprefixer" : " ^6.3.3" ,
27
29
"babel-core" : " ^6.5.2" ,
28
30
"babel-loader" : " ^6.2.3" ,
29
31
"babel-preset-es2015" : " ^6.5.0" ,
32
34
"css-loader" : " 0.23.1" ,
33
35
"extract-text-webpack-plugin" : " ^1.0.1" ,
34
36
"npm-install-webpack-plugin" : " ^2.0.2" ,
37
+ "postcss-font-magician" : " ^1.4.0" ,
38
+ "postcss-loader" : " 0.8.1" ,
35
39
"style-loader" : " 0.13.0" ,
36
40
"webpack" : " ^1.12.14"
37
41
}
Original file line number Diff line number Diff line change @@ -7,10 +7,10 @@ const resolve = require('path').resolve;
7
7
const config = require ( './package' ) . config ;
8
8
9
9
module . exports = {
10
- entry : resolve ( 'app/browser .js' ) ,
10
+ entry : resolve ( 'components/Page .js' ) ,
11
11
12
12
output : {
13
- filename : 'browser .js' ,
13
+ filename : '_ .js' ,
14
14
path : resolve ( 'static' ) ,
15
15
} ,
16
16
@@ -24,11 +24,16 @@ module.exports = {
24
24
{
25
25
test : / \. c s s $ / i,
26
26
loader : ExtractTextPlugin . extract ( 'style' ,
27
- `css?modules&localIdentName=${ config . css } ` ) ,
27
+ `css?modules&localIdentName=${ config . css } !postcss ` ) ,
28
28
} ,
29
29
] ,
30
30
} ,
31
31
32
+ postcss : [
33
+ require ( 'postcss-font-magician' ) ,
34
+ require ( 'autoprefixer' ) ,
35
+ ] ,
36
+
32
37
plugins : [
33
38
new ExtractTextPlugin ( 'common.css' , {
34
39
allChunks : true
@@ -39,4 +44,10 @@ module.exports = {
39
44
saveExact : true ,
40
45
} ) ,
41
46
] ,
47
+
48
+ externals : [
49
+ {
50
+ react : true ,
51
+ } ,
52
+ ]
42
53
} ;
You can’t perform that action at this time.
0 commit comments