Skip to content

Commit 0e3500c

Browse files
committedOct 4, 2016
Add supporting of Stylus

File tree

9 files changed

+54
-6
lines changed

9 files changed

+54
-6
lines changed
 

‎.env

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ OPEN_BROWSER=false
22

33
REACT_APP_SASS=true
44
REACT_APP_LESS=true
5-
REACT_APP_CSS_MODULES=true
5+
REACT_APP_STYLUS=true
6+
REACT_APP_CSS_MODULES=true

‎README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ The generated project comes with SASS, LESS, and CSS modules support by default,
2626
#### Styling
2727
- ```REACT_APP_SASS=true``` - enable SASS support
2828
- ```REACT_APP_LESS=true``` - enable LESS support
29+
- ```REACT_APP_STYLUS=true``` - enable Stylus support
2930
- ```REACT_APP_CSS_MODULES``` - enable CSS modules
3031

3132
#### Babel
@@ -60,4 +61,4 @@ I just added support for extra environment variables that actually turn on certa
6061

6162
### Future plans
6263

63-
I will put all of my efforts into supporting this fork to be always on par with features with the newest ```create-react-app``` and ```react-scripts``` versions.
64+
I will put all of my efforts into supporting this fork to be always on par with features with the newest ```create-react-app``` and ```react-scripts``` versions.

‎packages/react-scripts/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ The reason for this fork's existence is explained better in [this Medium article
1010
* babel-preset-stage-0
1111
* LESS
1212
* SASS
13+
* Stylus
1314
* CSS modules
1415

1516
**the features are optional and can be turned on/off individually*
@@ -26,6 +27,7 @@ The generated project comes with SASS, LESS, and CSS modules support by default,
2627
#### Styling
2728
- ```REACT_APP_SASS=true``` - enable SASS support
2829
- ```REACT_APP_LESS=true``` - enable LESS support
30+
- ```REACT_APP_STYLUS=true``` - enable Stylus support
2931
- ```REACT_APP_CSS_MODULES``` - enable CSS modules
3032

3133
#### Babel
@@ -60,4 +62,4 @@ I just added support for extra environment variables that actually turn on certa
6062

6163
### Future plans
6264

63-
I will put all of my efforts into supporting this fork to be always on par with features with the newest ```create-react-app``` and ```react-scripts``` versions.
65+
I will put all of my efforts into supporting this fork to be always on par with features with the newest ```create-react-app``` and ```react-scripts``` versions.

‎packages/react-scripts/bin/CUSTOM_README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ The generated project comes with SASS, LESS, and CSS modules support by default,
2626
#### Styling
2727
- ```REACT_APP_SASS=true``` - enable SASS support
2828
- ```REACT_APP_LESS=true``` - enable LESS support
29+
- ```REACT_APP_STYLUS=true``` - enable Stylus support
2930
- ```REACT_APP_CSS_MODULES``` - enable CSS modules
3031

3132
#### Babel
@@ -60,4 +61,4 @@ I just added support for extra environment variables that actually turn on certa
6061

6162
### Future plans
6263

63-
I will put all of my efforts into supporting this fork to be always on par with features with the newest ```create-react-app``` and ```react-scripts``` versions.
64+
I will put all of my efforts into supporting this fork to be always on par with features with the newest ```create-react-app``` and ```react-scripts``` versions.

‎packages/react-scripts/config/customizers.js

+16-1
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,25 @@ module.exports = {
4343
}
4444
}
4545
},
46+
'STYLUS': {
47+
toArray: 'loaders',
48+
getDev: function () {
49+
return {
50+
test: /\.styl/,
51+
loader: 'style!css!postcss!stylus'
52+
}
53+
},
54+
getProd: function () {
55+
return {
56+
test: /\.styl/,
57+
loader: ExtractTextPlugin.extract('style', 'css!postcss!stylus')
58+
}
59+
}
60+
},
4661
'CSS_MODULES': {
4762
config: {
4863
dev: 'style!css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss',
4964
prod: 'style!css?modules&-autoprefixer&importLoaders=1!postcss'
5065
}
5166
}
52-
}
67+
}

‎packages/react-scripts/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
"rimraf": "2.5.4",
6969
"strip-ansi": "3.0.1",
7070
"style-loader": "0.13.1",
71+
"stylus-loader": "2.3.1",
7172
"url-loader": "0.5.7",
7273
"webpack": "1.13.2",
7374
"webpack-dev-server": "1.16.1",

‎packages/react-scripts/template/.env

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
REACT_APP_SASS=true
22
REACT_APP_LESS=true
3-
REACT_APP_CSS_MODULES=true
3+
REACT_APP_STYLUS=true
4+
REACT_APP_CSS_MODULES=true

‎packages/react-scripts/template/src/App.js

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import logo from './logo.svg';
44
//styles
55
import './App.less';
66
import './App.scss';
7+
import './App.styl';
78
import styles from './Modules.css';
89

910
class App extends Component {
@@ -37,6 +38,10 @@ class App extends Component {
3738
<code>REACT_APP_LESS=true</code>
3839
<span>- Enable LESS</span>
3940
</li>
41+
<li>
42+
<code>REACT_APP_STYLUS=true</code>
43+
<span>- Enable Stylus</span>
44+
</li>
4045
<li>
4146
<code>REACT_APP_CSS_MODULES=true</code>
4247
<span>- Enable CSS modules </span>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.App
2+
text-align center
3+
4+
.App-logo
5+
animation App-logo-spin infinite 20s linear
6+
height 80px
7+
8+
.App-header
9+
background-color #222
10+
height 150px
11+
padding 20px
12+
color white
13+
14+
.App-intro
15+
font-size large
16+
17+
@keyframes App-logo-spin
18+
from
19+
transform rotate(0deg)
20+
to
21+
transform rotate(360deg)

0 commit comments

Comments
 (0)