|
106 | 106 | - Stylus **selectors are absolutely the same as in regular CSS**
|
107 | 107 | - Every CSS code is valid Stylus code!
|
108 | 108 | - `.class`, `#id`, `tagName`
|
| 109 | +- _Examples:_ |
| 110 | + |
| 111 | +```stylus |
| 112 | +#root .nav |
| 113 | + list-style-type none |
| 114 | +#root .nav .nav-item |
| 115 | + float left |
| 116 | + margin 0 |
| 117 | + padding 0 |
| 118 | +``` |
109 | 119 |
|
110 | 120 | <!-- attr: { showInPresentation:true, style:'font-size: 0.8em' } -->
|
111 | 121 | <!-- # Selectors in Stylus -->
|
|
223 | 233 |
|
224 | 234 | <!-- attr: { showInPresentation:true } -->
|
225 | 235 | <!-- # Stylus Features: Variables -->
|
226 |
| -```styl |
| 236 | +```stylus |
227 | 237 | /* Stylus */
|
228 | 238 | link-color = #ffffff;
|
229 | 239 | v-link-color = #646363;
|
|
234 | 244 | ```
|
235 | 245 |
|
236 | 246 |
|
237 |
| -```styl |
| 247 | +```css |
238 | 248 | /* CSS */
|
239 | 249 | a {
|
240 | 250 | color: #fff;
|
@@ -431,17 +441,6 @@ box(border = none, bg = rgba(0, 0, 0, 0.7), size = 200px)
|
431 | 441 | box '1px solid black' rgba(123, 0, 0, 0.6) 100px
|
432 | 442 | ```
|
433 | 443 |
|
434 |
| -<!-- attr: { showInPresentation:true } --> |
435 |
| -# @extend or Mixins? |
436 |
| -- Why both `mixins` and `@extend`? |
437 |
| - - `Mixins` have parameters and generate different code, based on the parameters |
438 |
| - - `@extend` provides a way to minify the number of classes on an element |
439 |
| - - Instead of adding `.clearfix` to all elements that clear, add it to the selector that the elements already have |
440 |
| - |
441 |
| -<!-- attr: { class:'slide-section demo', showInPresentation:true, hasScriptWrapper:true } --> |
442 |
| -<!-- # Stylus Features: Mixins with Arguments |
443 |
| -## [Demo](https://github.com/TelerikAcademy/CSS/tree/master/Topics/04.%20Stylus/demos/08.%20mixins-with-args) --> |
444 |
| - |
445 | 444 | <!-- attr: { id:'selector-inheritance', showInPresentation:true, style:'font-size: 0.8em;' } -->
|
446 | 445 | # <a id="selector-inheritance"></a>Selector Inheritance
|
447 | 446 | - Selectors in Stylus can be inherited using `@extend`
|
@@ -484,7 +483,19 @@ box(border = none, bg = rgba(0, 0, 0, 0.7), size = 200px)
|
484 | 483 | ## [Demo](https://github.com/TelerikAcademy/CSS/tree/master/Topics/04.%20Stylus/demos/09.%20selector-inheritance%28%40extend%29) -->
|
485 | 484 |
|
486 | 485 |
|
| 486 | +<!-- attr: { showInPresentation:true } --> |
| 487 | +# @extend or Mixins? |
| 488 | +- Why both `mixins` and `@extend`? |
| 489 | + - `Mixins` have parameters and generate different code, based on the parameters |
| 490 | + - `@extend` provides a way to minify the number of classes on an element |
| 491 | + - Instead of adding `.clearfix` to all elements that clear, add it to the selector that the elements already have |
| 492 | + |
| 493 | +<!-- attr: { class:'slide-section demo', showInPresentation:true, hasScriptWrapper:true } --> |
| 494 | +<!-- # Stylus Features: Mixins with Arguments |
| 495 | +## [Demo](https://github.com/TelerikAcademy/CSS/tree/master/Topics/04.%20Stylus/demos/08.%20mixins-with-args) --> |
| 496 | + |
487 | 497 | <!-- section start -->
|
| 498 | + |
488 | 499 | <!-- attr: { class:'slide-section', showInPresentation:true } -->
|
489 | 500 | <!-- # Stylus: Scripting, Libraries and Importing -->
|
490 | 501 |
|
|
546 | 557 | linear-gradient #333 #fff
|
547 | 558 | ```
|
548 | 559 |
|
| 560 | +<!-- section start --> |
| 561 | + |
549 | 562 | <!-- attr: { class:'slide-section', showInPresentation:true } -->
|
550 | 563 | <!-- # Stylus Overview
|
551 | 564 | ## Questions? -->
|
|
561 | 574 | - [facebook.com/TelerikAcademy](facebook.com/TelerikAcademy)
|
562 | 575 | - Telerik Software Academy Forums
|
563 | 576 | - forums.academy.telerik.com
|
564 |
| - |
| 577 | + |
565 | 578 | <!-- <img class="slide-image" showInPresentation="true" src="imgs/pic08.png" style="top:58.18%; left:90.52%; width:16.97%; z-index:-1" /> -->
|
566 | 579 | <!-- <img class="slide-image" showInPresentation="true" src="imgs/pic09.png" style="top:34.35%; left:68.14%; width:36.30%; z-index:-1" /> -->
|
567 |
| -<!-- <img class="slide-image" showInPresentation="true" src="imgs/pic10.png" style="top:48.92%; left:75.91%; width:10.85%; z-index:-1" /> --> |
| 580 | +<!-- <img class="slide-image" showInPresentation="true" src="imgs/pic10.png" style="top:48.92%; left:75.91%; width:10.85%; z-index:-1" /> --> |
0 commit comments