Skip to content

Commit ed5e71b

Browse files
authored
Better representation of features
1 parent 9816a79 commit ed5e71b

File tree

1 file changed

+11
-20
lines changed

1 file changed

+11
-20
lines changed

β€ŽREADME.md

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Every React component gets an inbuilt javascript constructor for functional logi
66

77
```jsx
88
import React from 'react';
9-
import css from 'css-constructor';
9+
import css from 'css-constructor'; // πŸ‘Ά Super tiny: only 1.2K gzipped!
1010

1111
export default class Hello extends React.Component {
1212

@@ -15,42 +15,33 @@ export default class Hello extends React.Component {
1515
super(props);
1616
}
1717

18-
/* css constructor */
19-
@css`
20-
/* πŸ”’ Isolated and co-located */
18+
/* css constructor */
19+
@css` // πŸ”’ Isolated and co-located
20+
font-size: 16px;
21+
text-align: center; // πŸŽ€ Supports the entirety of CSS
2122
22-
/* πŸŽ€ Supports the entirety of CSS */
23-
font-size: 16px;
24-
text-align: center;
23+
color: {this.props.color}; // πŸ”₯ Use props in css
2524
26-
/* πŸ”₯ Use props in css */
27-
color: {this.props.color};
25+
display: flex; // πŸ’» Built in vendor prefixing
2826
29-
/* πŸ’» Built in vendor prefixing */
30-
display: flex;
31-
32-
/* πŸŒ€ Pseudo selectors */
33-
&:hover {
27+
&:hover { // πŸŒ€ Pseudo selectors
3428
color: #FFF;
3529
}
3630
37-
/* πŸ‘ͺ Nested css */
38-
img {
31+
img { // πŸ‘ͺ Nested css
3932
border-radius: 50%;
4033
}
4134
#handle {
4235
margin-top: 20px;
4336
}
4437
45-
/* πŸ“± Media queries support */
46-
@media (max-width: 600px) {
38+
@media (max-width: 600px) { // πŸ“± Media queries support
4739
& {font-size: 18px;}
4840
}
4941
`
5042

5143
render () {
52-
/* πŸ”Ό Attaches styles to the highest element in your component */
53-
return (<div>
44+
return (<div> // πŸ”Ό Attaches styles to the highest element in your component
5445
<img src="https://github.com/siddharthkp.png"/>
5546
<div id="handle">@siddharthkp</div>
5647
</div>)

0 commit comments

Comments
Β (0)