SlideShare a Scribd company logo
1 of 56
Download to read offline
Friday, May 4, 12
Sass, Compass



Friday, May 4, 12
DIE – Duplication is evil
Friday, May 4, 12
.round {
             -webkit-transform: scale(1);
             -moz-transform: scale(1);
             -o-transform: scale(1);
             transform: scale(1);
             }




Friday, May 4, 12
Sass



Friday, May 4, 12
Windows   http://rubyinstaller.org/downloads/
                              $ gem install haml
                              $ gem install haml/edge




                    Mac       $ gem install haml
                              $ gem install haml/edge




                    Linux     $ sudo apt-get install ruby
                              $ gem install haml
                              $ gem install haml/edge




                              Установка
Friday, May 4, 12
$ sass --watch <folder>

            Cледит за изменениями в sass-файлах и компилирует их в css




                      Как это работает
Friday, May 4, 12
$ sass --watch <folder>

            Cледит за изменениями в sass-файлах и компилирует их в css




                       *.sass             *.css




                      Как это работает
Friday, May 4, 12
$ sass --watch <folder>

            Cледит за изменениями в sass-файлах и компилирует их в css




                       *.sass             *.css




                      Как это работает
Friday, May 4, 12
Синтаксис



Friday, May 4, 12
table
               width: 100%
               tr
                td
                   background: #edaeda
                   p
                     font-size: 14px




                SASS — Syntactically Awesome Stylesheets
Friday, May 4, 12
table{
                      width: 100%;
                      tr{
                        td{
                           background: #edaeda;
                           p{
                              font-size: 14px;
                           }
                        }
                      }
                    }




                        SCSS — Sassy CSS
Friday, May 4, 12
SASS — лаконичность
Friday, May 4, 12
SCSS — обратная совместимость
Friday, May 4, 12
Вложенность



Friday, May 4, 12
.sidebar                      .sidebar {
             background: black             background: black;
             h2                          }
               font-size: 20px           .sidebar h2 {
             a                             font-size: 20px
               color: blue               }
               &:hover                   .sidebar a {
                 text-decoration: none     color: blue;
                                         }
                                         .sidebar a:hover {
                                           text-decoration: none;
                                         }




                        Вложенность
Friday, May 4, 12
h2                         h2{
                    font:                   font-style: italic;
                     style: italic          font-weight: bold;
                     weight: bold           font-size: 12px;
                     size: 12px             font-family: sans-serif;
                     family: sans-serif   }




                             Вложенность
Friday, May 4, 12
Переменные



Friday, May 4, 12
$text-color: #edaeda
            $content-text: FUUUUUUUuuuuuu
            $headlines-font: Arial, Helvetica, sans-serif
            $true: false




                      Переменные
Friday, May 4, 12
$width: 500px
                $height: 400px

                .center-absolute
                  background: #f2c98a
                  width: $width
                  height: $height
                  position: absolute
                  left: 50%
                  top: 50%
                  margin-top: -($height/2)
                  margin-left: -($width/2)




                          Переменные
Friday, May 4, 12
$varclass: cahoona

                    .big-#{$varclass}
                        width: 2em




                            Переменные
Friday, May 4, 12
Примеси



Friday, May 4, 12
@mixin font($size)
                 font: $size Georgia, serif

               h1
                    +font(48px)
               p
                    +font(14px)


               h1{
                  font: 48px Georgia, serif;
               }
               p{
                  font: 14px Georgia, serif;
               }




                                  Примеси
Friday, May 4, 12
Функции



Friday, May 4, 12
$color: #f00

            .somebox
                border: 1px solid $color
                box-shadow: 0 0 3px darken($color, 10%),
            inset 1px 0 lighten($color, 40%)


            .somebox {
              border: 1px solid red;
              box-shadow: 0 0 3px #cc0000, inset 1px 0 #ffcccc;
            }




                           Функции
Friday, May 4, 12
.somebox
                   background: rgba(#fff, 0.5)



               .somebox {
                   background: rgba(255, 255, 255, 0.5);
               }




                             Функции
Friday, May 4, 12
rgb($red, $green, $blue)                      lighten($color, $amount)
            rgba($red, $green, $blue, $alpha)             darken($color, $amount)
            rgba($color, $alpha)                          saturate($color, $amount)
            red($color)                                   desaturate($color, $amount)
            green($color)                                 grayscale($color)
            blue($color)                                  complement($color)
            mix($color-1, $color-2, [$weight])            invert($color)

            hsl($hue, $saturation, $lightness)            alpha($color) / opacity($color)
            hsla($hue, $saturation, $lightness, $alpha)   rgba($color, $alpha)
            hue($color)                                   opacify($color, $amount) / fade-in($color, $amount)
            saturation($color)                            transparentize($color, $amount) / fade-out($color, $amount)
            lightness($color)
            adjust-hue($color, $degrees)




                                    Еще функции
Friday, May 4, 12
http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html




                       И еще функции
Friday, May 4, 12
@extend



Friday, May 4, 12
.food
                        background-image: url(food-sprite.png)

                    .food-bacon
                        @extend .food
                        background-position: 0 -10px
                        width: 25px
                        height: 10px

                    .food-pizza
                        @extend .food
                        background-position: 0 -20px
                        width: 45px
                        height: 35px




                                   @extend
Friday, May 4, 12
.food, .food-bacon, .food-pizza{
                      background-image: url(food-sprite.png);
                    }

                    .food-bacon{
                      background-position: 0 -10px;
                      width: 25px;
                      height: 10px;
                    }

                    .food-pizza{
                      background-position: 0 -20px;
                      width: 45px;
                      height: 35px;
                    }




                                   @extend
Friday, May 4, 12
@import



Friday, May 4, 12
master.sass
             @import “main.sass”
             @import “index.sass”
             @import “profile.sass”



           master.css
             main.css + index.css + profile.css




                           @import
Friday, May 4, 12
@if
                    @for, @while
                    @function
                    @each



                            Кроме того
Friday, May 4, 12
http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html




                            Почитать
Friday, May 4, 12
Compass



Friday, May 4, 12
Friday, May 4, 12
.round
            +border-radius(25px)




                          CSS3
Friday, May 4, 12
.round
             +border-radius(25px)


          .round {
             -webkit-border-radius: 25px;
             -moz-border-radius: 25px;
             -o-border-radius: 25px;
             -ms-border-radius: 25px;
             -khtml-border-radius: 25px;
             border-radius: 25px;
             }




                             CSS3
Friday, May 4, 12
.shadow
                       +box-shadow(0 0 4px #ccc)




                    .shadow {
                        -moz-box-shadow: 0 0 4px #cccccc;
                        -webkit-box-shadow: 0 0 4px #cccccc;
                        -o-box-shadow: 0 0 4px #cccccc;
                        box-shadow: 0 0 4px #cccccc;
                    }




                                    CSS3
Friday, May 4, 12
.gradient
       +background-image(linear-gradient(#fff, #ccc 30%, #bbb 70%, #aaa))




    .gradient {
        background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff),
      color-stop(30%, #cccccc), color-stop(70%, #bbbbbb), color-stop(100%, #aaaaaa));
        background-image: -webkit-linear-gradient(#ffffff, #cccccc 30%, #bbbbbb 70%, #aaaaaa);
        background-image: -moz-linear-gradient(#ffffff, #cccccc 30%, #bbbbbb 70%, #aaaaaa);
        background-image: -o-linear-gradient(#ffffff, #cccccc 30%, #bbbbbb 70%, #aaaaaa);
        background-image: -ms-linear-gradient(#ffffff, #cccccc 30%, #bbbbbb 70%, #aaaaaa);
        background-image: linear-gradient(#ffffff, #cccccc 30%, #bbbbbb 70%, #aaaaaa);
    }




                                       CSS3
Friday, May 4, 12
.beauty-box
          +border-radius(25px)
          +box-shadow(0 0 4px #ccc)
          +background-image(linear-gradient(#fff, #aaa))




                            CSS3
Friday, May 4, 12
.beauty-box {
        -webkit-border-radius: 25px;
        -moz-border-radius: 25px;
        -o-border-radius: 25px;
        -ms-border-radius: 25px;
        -khtml-border-radius: 25px;
        border-radius: 25px;
        -moz-box-shadow: 0 0 4px #cccccc;
        -webkit-box-shadow: 0 0 4px #cccccc;
        -o-box-shadow: 0 0 4px #cccccc;
        box-shadow: 0 0 4px #cccccc;
        background-image: -webkit-gradient(...
        color-stop(30%, #cccccc), color-stop(...
        background-image: -webkit-linear-gradient(...
        background-image: -moz-linear-gradient(...
        background-image: -o-linear-gradient(...
        background-image: -ms-linear-gradient(...
        background-image: linear-gradient(...
    }




                               CSS3
Friday, May 4, 12
Background Clip
                    Background Origin
                    Background Size
                    Box
                    Box Sizing
                    Columns
                    Clearfix
                    Font Face
                    Inline Block
                    Opacity
                    Transition
                    Transform




                                        CSS3
Friday, May 4, 12
http://compass-style.org/reference/compass/css3/




                                      CSS3
Friday, May 4, 12
ico/fb.png   ico/vk.png   ico/twi.png


        $sprite: sprite-map("ico/*.png")

        .fb
          background: sprite($sprite, fb)
        .vk
          background: sprite($sprite, vk)
        .twi
          background: sprite($sprite, twi)




                                       Спрайты
Friday, May 4, 12
ico/fb.png   ico/vk.png   ico/twi.png


        $sprite: sprite-map("ico/*.png")

        .fb
          background: sprite($sprite, fb)
        .vk
          background: sprite($sprite, vk)
        .twi
          background: sprite($sprite, twi)




                                       Спрайты
Friday, May 4, 12
ico/fb.png   ico/vk.png   ico/twi.png


        $sprite: sprite-map("ico/*.png")

        .fb
          background: sprite($sprite, fb)
        .vk
          background: sprite($sprite, vk)
        .twi
          background: sprite($sprite, twi)




                                       Спрайты
Friday, May 4, 12
ico/fb.png   ico/vk.png   ico/twi.png


        $sprite: sprite-map("ico/*.png")

        .fb
          background: sprite($sprite, fb)
        .vk
          background: sprite($sprite, vk)
        .twi
          background: sprite($sprite, twi)




                                       Спрайты
Friday, May 4, 12
ico-s2e5fe71d31.png



        .fb {
          background: url('images/ico-s2e5fe71d31.png') 0 0px no-repeat;
        }
        .vk {
          background: url('images/ico-s2e5fe71d31.png') 0 -41px no-repeat;
        }
        .twi {
          background: url('images/ico-s2e5fe71d31.png') 0 -82px no-repeat;
        }




                              Спрайты
Friday, May 4, 12
ico-s2e5fe71d31.png



        .fb {
          background: url('images/ico-s2e5fe71d31.png') 0 0px no-repeat;
        }
        .vk {
          background: url('images/ico-s2e5fe71d31.png') 0 -41px no-repeat;
        }
        .twi {
          background: url('images/ico-s2e5fe71d31.png') 0 -82px no-repeat;
        }




                              Спрайты
Friday, May 4, 12
ico-s2e5fe71d31.png



        .fb {
          background: url('images/ico-s2e5fe71d31.png') 0 0px no-repeat;
        }
        .vk {
          background: url('images/ico-s2e5fe71d31.png') 0 -41px no-repeat;
        }
        .twi {
          background: url('images/ico-s2e5fe71d31.png') 0 -82px no-repeat;
        }




                              Спрайты
Friday, May 4, 12
.basebox
         background: inline-image("pic.png")




       .basebox {
         background: url('data:image/png;base64,1UcAAA...AASUVORK5CYII=');
       }




                              Base64
Friday, May 4, 12
# You can select your preferred output style here (can be overridden via the
      command line):
      # output_style = :expanded or :nested or :compact or :compressed



      output_style = :compressed




                               Config.rb
Friday, May 4, 12
http://sass-lang.com/
                http://compass-style.org/
                http://chriseppstein.github.com/
                http://nex-3.com/
                http://thesassway.com/




                           Что почитать
Friday, May 4, 12
Спасибо
                    Вопросы?

                                           @llazio
                               sd@evilmartians.com
                               www.evilmartians.ru
                               Дыниовский Сергей

Friday, May 4, 12

More Related Content

Viewers also liked

Presentación dia de campo2
Presentación dia de campo2Presentación dia de campo2
Presentación dia de campo2Mandre Ospina
 
Social media platforms and strategies
Social media platforms and strategiesSocial media platforms and strategies
Social media platforms and strategiesUSCCB
 
기업의 마케팅 트위터
기업의 마케팅 트위터기업의 마케팅 트위터
기업의 마케팅 트위터은창 이
 
CIB-PVF Line Card Rev 111
CIB-PVF Line Card Rev 111CIB-PVF Line Card Rev 111
CIB-PVF Line Card Rev 111jeyramyadielis
 
Road safety
Road safetyRoad safety
Road safetyMirmike
 
Pattern based design
Pattern based designPattern based design
Pattern based designUtkarsh Verma
 
Net303 Online Policy Primer of SlideShare.net
Net303 Online Policy Primer of SlideShare.net Net303 Online Policy Primer of SlideShare.net
Net303 Online Policy Primer of SlideShare.net CurtinStud
 
RSS와 SNS를 활용한 마케팅
RSS와 SNS를 활용한 마케팅RSS와 SNS를 활용한 마케팅
RSS와 SNS를 활용한 마케팅은창 이
 
Презентация "новый свет"
Презентация "новый свет"Презентация "новый свет"
Презентация "новый свет"kan6363
 

Viewers also liked (20)

Presentación dia de campo2
Presentación dia de campo2Presentación dia de campo2
Presentación dia de campo2
 
Objetos de la cocina
Objetos de la cocinaObjetos de la cocina
Objetos de la cocina
 
Social media platforms and strategies
Social media platforms and strategiesSocial media platforms and strategies
Social media platforms and strategies
 
Redcross
RedcrossRedcross
Redcross
 
기업의 마케팅 트위터
기업의 마케팅 트위터기업의 마케팅 트위터
기업의 마케팅 트위터
 
CIB-PVF Line Card Rev 111
CIB-PVF Line Card Rev 111CIB-PVF Line Card Rev 111
CIB-PVF Line Card Rev 111
 
Session fixation
Session fixationSession fixation
Session fixation
 
Road safety
Road safetyRoad safety
Road safety
 
Pattern based design
Pattern based designPattern based design
Pattern based design
 
Tugas ke 1
Tugas ke 1Tugas ke 1
Tugas ke 1
 
Tugas ke 5
Tugas ke 5Tugas ke 5
Tugas ke 5
 
805 15-kevin
805 15-kevin805 15-kevin
805 15-kevin
 
805 15-kevin
805 15-kevin805 15-kevin
805 15-kevin
 
Net303 Online Policy Primer of SlideShare.net
Net303 Online Policy Primer of SlideShare.net Net303 Online Policy Primer of SlideShare.net
Net303 Online Policy Primer of SlideShare.net
 
Dumpster diving
Dumpster divingDumpster diving
Dumpster diving
 
RSS와 SNS를 활용한 마케팅
RSS와 SNS를 활용한 마케팅RSS와 SNS를 활용한 마케팅
RSS와 SNS를 활용한 마케팅
 
מצגת יובל
מצגת יובלמצגת יובל
מצגת יובל
 
Resume
ResumeResume
Resume
 
Презентация "новый свет"
Презентация "новый свет"Презентация "новый свет"
Презентация "новый свет"
 
Chapter 8
Chapter 8Chapter 8
Chapter 8
 

Similar to SASS, Compass 1.1

Wrangling the CSS Beast with Sass
Wrangling the CSS Beast  with SassWrangling the CSS Beast  with Sass
Wrangling the CSS Beast with SassRob Friesel
 
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"bentleyhoke
 
Work and play with SASS & Compass
Work and play with SASS & CompassWork and play with SASS & Compass
Work and play with SASS & CompassAndreas Dantz
 
Finding your way with Sass+Compass
Finding your way with Sass+CompassFinding your way with Sass+Compass
Finding your way with Sass+Compassdrywallbmb
 
Simple introduction Sass
Simple introduction SassSimple introduction Sass
Simple introduction SassZeeshan Ahmed
 
Preprocessor presentation
Preprocessor presentationPreprocessor presentation
Preprocessor presentationMario Noble
 
Sassy Stylesheets with SCSS
Sassy Stylesheets with SCSSSassy Stylesheets with SCSS
Sassy Stylesheets with SCSSKathryn Rotondo
 
CSS with LESS for #jd13nl
CSS with LESS for #jd13nlCSS with LESS for #jd13nl
CSS with LESS for #jd13nlHans Kuijpers
 
Drupal & CSS Preprocessors
Drupal & CSS PreprocessorsDrupal & CSS Preprocessors
Drupal & CSS Preprocessorskdmarks
 
Sass - Making CSS fun again.
Sass - Making CSS fun again.Sass - Making CSS fun again.
Sass - Making CSS fun again.Gabriel Neutzling
 
Sassive Aggressive: Using Sass to Make Your Life Easier (Refresh Boston Version)
Sassive Aggressive: Using Sass to Make Your Life Easier (Refresh Boston Version)Sassive Aggressive: Using Sass to Make Your Life Easier (Refresh Boston Version)
Sassive Aggressive: Using Sass to Make Your Life Easier (Refresh Boston Version)Adam Darowski
 
Building Custom WordPress Themes with Sass - WordCamp Sacramento 2016
Building Custom WordPress Themes with Sass - WordCamp Sacramento 2016Building Custom WordPress Themes with Sass - WordCamp Sacramento 2016
Building Custom WordPress Themes with Sass - WordCamp Sacramento 2016Matt Vanderpol
 
Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)emrox
 

Similar to SASS, Compass 1.1 (20)

Wrangling the CSS Beast with Sass
Wrangling the CSS Beast  with SassWrangling the CSS Beast  with Sass
Wrangling the CSS Beast with Sass
 
CSS Extenders
CSS ExtendersCSS Extenders
CSS Extenders
 
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"
 
A better CSS: Sass and Less - CC FE & UX
A better CSS: Sass and Less - CC FE & UXA better CSS: Sass and Less - CC FE & UX
A better CSS: Sass and Less - CC FE & UX
 
FCIP SASS Talk
FCIP SASS TalkFCIP SASS Talk
FCIP SASS Talk
 
Work and play with SASS & Compass
Work and play with SASS & CompassWork and play with SASS & Compass
Work and play with SASS & Compass
 
Finding your way with Sass+Compass
Finding your way with Sass+CompassFinding your way with Sass+Compass
Finding your way with Sass+Compass
 
Simple introduction Sass
Simple introduction SassSimple introduction Sass
Simple introduction Sass
 
PHP 5 Boot Camp
PHP 5 Boot CampPHP 5 Boot Camp
PHP 5 Boot Camp
 
Preprocessor presentation
Preprocessor presentationPreprocessor presentation
Preprocessor presentation
 
Theming and Sass
Theming and SassTheming and Sass
Theming and Sass
 
Sassy Stylesheets with SCSS
Sassy Stylesheets with SCSSSassy Stylesheets with SCSS
Sassy Stylesheets with SCSS
 
CSS with LESS for #jd13nl
CSS with LESS for #jd13nlCSS with LESS for #jd13nl
CSS with LESS for #jd13nl
 
Sass, Compass
Sass, CompassSass, Compass
Sass, Compass
 
Drupal & CSS Preprocessors
Drupal & CSS PreprocessorsDrupal & CSS Preprocessors
Drupal & CSS Preprocessors
 
Sass - Making CSS fun again.
Sass - Making CSS fun again.Sass - Making CSS fun again.
Sass - Making CSS fun again.
 
Sassive Aggressive: Using Sass to Make Your Life Easier (Refresh Boston Version)
Sassive Aggressive: Using Sass to Make Your Life Easier (Refresh Boston Version)Sassive Aggressive: Using Sass to Make Your Life Easier (Refresh Boston Version)
Sassive Aggressive: Using Sass to Make Your Life Easier (Refresh Boston Version)
 
Building Custom WordPress Themes with Sass - WordCamp Sacramento 2016
Building Custom WordPress Themes with Sass - WordCamp Sacramento 2016Building Custom WordPress Themes with Sass - WordCamp Sacramento 2016
Building Custom WordPress Themes with Sass - WordCamp Sacramento 2016
 
Sass
SassSass
Sass
 
Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)
 

Recently uploaded

Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Patrick Viafore
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024Stephen Perrenod
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Skynet Technologies
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfSrushith Repakula
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptxFIDO Alliance
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FIDO Alliance
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...ScyllaDB
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...FIDO Alliance
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...marcuskenyatta275
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe中 央社
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!Memoori
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsLeah Henrickson
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxFIDO Alliance
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch TuesdayIvanti
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...FIDO Alliance
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfFIDO Alliance
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...ScyllaDB
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxFIDO Alliance
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfFIDO Alliance
 

Recently uploaded (20)

Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptx
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 

SASS, Compass 1.1

  • 3. DIE – Duplication is evil Friday, May 4, 12
  • 4. .round { -webkit-transform: scale(1); -moz-transform: scale(1); -o-transform: scale(1); transform: scale(1); } Friday, May 4, 12
  • 6. Windows http://rubyinstaller.org/downloads/ $ gem install haml $ gem install haml/edge Mac $ gem install haml $ gem install haml/edge Linux $ sudo apt-get install ruby $ gem install haml $ gem install haml/edge Установка Friday, May 4, 12
  • 7. $ sass --watch <folder> Cледит за изменениями в sass-файлах и компилирует их в css Как это работает Friday, May 4, 12
  • 8. $ sass --watch <folder> Cледит за изменениями в sass-файлах и компилирует их в css *.sass *.css Как это работает Friday, May 4, 12
  • 9. $ sass --watch <folder> Cледит за изменениями в sass-файлах и компилирует их в css *.sass *.css Как это работает Friday, May 4, 12
  • 11. table width: 100% tr td background: #edaeda p font-size: 14px SASS — Syntactically Awesome Stylesheets Friday, May 4, 12
  • 12. table{ width: 100%; tr{ td{ background: #edaeda; p{ font-size: 14px; } } } } SCSS — Sassy CSS Friday, May 4, 12
  • 14. SCSS — обратная совместимость Friday, May 4, 12
  • 16. .sidebar .sidebar { background: black background: black; h2 } font-size: 20px .sidebar h2 { a font-size: 20px color: blue } &:hover .sidebar a { text-decoration: none color: blue; } .sidebar a:hover { text-decoration: none; } Вложенность Friday, May 4, 12
  • 17. h2 h2{ font: font-style: italic; style: italic font-weight: bold; weight: bold font-size: 12px; size: 12px font-family: sans-serif; family: sans-serif } Вложенность Friday, May 4, 12
  • 19. $text-color: #edaeda $content-text: FUUUUUUUuuuuuu $headlines-font: Arial, Helvetica, sans-serif $true: false Переменные Friday, May 4, 12
  • 20. $width: 500px $height: 400px .center-absolute background: #f2c98a width: $width height: $height position: absolute left: 50% top: 50% margin-top: -($height/2) margin-left: -($width/2) Переменные Friday, May 4, 12
  • 21. $varclass: cahoona .big-#{$varclass} width: 2em Переменные Friday, May 4, 12
  • 23. @mixin font($size) font: $size Georgia, serif h1 +font(48px) p +font(14px) h1{ font: 48px Georgia, serif; } p{ font: 14px Georgia, serif; } Примеси Friday, May 4, 12
  • 25. $color: #f00 .somebox border: 1px solid $color box-shadow: 0 0 3px darken($color, 10%), inset 1px 0 lighten($color, 40%) .somebox { border: 1px solid red; box-shadow: 0 0 3px #cc0000, inset 1px 0 #ffcccc; } Функции Friday, May 4, 12
  • 26. .somebox background: rgba(#fff, 0.5) .somebox { background: rgba(255, 255, 255, 0.5); } Функции Friday, May 4, 12
  • 27. rgb($red, $green, $blue) lighten($color, $amount) rgba($red, $green, $blue, $alpha) darken($color, $amount) rgba($color, $alpha) saturate($color, $amount) red($color) desaturate($color, $amount) green($color) grayscale($color) blue($color) complement($color) mix($color-1, $color-2, [$weight]) invert($color) hsl($hue, $saturation, $lightness) alpha($color) / opacity($color) hsla($hue, $saturation, $lightness, $alpha) rgba($color, $alpha) hue($color) opacify($color, $amount) / fade-in($color, $amount) saturation($color) transparentize($color, $amount) / fade-out($color, $amount) lightness($color) adjust-hue($color, $degrees) Еще функции Friday, May 4, 12
  • 28. http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html И еще функции Friday, May 4, 12
  • 30. .food background-image: url(food-sprite.png) .food-bacon @extend .food background-position: 0 -10px width: 25px height: 10px .food-pizza @extend .food background-position: 0 -20px width: 45px height: 35px @extend Friday, May 4, 12
  • 31. .food, .food-bacon, .food-pizza{ background-image: url(food-sprite.png); } .food-bacon{ background-position: 0 -10px; width: 25px; height: 10px; } .food-pizza{ background-position: 0 -20px; width: 45px; height: 35px; } @extend Friday, May 4, 12
  • 33. master.sass @import “main.sass” @import “index.sass” @import “profile.sass” master.css main.css + index.css + profile.css @import Friday, May 4, 12
  • 34. @if @for, @while @function @each Кроме того Friday, May 4, 12
  • 38. .round +border-radius(25px) CSS3 Friday, May 4, 12
  • 39. .round +border-radius(25px) .round { -webkit-border-radius: 25px; -moz-border-radius: 25px; -o-border-radius: 25px; -ms-border-radius: 25px; -khtml-border-radius: 25px; border-radius: 25px; } CSS3 Friday, May 4, 12
  • 40. .shadow   +box-shadow(0 0 4px #ccc) .shadow {   -moz-box-shadow: 0 0 4px #cccccc;   -webkit-box-shadow: 0 0 4px #cccccc;   -o-box-shadow: 0 0 4px #cccccc;   box-shadow: 0 0 4px #cccccc; } CSS3 Friday, May 4, 12
  • 41. .gradient   +background-image(linear-gradient(#fff, #ccc 30%, #bbb 70%, #aaa)) .gradient { background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(30%, #cccccc), color-stop(70%, #bbbbbb), color-stop(100%, #aaaaaa)); background-image: -webkit-linear-gradient(#ffffff, #cccccc 30%, #bbbbbb 70%, #aaaaaa); background-image: -moz-linear-gradient(#ffffff, #cccccc 30%, #bbbbbb 70%, #aaaaaa); background-image: -o-linear-gradient(#ffffff, #cccccc 30%, #bbbbbb 70%, #aaaaaa); background-image: -ms-linear-gradient(#ffffff, #cccccc 30%, #bbbbbb 70%, #aaaaaa); background-image: linear-gradient(#ffffff, #cccccc 30%, #bbbbbb 70%, #aaaaaa); } CSS3 Friday, May 4, 12
  • 42. .beauty-box +border-radius(25px) +box-shadow(0 0 4px #ccc) +background-image(linear-gradient(#fff, #aaa)) CSS3 Friday, May 4, 12
  • 43. .beauty-box { -webkit-border-radius: 25px; -moz-border-radius: 25px; -o-border-radius: 25px; -ms-border-radius: 25px; -khtml-border-radius: 25px; border-radius: 25px; -moz-box-shadow: 0 0 4px #cccccc; -webkit-box-shadow: 0 0 4px #cccccc; -o-box-shadow: 0 0 4px #cccccc; box-shadow: 0 0 4px #cccccc; background-image: -webkit-gradient(... color-stop(30%, #cccccc), color-stop(... background-image: -webkit-linear-gradient(... background-image: -moz-linear-gradient(... background-image: -o-linear-gradient(... background-image: -ms-linear-gradient(... background-image: linear-gradient(... } CSS3 Friday, May 4, 12
  • 44. Background Clip Background Origin Background Size Box Box Sizing Columns Clearfix Font Face Inline Block Opacity Transition Transform CSS3 Friday, May 4, 12
  • 46. ico/fb.png ico/vk.png ico/twi.png $sprite: sprite-map("ico/*.png") .fb background: sprite($sprite, fb) .vk background: sprite($sprite, vk) .twi background: sprite($sprite, twi) Спрайты Friday, May 4, 12
  • 47. ico/fb.png ico/vk.png ico/twi.png $sprite: sprite-map("ico/*.png") .fb background: sprite($sprite, fb) .vk background: sprite($sprite, vk) .twi background: sprite($sprite, twi) Спрайты Friday, May 4, 12
  • 48. ico/fb.png ico/vk.png ico/twi.png $sprite: sprite-map("ico/*.png") .fb background: sprite($sprite, fb) .vk background: sprite($sprite, vk) .twi background: sprite($sprite, twi) Спрайты Friday, May 4, 12
  • 49. ico/fb.png ico/vk.png ico/twi.png $sprite: sprite-map("ico/*.png") .fb background: sprite($sprite, fb) .vk background: sprite($sprite, vk) .twi background: sprite($sprite, twi) Спрайты Friday, May 4, 12
  • 50. ico-s2e5fe71d31.png .fb { background: url('images/ico-s2e5fe71d31.png') 0 0px no-repeat; } .vk { background: url('images/ico-s2e5fe71d31.png') 0 -41px no-repeat; } .twi { background: url('images/ico-s2e5fe71d31.png') 0 -82px no-repeat; } Спрайты Friday, May 4, 12
  • 51. ico-s2e5fe71d31.png .fb { background: url('images/ico-s2e5fe71d31.png') 0 0px no-repeat; } .vk { background: url('images/ico-s2e5fe71d31.png') 0 -41px no-repeat; } .twi { background: url('images/ico-s2e5fe71d31.png') 0 -82px no-repeat; } Спрайты Friday, May 4, 12
  • 52. ico-s2e5fe71d31.png .fb { background: url('images/ico-s2e5fe71d31.png') 0 0px no-repeat; } .vk { background: url('images/ico-s2e5fe71d31.png') 0 -41px no-repeat; } .twi { background: url('images/ico-s2e5fe71d31.png') 0 -82px no-repeat; } Спрайты Friday, May 4, 12
  • 53. .basebox background: inline-image("pic.png") .basebox { background: url('data:image/png;base64,1UcAAA...AASUVORK5CYII='); } Base64 Friday, May 4, 12
  • 54. # You can select your preferred output style here (can be overridden via the command line): # output_style = :expanded or :nested or :compact or :compressed output_style = :compressed Config.rb Friday, May 4, 12
  • 55. http://sass-lang.com/ http://compass-style.org/ http://chriseppstein.github.com/ http://nex-3.com/ http://thesassway.com/ Что почитать Friday, May 4, 12
  • 56. Спасибо Вопросы? @llazio sd@evilmartians.com www.evilmartians.ru Дыниовский Сергей Friday, May 4, 12