Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1eb95a8

Browse files
author
Alexey Litvinov
committed
update demo deps and add composes and value keyworks
1 parent 07a8739 commit 1eb95a8

File tree

6 files changed

+63
-33
lines changed

6 files changed

+63
-33
lines changed

‎demo/components/Button/Button.css‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1+
@value primary, primaryShadow from 'Colors.css';
2+
3+
.common
4+
{
5+
composes: common from './Common.css';
6+
}
7+
18
.common,
29
.common:active
310
{
4-
display: inline-block;
5-
611
margin: 0 0 20px;
712
padding: 0 11px;
813

9-
cursor: pointer;
10-
user-select: none;
1114
transition: all .3s;
12-
text-align: center;
13-
white-space: nowrap;
14-
text-decoration: none;
1515

1616
color: #fff;
1717
border: none;
1818
border-radius: 5px;
1919
outline: none;
20-
background: #43a047;
21-
box-shadow: 0 5px 0 #2e7d32;
20+
background: primary;
21+
box-shadow: 0 5px 0 primaryShadow;
2222

2323
font: normal 20px/38px Roboto;
2424
}

‎demo/components/Button/Colors.css‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@value primary #43a047;
2+
@value primaryShadow #2e7d32;

‎demo/components/Button/Common.css‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.common
2+
{
3+
display: inline-block;
4+
5+
cursor: pointer;
6+
user-select: none;
7+
8+
text-align: center;
9+
white-space: nowrap;
10+
text-decoration: none;
11+
}

‎demo/package.json‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@
2525
"react-dom": "^15.3.2"
2626
},
2727
"devDependencies": {
28-
"autoprefixer": "^6.5.0",
29-
"babel-core": "^6.17.0",
30-
"babel-loader": "^6.2.5",
31-
"babel-preset-es2015": "^6.16.0",
32-
"babel-preset-react": "^6.16.0",
33-
"babel-preset-stage-0": "^6.16.0",
34-
"css-loader": "^0.25.0",
35-
"extract-text-webpack-plugin": "^1.0.1",
28+
"autoprefixer": "^7.2.4",
29+
"babel-core": "^6.26.0",
30+
"babel-loader": "^7.1.2",
31+
"babel-preset-es2015": "^6.24.1",
32+
"babel-preset-react": "^6.24.1",
33+
"babel-preset-stage-0": "^6.24.1",
34+
"css-loader": "0.28.7",
35+
"extract-text-webpack-plugin": "^3.0.2",
3636
"npm-install-webpack-plugin": "^4.0.4",
37-
"postcss-font-magician": "^1.4.0",
38-
"postcss-loader": "^0.13.0",
39-
"style-loader": "^0.13.1",
40-
"webpack": "^1.13.2"
37+
"postcss-font-magician": "^2.1.0",
38+
"postcss-loader": "^2.0.10",
39+
"style-loader": "^0.19.1",
40+
"webpack": "^3.10.0"
4141
}
4242
}

‎demo/postcss.config.js‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict';
2+
3+
module.exports = {
4+
plugins: [
5+
// small sugar for CSS
6+
require('postcss-font-magician'),
7+
require('autoprefixer'),
8+
],
9+
};

‎demo/webpack.config.js‎

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,37 @@ module.exports = {
1515
},
1616

1717
module: {
18-
loaders: [
18+
rules: [
1919
{
2020
test: /\.js$/i,
2121
exclude: /node_modules/,
22-
loader: 'babel?presets[]=es2015,presets[]=react,presets[]=stage-0',
22+
loader: 'babel-loader',
23+
options: {
24+
presets: ['es2015', 'react', 'stage-0'],
25+
},
2326
},
2427
{
2528
test: /\.css$/i,
26-
loader: ExtractTextPlugin.extract('style',
27-
`css?modules&localIdentName=${config.css}!postcss`),
29+
use: ExtractTextPlugin.extract({
30+
fallback: 'style-loader',
31+
use: [
32+
{
33+
loader: 'css-loader',
34+
options: {
35+
modules: true,
36+
localIdentName: config.css,
37+
},
38+
},
39+
'postcss-loader',
40+
],
41+
}),
2842
},
2943
],
3044
},
3145

32-
postcss: [
33-
// small sugar for CSS
34-
require('postcss-font-magician'),
35-
require('autoprefixer'),
36-
],
37-
3846
plugins: [
3947
new ExtractTextPlugin('common.css', {
40-
allChunks: true
48+
allChunks: true,
4149
}),
4250
new NpmInstallPlugin({
4351
cacheMin: 999999,
@@ -50,5 +58,5 @@ module.exports = {
5058
{
5159
react: true,
5260
},
53-
]
61+
],
5462
};

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /