Skip to content

Commit

Permalink
Step 3a: switch to CSS modules
Browse files Browse the repository at this point in the history
Everybody loves CSS modules, and the great news is that they come free with Webpack.
The bad news is that we can't use them with server-side rendering, as we don't use
Webpack when rendering on the server-side.
So at this step we broke everything, and the only way to continue from here, is to
start using Webpack to pre-build code for server-side rendering too, and that's
what we'll do at the next step.
  • Loading branch information
dimaip committed May 12, 2016
1 parent 53d2ffa commit e2c0244
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions Hello.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React from 'react';
if (process.env.BROWSER) {
require('Hello.css');
}
import s from 'Hello.scss';

const Hello = React.createClass({
render: function() {
return <div className="Hello">Hello {this.props.name}</div>;
return <div className={s.root}>Hello {this.props.name}</div>;
}
});

Expand Down
2 changes: 1 addition & 1 deletion Hello.css → Hello.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.Hello {
.root {
font-size: 3em;
font-family: sans-serif;
color: rebeccapurple;
Expand Down

0 comments on commit e2c0244

Please sign in to comment.