SlideShare a Scribd company logo
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 campo2
Mandre Ospina
 
Objetos de la cocina
Objetos de la cocinaObjetos de la cocina
Objetos de la cocina
Sofıa D'Karaman
 
Social media platforms and strategies
Social media platforms and strategiesSocial media platforms and strategies
Social media platforms and strategies
USCCB
 
기업의 마케팅 트위터
기업의 마케팅 트위터기업의 마케팅 트위터
기업의 마케팅 트위터은창 이
 
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 safety
Mirmike
 
Pattern based design
Pattern based designPattern based design
Pattern based design
Utkarsh 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 Sass
Rob Friesel
 
CSS Extenders
CSS ExtendersCSS Extenders
CSS Extenders
Idan Gazit
 
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
 
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
JWORKS powered by Ordina
 
Work and play with SASS & Compass
Work and play with SASS & CompassWork and play with SASS & Compass
Work and play with SASS & Compass
Andreas Dantz
 
Finding your way with Sass+Compass
Finding your way with Sass+CompassFinding your way with Sass+Compass
Finding your way with Sass+Compass
drywallbmb
 
Simple introduction Sass
Simple introduction SassSimple introduction Sass
Simple introduction SassZeeshan Ahmed
 
Preprocessor presentation
Preprocessor presentationPreprocessor presentation
Preprocessor presentation
Mario Noble
 
Theming and Sass
Theming and SassTheming and Sass
Theming and Sass
James Pearce
 
Sassy Stylesheets with SCSS
Sassy Stylesheets with SCSSSassy Stylesheets with SCSS
Sassy Stylesheets with SCSS
Kathryn Rotondo
 
CSS with LESS for #jd13nl
CSS with LESS for #jd13nlCSS with LESS for #jd13nl
CSS with LESS for #jd13nl
Hans 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 2016
Matt Vanderpol
 
Sass
SassSass
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

AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 

Recently uploaded (20)

AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.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