Skip to content

Commit 4010547

Browse files
committed
Add comments to example and README
1 parent 3a873d2 commit 4010547

File tree

4 files changed

+44
-17
lines changed

4 files changed

+44
-17
lines changed

README.md

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,34 @@ export default class Hello extends React.Component {
2323
@css`
2424
font-size: 16px;
2525
text-align: center;
26+
27+
/* Use props in your CSS */
2628
color: {this.props.color};
27-
font-family: monospace;
29+
30+
/* Pseudo selectors */
31+
&:hover {
32+
color: #FFF;
33+
}
34+
35+
/* Nested elements */
36+
img {
37+
border-radius: 50%;
38+
}
39+
#handle {
40+
margin-top: 20px;
41+
}
42+
43+
/* Media queries */
44+
@media (max-width: 600px) {
45+
& {font-size: 18px;}
46+
}
2847
`
2948

3049
render () {
31-
return <div>Styled {this.props.color} text!</div>
50+
return (<div>
51+
<img src="https://github.com/siddharthkp.png"/>
52+
<div id="handle">@siddharthkp</div>
53+
</div>)
3254
}
3355
};
3456

@@ -50,21 +72,20 @@ export default class Hello extends React.Component {
5072

5173
👶 Super tiny: only 1.2K gzipped
5274

75+
🌀 pseudo selectors
76+
77+
📱 media queries support
78+
79+
👪 nested css
80+
5381
💄 Offical library emoji
5482

5583
--
5684

5785
*Coming soon*
5886

59-
🌀 pseudo selectors
60-
61-
📱 media queries support
62-
6387
💻 vendor prefixes
6488

65-
👪 nested css
66-
67-
6889
--
6990

7091
#### Usage

example/bundle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ var _dec, _desc, _value, _class;
9595
//import css from 'css-constructor'; // production - use this!
9696

9797

98-
var _templateObject = _taggedTemplateLiteral(['\n font-size: 16px;\n text-align: center;\n color: {this.props.color};\n font-family: monospace;\n &:hover {\n color: #FFF;\n }\n img {\n border-radius: 50%;\n }\n #handle {\n margin-top: 20px;\n }\n @media (max-width: 600px) {\n & {font-size: 18px;}\n }\n '], ['\n font-size: 16px;\n text-align: center;\n color: {this.props.color};\n font-family: monospace;\n &:hover {\n color: #FFF;\n }\n img {\n border-radius: 50%;\n }\n #handle {\n margin-top: 20px;\n }\n @media (max-width: 600px) {\n & {font-size: 18px;}\n }\n ']);
98+
var _templateObject = _taggedTemplateLiteral(['\n font-size: 16px;\n text-align: center;\n\n /* Use props in your CSS */\n color: {this.props.color};\n\n /* Pseudo selectors */\n &:hover {\n color: #FFF;\n }\n\n /* Nested elements */\n img {\n border-radius: 50%;\n }\n #handle {\n margin-top: 20px;\n }\n\n /* Media queries */\n @media (max-width: 600px) {\n & {font-size: 18px;}\n }\n '], ['\n font-size: 16px;\n text-align: center;\n\n /* Use props in your CSS */\n color: {this.props.color};\n\n /* Pseudo selectors */\n &:hover {\n color: #FFF;\n }\n\n /* Nested elements */\n img {\n border-radius: 50%;\n }\n #handle {\n margin-top: 20px;\n }\n\n /* Media queries */\n @media (max-width: 600px) {\n & {font-size: 18px;}\n }\n ']);
9999

100100
var _react = require('react');
101101

example/hello.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,33 @@ export default class Hello extends React.Component {
1313
@css`
1414
font-size: 16px;
1515
text-align: center;
16+
17+
/* Use props in your CSS */
1618
color: {this.props.color};
17-
font-family: monospace;
19+
20+
/* Pseudo selectors */
1821
&:hover {
1922
color: #FFF;
2023
}
24+
25+
/* Nested elements */
2126
img {
2227
border-radius: 50%;
2328
}
2429
#handle {
2530
margin-top: 20px;
2631
}
32+
33+
/* Media queries */
2734
@media (max-width: 600px) {
2835
& {font-size: 18px;}
2936
}
3037
`
3138

3239
render () {
33-
return (
34-
<div>
35-
<img src="https://github.com/siddharthkp.png"/>
36-
<div id="handle">@siddharthkp</div>
37-
</div>
38-
)
40+
return (<div>
41+
<img src="https://github.com/siddharthkp.png"/>
42+
<div id="handle">@siddharthkp</div>
43+
</div>)
3944
}
4045
};

example/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
body {
33
background: #20222B;
44
color: #FFF;
5+
font-family: monospace;
56
}
67
</style>
78
<div id="container"></div>

0 commit comments

Comments
 (0)