SlideShare a Scribd company logo
1 of 48
Sass, Compass
DIE — Duplication Is
       Evil
.round {
   border-radius: 10px;
   -webkit-border-radius: 10px;
   -moz-border-radius: 10px;
   -o-border-radius: 10px;
   -ms-border-radius: 10px;
   -khtml-border-radius: 10px;
   }
SASS
SCSS                    SASS
header{                 header
  text-align: center;     text-align: center
  h2{                     h2
    font-size: 48px;         font-size: 48px
  }
}




SCSS — Sassy CSS
SASS — Syntactically Awesome Stylesheets
Ни былин,
    ни эпосов,
        ни эпопей.
Телеграммой
    лети,
        строфа!
Воспаленной губой
    припади
        и попей
из реки
    по имени — "Факт".

        В. Маяковский
SCSS — обратная
 совместимость
Каскадность
header                        header {
  background: black             background: black;
  h2                          }
    font:                     header h2 {
      weight: normal            font-weight: normal;
      size: 48px                font-size: 48px;
                              }

a                             a {
    color: blue                 color: blue;
    &:hover                   }
      text-decoration: none   a:hover {
    &::before                   text-decoration: none;
      content: “Sosiska”      }
                              a::before {
                                content: “Sosiska”;
                              }
Переменные
$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)
$varclass: cahoona

.big-#{$varclass}
    width: 2em
Примеси
@mixin font($size)
   font: $size Georgia, serif
h1
   +font(48px)
p
   +font(14px)




h1{
   font: 48px Georgia, serif;
}
p{
   font: 14px Georgia, serif;
}
Цвета
$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;
}
.somebox
    background: rgba(#fff, 0.5)




.somebox {
    background: rgba(255, 255, 255, 0.5);
}
rgb($red, $green, $blue)
rgba($red, $green, $blue, $alpha)
rgba($color, $alpha)
red($color)
green($color)
blue($color)
mix($color-1, $color-2, [$weight])

hsl($hue, $saturation, $lightness)
hsla($hue, $saturation, $lightness, $alpha)
hue($color)
saturation($color)
lightness($color)
adjust-hue($color, $degrees)
lighten($color, $amount)
darken($color, $amount)
saturate($color, $amount)
desaturate($color, $amount)
grayscale($color)
complement($color)
invert($color)

alpha($color) / opacity($color)
rgba($color, $alpha)
opacify($color, $amount) / fade-in($color, $amount)
transparentize($color, $amount) / fade-out($color, $amount)
http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html
@extend
.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
.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;
}
@if, @else
@mixin color($type)
  @if $type == chocolate
    color: brown
  @else if $type == pizza
    color: red
  @else if $type == apple
    color: green
  @else
    color: black

.pizza
  +color(pizza)
@for, @while
@for $i from 1 through 3
  .item-#{$i}
    width: 1em + $i



.item-1 {
  width: 2em;
}

.item-2 {
  width: 3em;
}

.item-3 {
  width: 4em;
}
@each
@each $color in red, green, gray
  .theme-#{$color}
    background: $color




.theme-red{
  background: red;
}

.theme-green{
  background: green;
}

.theme-gray{
  background: gray;
}
@import
master.sass
  @import “main.sass”
  @import “index.sass”
  @import “profile.sass”



master.css
  main.css + index.css + profile.css
Compass
— Nathan Smith
Border-radius
.round
  +border-radius(25px)
.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;
   }
Box-shadow
.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;
}
Градиенты
.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);
}
.beauty-box
    +border-radius(25px)
    +box-shadow(0 0 4px #ccc)
    +background-image(linear-gradient(#fff, #ccc 30%, #bbb 70%, #aaa))



.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(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);
}
Еще примеси
Background Clip
Background Origin
Background Size
Box
Box Sizing
Columns
Clearfix
Font Face
Inline Block
Opacity
Transition
Transform
http://compass-style.org/reference/compass/css3/
Спрайты
fb.png   vk.png   twi.png




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

.fb
  background: sprite($sprite, fb)
.vk
  background: sprite($sprite, vk)
.twi
  background: sprite($sprite, twi)
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;
}
.basebox
  background: inline-image("pic.png")




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

# 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
Установка
Windows   1. http://rubyinstaller.org/downloads/
          2. gem install haml
          3. gem install haml/edge
          4. gem install compass

Mac       1. gem install haml
          2. gem install haml/edge
          3. gem install compass

Linux     1. sudo apt-get install ruby
          2. gem install haml
          3. gem install haml/edge
          4. gem install compass
Как это работает
compass create <projectname> - создает
compass-проект

compass watch - следит за изменениями в
sass-файлах и сразу компилирует их в css
Что почитать
http://sass-lang.com/
http://compass-style.org/
http://chriseppstein.github.com/
http://nex-3.com/
http://thesassway.com/
Спасибо
Вопросы?

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

More Related Content

What's hot

Learn to Love CSS3 [English]
Learn to Love CSS3 [English]Learn to Love CSS3 [English]
Learn to Love CSS3 [English]ThemePartner
 
Sassive Aggressive: Using Sass to Make Your Life Easier (NSWG Version)
Sassive Aggressive: Using Sass to Make Your Life Easier (NSWG Version)Sassive Aggressive: Using Sass to Make Your Life Easier (NSWG Version)
Sassive Aggressive: Using Sass to Make Your Life Easier (NSWG Version)Adam Darowski
 
Big Design Conference: CSS3
Big Design Conference: CSS3 Big Design Conference: CSS3
Big Design Conference: CSS3 Wynn Netherland
 
Raleigh Web Design Meetup Group - Sass Presentation
Raleigh Web Design Meetup Group - Sass PresentationRaleigh Web Design Meetup Group - Sass Presentation
Raleigh Web Design Meetup Group - Sass PresentationDaniel Yuschick
 
Xlrays online web tutorials
Xlrays online web tutorialsXlrays online web tutorials
Xlrays online web tutorialsYogesh Gupta
 
Demystifying CSS & WordPress
Demystifying CSS & WordPressDemystifying CSS & WordPress
Demystifying CSS & WordPressJustin Carmony
 
Keep calm and let's play CSS3
Keep calm and let's play CSS3Keep calm and let's play CSS3
Keep calm and let's play CSS3A2 Comunicação
 
Finding your way with Sass+Compass
Finding your way with Sass+CompassFinding your way with Sass+Compass
Finding your way with Sass+Compassdrywallbmb
 
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programingRuby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programingBozhidar Batsov
 
Sass, Compass and the new tools - Open Web Camp IV
Sass, Compass and the new tools - Open Web Camp IVSass, Compass and the new tools - Open Web Camp IV
Sass, Compass and the new tools - Open Web Camp IVDirk Ginader
 
The Future of Frontend - what is new in CSS?
The Future of Frontend - what is new in CSS?The Future of Frontend - what is new in CSS?
The Future of Frontend - what is new in CSS?Rachel Andrew
 
Ch1(introduction to php)
Ch1(introduction to php)Ch1(introduction to php)
Ch1(introduction to php)Chhom Karath
 
Elegant CSS Design In Drupal: LESS vs Sass
Elegant CSS Design In Drupal: LESS vs SassElegant CSS Design In Drupal: LESS vs Sass
Elegant CSS Design In Drupal: LESS vs SassMediacurrent
 
Confoo: The New CSS Layout
Confoo: The New CSS LayoutConfoo: The New CSS Layout
Confoo: The New CSS LayoutRachel Andrew
 
Yeni metin belgesi (2)
Yeni metin belgesi (2)Yeni metin belgesi (2)
Yeni metin belgesi (2)makarnalar
 

What's hot (20)

Learn to Love CSS3 [English]
Learn to Love CSS3 [English]Learn to Love CSS3 [English]
Learn to Love CSS3 [English]
 
Sassive Aggressive: Using Sass to Make Your Life Easier (NSWG Version)
Sassive Aggressive: Using Sass to Make Your Life Easier (NSWG Version)Sassive Aggressive: Using Sass to Make Your Life Easier (NSWG Version)
Sassive Aggressive: Using Sass to Make Your Life Easier (NSWG Version)
 
Big Design Conference: CSS3
Big Design Conference: CSS3 Big Design Conference: CSS3
Big Design Conference: CSS3
 
Raleigh Web Design Meetup Group - Sass Presentation
Raleigh Web Design Meetup Group - Sass PresentationRaleigh Web Design Meetup Group - Sass Presentation
Raleigh Web Design Meetup Group - Sass Presentation
 
Xlrays online web tutorials
Xlrays online web tutorialsXlrays online web tutorials
Xlrays online web tutorials
 
Demystifying CSS & WordPress
Demystifying CSS & WordPressDemystifying CSS & WordPress
Demystifying CSS & WordPress
 
Keep calm and let's play CSS3
Keep calm and let's play CSS3Keep calm and let's play CSS3
Keep calm and let's play CSS3
 
Finding your way with Sass+Compass
Finding your way with Sass+CompassFinding your way with Sass+Compass
Finding your way with Sass+Compass
 
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programingRuby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
 
Sass, Compass and the new tools - Open Web Camp IV
Sass, Compass and the new tools - Open Web Camp IVSass, Compass and the new tools - Open Web Camp IV
Sass, Compass and the new tools - Open Web Camp IV
 
The Future of Frontend - what is new in CSS?
The Future of Frontend - what is new in CSS?The Future of Frontend - what is new in CSS?
The Future of Frontend - what is new in CSS?
 
Theme 23
Theme 23Theme 23
Theme 23
 
Ch1(introduction to php)
Ch1(introduction to php)Ch1(introduction to php)
Ch1(introduction to php)
 
Everest
EverestEverest
Everest
 
Landing Pages 101
Landing Pages 101Landing Pages 101
Landing Pages 101
 
Elegant CSS Design In Drupal: LESS vs Sass
Elegant CSS Design In Drupal: LESS vs SassElegant CSS Design In Drupal: LESS vs Sass
Elegant CSS Design In Drupal: LESS vs Sass
 
JSON and the APInauts
JSON and the APInautsJSON and the APInauts
JSON and the APInauts
 
Confoo: The New CSS Layout
Confoo: The New CSS LayoutConfoo: The New CSS Layout
Confoo: The New CSS Layout
 
Wsomdp
WsomdpWsomdp
Wsomdp
 
Yeni metin belgesi (2)
Yeni metin belgesi (2)Yeni metin belgesi (2)
Yeni metin belgesi (2)
 

Viewers also liked

Agile CSS development with Compass and Sass
Agile CSS development with Compass and SassAgile CSS development with Compass and Sass
Agile CSS development with Compass and SassAndrea Verlicchi
 
Authoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & SassAuthoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & Sasschriseppstein
 
Road safety
Road safetyRoad safety
Road safetyMirmike
 
RSS와 SNS를 활용한 마케팅
RSS와 SNS를 활용한 마케팅RSS와 SNS를 활용한 마케팅
RSS와 SNS를 활용한 마케팅은창 이
 
Pattern based design
Pattern based designPattern based design
Pattern based designUtkarsh Verma
 
2011 CMA Festival Championship
2011 CMA Festival Championship2011 CMA Festival Championship
2011 CMA Festival ChampionshipDaniel Pesek
 
Fotografias motos chopper
Fotografias motos chopperFotografias motos chopper
Fotografias motos chopperediadri8
 
기업의 마케팅 트위터
기업의 마케팅 트위터기업의 마케팅 트위터
기업의 마케팅 트위터은창 이
 
Solomon rprc7e dyn10
Solomon rprc7e dyn10Solomon rprc7e dyn10
Solomon rprc7e dyn10Susie Pryor
 
Social media platforms and strategies
Social media platforms and strategiesSocial media platforms and strategies
Social media platforms and strategiesUSCCB
 

Viewers also liked (20)

Agile CSS development with Compass and Sass
Agile CSS development with Compass and SassAgile CSS development with Compass and Sass
Agile CSS development with Compass and Sass
 
Authoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & SassAuthoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & Sass
 
805 15-kevin
805 15-kevin805 15-kevin
805 15-kevin
 
Road safety
Road safetyRoad safety
Road safety
 
RSS와 SNS를 활용한 마케팅
RSS와 SNS를 활용한 마케팅RSS와 SNS를 활용한 마케팅
RSS와 SNS를 활용한 마케팅
 
Halloween
HalloweenHalloween
Halloween
 
Presentation
PresentationPresentation
Presentation
 
Dumpster diving
Dumpster divingDumpster diving
Dumpster diving
 
Pattern based design
Pattern based designPattern based design
Pattern based design
 
2011 CMA Festival Championship
2011 CMA Festival Championship2011 CMA Festival Championship
2011 CMA Festival Championship
 
Fotografias motos chopper
Fotografias motos chopperFotografias motos chopper
Fotografias motos chopper
 
Arch. maria rosaria_marsico
Arch. maria rosaria_marsicoArch. maria rosaria_marsico
Arch. maria rosaria_marsico
 
tugas 7
tugas 7tugas 7
tugas 7
 
Tugas ke 1
Tugas ke 1Tugas ke 1
Tugas ke 1
 
Mp4 Recovery
Mp4 RecoveryMp4 Recovery
Mp4 Recovery
 
Tugas ke 5
Tugas ke 5Tugas ke 5
Tugas ke 5
 
기업의 마케팅 트위터
기업의 마케팅 트위터기업의 마케팅 트위터
기업의 마케팅 트위터
 
Solomon rprc7e dyn10
Solomon rprc7e dyn10Solomon rprc7e dyn10
Solomon rprc7e dyn10
 
Social media platforms and strategies
Social media platforms and strategiesSocial media platforms and strategies
Social media platforms and strategies
 
Tugas ke 6
Tugas ke 6Tugas ke 6
Tugas ke 6
 

Similar to Sass, Compass

CSS3 is Not Magic Pixie Dust
CSS3 is Not Magic Pixie DustCSS3 is Not Magic Pixie Dust
CSS3 is Not Magic Pixie DustKyle Adams
 
Wrangling the CSS Beast with Sass
Wrangling the CSS Beast  with SassWrangling the CSS Beast  with Sass
Wrangling the CSS Beast with SassRob Friesel
 
HTML&CSS 5 - Intermediate CSS (2/2)
HTML&CSS 5 - Intermediate CSS (2/2)HTML&CSS 5 - Intermediate CSS (2/2)
HTML&CSS 5 - Intermediate CSS (2/2)Dinis Correia
 
Work and play with SASS & Compass
Work and play with SASS & CompassWork and play with SASS & Compass
Work and play with SASS & CompassAndreas Dantz
 
Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)emrox
 
CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書拓樹 谷
 
Using Sass - Building on CSS
Using Sass - Building on CSSUsing Sass - Building on CSS
Using Sass - Building on CSSSayanee Basu
 
Preprocessor presentation
Preprocessor presentationPreprocessor presentation
Preprocessor presentationMario Noble
 
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
 
Rapid Prototyping
Rapid PrototypingRapid Prototyping
Rapid PrototypingEven Wu
 
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
 
Save time by using SASS/SCSS
Save time by using SASS/SCSSSave time by using SASS/SCSS
Save time by using SASS/SCSSBerit Hlubek
 

Similar to Sass, Compass (20)

CSS3 is Not Magic Pixie Dust
CSS3 is Not Magic Pixie DustCSS3 is Not Magic Pixie Dust
CSS3 is Not Magic Pixie Dust
 
FCIP SASS Talk
FCIP SASS TalkFCIP SASS Talk
FCIP SASS Talk
 
Wrangling the CSS Beast with Sass
Wrangling the CSS Beast  with SassWrangling the CSS Beast  with Sass
Wrangling the CSS Beast with Sass
 
Css 2
Css 2Css 2
Css 2
 
Css
CssCss
Css
 
Css 3
Css 3Css 3
Css 3
 
HTML&CSS 5 - Intermediate CSS (2/2)
HTML&CSS 5 - Intermediate CSS (2/2)HTML&CSS 5 - Intermediate CSS (2/2)
HTML&CSS 5 - Intermediate CSS (2/2)
 
Work and play with SASS & Compass
Work and play with SASS & CompassWork and play with SASS & Compass
Work and play with SASS & Compass
 
Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)
 
CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書
 
Using Sass - Building on CSS
Using Sass - Building on CSSUsing Sass - Building on CSS
Using Sass - Building on CSS
 
Preprocessor presentation
Preprocessor presentationPreprocessor presentation
Preprocessor presentation
 
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)
 
Rapid Prototyping
Rapid PrototypingRapid Prototyping
Rapid Prototyping
 
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"
 
Css3 process bar
Css3 process barCss3 process bar
Css3 process bar
 
Css3 process bar
Css3 process barCss3 process bar
Css3 process bar
 
Css3 process bar
Css3 process barCss3 process bar
Css3 process bar
 
Save time by using SASS/SCSS
Save time by using SASS/SCSSSave time by using SASS/SCSS
Save time by using SASS/SCSS
 
Sass compass
Sass compassSass compass
Sass compass
 

Recently uploaded

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 

Sass, Compass

  • 3. .round { border-radius: 10px; -webkit-border-radius: 10px; -moz-border-radius: 10px; -o-border-radius: 10px; -ms-border-radius: 10px; -khtml-border-radius: 10px; }
  • 5. SCSS SASS header{ header text-align: center; text-align: center h2{ h2 font-size: 48px; font-size: 48px } } SCSS — Sassy CSS SASS — Syntactically Awesome Stylesheets
  • 6. Ни былин, ни эпосов, ни эпопей. Телеграммой лети, строфа! Воспаленной губой припади и попей из реки по имени — "Факт". В. Маяковский
  • 7. SCSS — обратная совместимость
  • 9. header header { background: black background: black; h2 } font: header h2 { weight: normal font-weight: normal; size: 48px font-size: 48px; } a a { color: blue color: blue; &:hover } text-decoration: none a:hover { &::before text-decoration: none; content: “Sosiska” } a::before { content: “Sosiska”; }
  • 11. $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)
  • 14. @mixin font($size) font: $size Georgia, serif h1 +font(48px) p +font(14px) h1{ font: 48px Georgia, serif; } p{ font: 14px Georgia, serif; }
  • 16. $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; }
  • 17. .somebox background: rgba(#fff, 0.5) .somebox { background: rgba(255, 255, 255, 0.5); }
  • 18. rgb($red, $green, $blue) rgba($red, $green, $blue, $alpha) rgba($color, $alpha) red($color) green($color) blue($color) mix($color-1, $color-2, [$weight]) hsl($hue, $saturation, $lightness) hsla($hue, $saturation, $lightness, $alpha) hue($color) saturation($color) lightness($color) adjust-hue($color, $degrees) lighten($color, $amount) darken($color, $amount) saturate($color, $amount) desaturate($color, $amount) grayscale($color) complement($color) invert($color) alpha($color) / opacity($color) rgba($color, $alpha) opacify($color, $amount) / fade-in($color, $amount) transparentize($color, $amount) / fade-out($color, $amount)
  • 21. .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
  • 22. .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; }
  • 24. @mixin color($type) @if $type == chocolate color: brown @else if $type == pizza color: red @else if $type == apple color: green @else color: black .pizza +color(pizza)
  • 26. @for $i from 1 through 3 .item-#{$i} width: 1em + $i .item-1 { width: 2em; } .item-2 { width: 3em; } .item-3 { width: 4em; }
  • 27. @each
  • 28. @each $color in red, green, gray .theme-#{$color} background: $color .theme-red{ background: red; } .theme-green{ background: green; } .theme-gray{ background: gray; }
  • 30. master.sass @import “main.sass” @import “index.sass” @import “profile.sass” master.css main.css + index.css + profile.css
  • 34. .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; }
  • 35. Box-shadow .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; }
  • 36. Градиенты .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); }
  • 37. .beauty-box +border-radius(25px) +box-shadow(0 0 4px #ccc) +background-image(linear-gradient(#fff, #ccc 30%, #bbb 70%, #aaa)) .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(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); }
  • 38. Еще примеси Background Clip Background Origin Background Size Box Box Sizing Columns Clearfix Font Face Inline Block Opacity Transition Transform
  • 41. fb.png vk.png twi.png $sprite: sprite-map("ico/*.png") .fb background: sprite($sprite, fb) .vk background: sprite($sprite, vk) .twi background: sprite($sprite, twi)
  • 42. 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; }
  • 43. .basebox background: inline-image("pic.png") .basebox { background: url('data:image/png;base64,1UcAAA...AASUVORK5CYII='); }
  • 44. Config.rb # 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
  • 45. Установка Windows 1. http://rubyinstaller.org/downloads/ 2. gem install haml 3. gem install haml/edge 4. gem install compass Mac 1. gem install haml 2. gem install haml/edge 3. gem install compass Linux 1. sudo apt-get install ruby 2. gem install haml 3. gem install haml/edge 4. gem install compass
  • 46. Как это работает compass create <projectname> - создает compass-проект compass watch - следит за изменениями в sass-файлах и сразу компилирует их в css
  • 48. Спасибо Вопросы? @lazio_od sd@evilmartians.com www.evilmartians.ru Дыниовский Сергей

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n