1- # Airbnb CSS / Sass Styleguide
1+ # Lazy Ants CSS / Sass Styleguide
2+
3+ base of [ airnbn style guide] ( https://github.com/airbnb/css )
24
35* A mostly reasonable approach to CSS and Sass*
46
@@ -32,8 +34,8 @@ A “rule declaration” is the name given to a selector (or a group of selector
3234
3335``` css
3436.listing {
35- font-size : 18px ;
36- line-height : 1.2 ;
37+ font-size : 18px ;
38+ line-height : 1.2 ;
3739}
3840```
3941
@@ -43,11 +45,11 @@ In a rule declaration, “selectors” are the bits that determine which element
4345
4446``` css
4547.my-element-class {
46- /* ... */
48+ /* ... */
4749}
4850
4951[aria-hidden ] {
50- /* ... */
52+ /* ... */
5153}
5254```
5355
@@ -57,16 +59,16 @@ Finally, properties are what give the selected elements of a rule declaration th
5759
5860``` css
5961/* some selector */ {
60- background : #f1f1f1 ;
61- color : #333 ;
62+ background : #f1f1f1 ;
63+ color : #333 ;
6264}
6365```
6466
6567## CSS
6668
6769### Formatting
6870
69- * Use soft tabs (2 spaces) for indentation
71+ * Use soft tabs (4 spaces) for indentation
7072* Prefer dashes over camelCasing in class names.
7173 - Underscores and PascalCasing are okay if you are using BEM (see [ OOCSS and BEM] ( #oocss-and-bem ) below).
7274* Do not use ID selectors
@@ -80,10 +82,10 @@ Finally, properties are what give the selected elements of a rule declaration th
8082
8183``` css
8284.avatar {
83- border-radius :50% ;
84- border :2px solid white ; }
85+ border-radius :50% ;
86+ border :2px solid white ; }
8587.no , .nope , .not_good {
86- // ...
88+ // ...
8789}
8890#lol-no {
8991 // ...
@@ -94,14 +96,14 @@ Finally, properties are what give the selected elements of a rule declaration th
9496
9597``` css
9698.avatar {
97- border-radius : 50% ;
98- border : 2px solid white ;
99+ border-radius : 50% ;
100+ border : 2px solid white ;
99101}
100102
101103.one ,
102104.selector ,
103105.per-line {
104- // ...
106+ // ...
105107}
106108```
107109
@@ -139,17 +141,17 @@ We recommend a variant of BEM with PascalCased “blocks”, which works particu
139141``` jsx
140142// ListingCard.jsx
141143function ListingCard () {
142- return (
143- < article class = " ListingCard ListingCard--featured" >
144+ return (
145+ < article class = " ListingCard ListingCard--featured" >
144146
145- < h1 class = " ListingCard__title" > Adorable 2BR in the sunny Mission< / h1>
147+ < h1 class = " ListingCard__title" > Adorable 2BR in the sunny Mission< / h1>
146148
147- < div class = " ListingCard__content" >
148- < p> Vestibulum id ligula porta felis euismod semper.< / p>
149- < / div>
149+ < div class = " ListingCard__content" >
150+ < p> Vestibulum id ligula porta felis euismod semper.< / p>
151+ < / div>
150152
151- < / article>
152- );
153+ < / article>
154+ );
153155}
154156```
155157
@@ -189,15 +191,15 @@ Use `0` instead of `none` to specify that a style has no border.
189191
190192``` css
191193.foo {
192- border : none ;
194+ border : none ;
193195}
194196```
195197
196198** Good**
197199
198200``` css
199201.foo {
200- border : 0 ;
202+ border : 0 ;
201203}
202204```
203205
@@ -216,9 +218,9 @@ Use `0` instead of `none` to specify that a style has no border.
216218
217219 ``` scss
218220 .btn-green {
219- background : green ;
220- font-weight : bold ;
221- // ...
221+ background : green ;
222+ font-weight : bold ;
223+ // ...
222224 }
223225 ```
224226
@@ -228,10 +230,10 @@ Use `0` instead of `none` to specify that a style has no border.
228230
229231 ```scss
230232 .btn-green {
231- background : green ;
232- font-weight : bold ;
233- @include transition (background 0.5s ease );
234- // ...
233+ background : green ;
234+ font-weight : bold ;
235+ @include transition (background 0.5s ease );
236+ // ...
235237 }
236238 ```
237239
@@ -241,13 +243,13 @@ Use `0` instead of `none` to specify that a style has no border.
241243
242244 ```scss
243245 .btn {
244- background : green ;
245- font-weight : bold ;
246- @include transition (background 0.5s ease );
246+ background : green ;
247+ font-weight : bold ;
248+ @include transition (background 0.5s ease );
247249
248- .icon {
249- margin-right : 10px ;
250- }
250+ .icon {
251+ margin-right : 10px ;
252+ }
251253 }
252254 ```
253255
@@ -269,11 +271,11 @@ Mixins should be used to DRY up your code, add clarity, or abstract complexity--
269271
270272```scss
271273.page-container {
272- .content {
273- .profile {
274- // STOP!
274+ .content {
275+ .profile {
276+ // STOP!
277+ }
275278 }
276- }
277279}
278280```
279281
0 commit comments