Skip to content

Commit 513cc23

Browse files
committed
Show code snippets for scoped and global selectors
1 parent 196039d commit 513cc23

File tree

16 files changed

+83
-18
lines changed

16 files changed

+83
-18
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"node-libs-browser": "^0.5.0",
2929
"postcss-color-rebeccapurple": "^1.1.0",
3030
"postcss-loader": "^0.4.3",
31+
"raw-loader": "^0.5.1",
3132
"react": "^0.13.3",
3233
"react-to-html-webpack-plugin": "^2.1.0",
3334
"style-loader": "^0.12.3",

src/components/1-ScopedSelectors/ScopedSelectors.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ export default class ScopedSelectors extends Component {
66

77
render() {
88
return (
9-
<div className={styles.root}>
10-
<p className={styles.text}>Scoped Selectors</p>
9+
<div className={ styles.root }>
10+
<p className={ styles.text }>Scoped Selectors</p>
1111
</div>
1212
);
1313
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import ScopedSelectors from './ScopedSelectors';
2+
3+
import React, { Component } from 'react';
4+
5+
import js from '!!raw!./ScopedSelectors.js';
6+
import css from '!!raw!./ScopedSelectors.css';
7+
import Snippet from 'shared/Snippet/Snippet';
8+
9+
export default class ScopedSelectorsDemo extends Component {
10+
11+
render() {
12+
return (
13+
<div>
14+
<ScopedSelectors />
15+
<Snippet js={js} css={css} />
16+
</div>
17+
);
18+
}
19+
20+
};

src/components/2-GlobalSelectors/GlobalSelectors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default class GlobalSelectors extends Component {
66

77
render() {
88
return (
9-
<div className={styles.root}>
9+
<div className={ styles.root }>
1010
<p>Global Selectors</p>
1111
</div>
1212
);
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import GlobalSelectors from './GlobalSelectors';
2+
3+
import React, { Component } from 'react';
4+
5+
import js from '!!raw!./GlobalSelectors.js';
6+
import css from '!!raw!./GlobalSelectors.css';
7+
import Snippet from 'shared/Snippet/Snippet';
8+
9+
export default class GlobalSelectorsDemo extends Component {
10+
11+
render() {
12+
return (
13+
<div>
14+
<GlobalSelectors />
15+
<Snippet js={js} css={css} />
16+
</div>
17+
);
18+
}
19+
20+
};
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
.root {
2-
extends: box from "styles/layout.css";
2+
extends: box from "shared/styles/layout.css";
33
border-color: red;
44
}
55

66
.text {
7-
extends: heading from "styles/typography.css";
7+
extends: heading from "shared/styles/typography.css";
88
color: red;
99
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
.root {
2-
extends: box from "styles/layout.css";
2+
extends: box from "shared/styles/layout.css";
33
border-color: blue;
44
}
55

66
.text {
7-
extends: heading from "styles/typography.css";
7+
extends: heading from "shared/styles/typography.css";
88
color: blue;
99
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
.root {
2-
extends: box from "styles/layout.css";
2+
extends: box from "shared/styles/layout.css";
33
border-style: dotted;
44
border-color: green;
55
}
66

77
.text {
8-
extends: heading from "styles/typography.css";
8+
extends: heading from "shared/styles/typography.css";
99
font-weight: 200;
1010
color: green;
1111
}

src/components/5-ScopedAnimations/ScopedAnimations.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
}
44

55
.ball {
6-
extends: bounce from "styles/animations.css";
6+
extends: bounce from "shared/styles/animations.css";
77
width: 40px;
88
height: 40px;
99
border-radius: 20px;

src/components/App.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.app {
22
font-family: helvetica, arial, sans-serif;
3+
font-size: 16px;
4+
line-height: 24px;
35
padding: 6px 20px 30px;
46
}

0 commit comments

Comments
 (0)