SlideShare a Scribd company logo
1 of 46
Download to read offline
crazy
sassy
THE BASICS
Heh.
box model
positioning
pseudo elements
vendor prefixes
avoid !important
.classes
responsive design
specificity
CSS
compiling
nesting
variables
&
mixins
extends
functions
DRY
SASS
lists
sass maps
recursion
@while
@if
@for
@at-root
!global
CSS SASS
box model
positioning
pseudo elements
vendor prefixes
avoid !important
.classes
responsive design
OOCSS
compiling
nesting
variables
&
mixins
extends
functions
DRY
lists
sass maps
recursion
@while
@if
@for
@at-root
!global
GRUNT CODEKIT
TERMINAL GIT/SVN
AUTOPREFIXER
FILE STRUCTURE
ICON FONTS
SVG
BROWSER TESTING
COMPASS
WEB FONTS
VAGRANT MAMP
CSS ANIMATIONS
INTURNAT
EXLPUOR
BOURBON
BUS FACTOR
Total number of devs who would need
to be incapacitated to **** a project.
NORMALLY, BUS
FACTOR ONE IS BAD.
EXCEPT FOR TODAY.
MICHAEL ARESTAD
@michaelarestad
DRY
Do not Repeat Yourself
OOCSS
Object Oriented CSS
.base__element—modifier
!
.header__nav--primary
CRAZY COOL
Sane useful code.
CRAZY CRAZY
Will crash your phone.
FUNCTIONS
Only do math(s) once.
@function em($value, $context:
$root-font-size) {
@return ($value / $context * 1em);
}
COOL
padding: em(24);
padding: (24 / 16px);
COOL
@function p($number){
@return ($number * 2.5%);
}
CRAZY
m5l.co/wc-1
m5l.co/wc-2
CRAZY
SASS MAPS
Scary-looking, but useful.
$buttons:(
primary:(
background: #2ba1cb,
color: #fff,
),
secondary:(
background: #f7f7f7,
color: #555,
)
);
COOL
map-get(map-get($buttons, primary), color)
#fff
COOL
m5l.co/buttons
COOL
LOOPS!
Spit out some code!
@each $item in $button-types {
.button--#{$item} {
$button-color: map-get(map-get($buttons, $item),
background);
$button-text: map-get(map-get($buttons, $item),
color);
!
@include button($button-color, $button-text);
}
}
COOL
m5l.co/buttons
COOL
@for $i from 1 through $columns {
.span#{$i} {
width: ($spacing * $i * 1px) +
($gutter * $i) - $gutter;
}
}
COOL
m5l.co/griddy
COOL
@for $i from $start through $end {
@media all and (min-width: $i * 1px) {
.wide {
&:after {
content: " #{$i} pixels wide!";
}
}
}
}
WTF?!
m5l.co/howbig
WTF?!
EPIC MIXIN TIME
We mixin because we can.
@mixin border-radius($radius: 3px){
-webkit-border-radius: $radius;
-moz-border-radius: $radius;
border-radius: $radius;
}
MEH
Autoprefixer
m5l.co/ap
MEH
$breakpoints:(
phone: 320px,
phablet: 500px,
tablet: 768px,
desktop: 960px,
);
@mixin breakpoint($size){
@each $breakpoint, $value in $breakpoints {
@if $size == $breakpoint {
@media (max-width: map-get($breakpoints, $breakpoint)){
@content;
}
}
}
}
COOL
m5l.co/break
COOL
m5l.co/arrow
COOL
@mixin pie($a: 33) { // $a should be from 1 to 100
$p: 360 * $a / 100; // converts to percentage
@if $p <= 90 {
.slice {
transform: rotate(-90deg + $p);
!
&:after {
transform: rotate(90deg - $p);
}
}
} @elseif $p <= 180 {
.slice,
.slice:after {
// Resets slices. Delete if pie doesn't change.(hover, etc.)
transform: rotate(0);
}
.slice:nth-child(2) {
transform: rotate(-90deg + $p);
}
} @elseif $p <= 270 {
CRAZY
m5l.co/pie
CRAZY
RECAP
Use functions for math(s)
Use Sass maps where they make sense
Use loops carefully
Use mixins for epic hunks of code, not prefixes
THANK YOU!
@michaelarestad
QUESTIONS?
@michaelarestad

More Related Content

Viewers also liked

Pomeranian teacups
Pomeranian teacupsPomeranian teacups
Pomeranian teacupsCashmagnet
 
Very realistic hand printed照片级的动物手绘插画
Very realistic hand printed照片级的动物手绘插画Very realistic hand printed照片级的动物手绘插画
Very realistic hand printed照片级的动物手绘插画He Yan
 
Interesting Photos
Interesting PhotosInteresting Photos
Interesting PhotosRenny
 
I Think...God Knew...
I Think...God Knew...I Think...God Knew...
I Think...God Knew...Anna *
 
Fine Art Photos
Fine Art PhotosFine Art Photos
Fine Art Photosmveissid
 
Funny class pic
Funny class picFunny class pic
Funny class picgrade5a
 
Love Sayings
Love SayingsLove Sayings
Love SayingsAnna *
 
Quotes, Sayings, Ditties, don't you just love them
Quotes, Sayings, Ditties, don't you just love themQuotes, Sayings, Ditties, don't you just love them
Quotes, Sayings, Ditties, don't you just love themLynne Carlson
 
Luna Merche
Luna MercheLuna Merche
Luna MercheRenny
 
Funny images Gallery - gif-king.com
Funny images Gallery - gif-king.comFunny images Gallery - gif-king.com
Funny images Gallery - gif-king.comKumiko Kurosu
 
Embarrassing Sitiation
Embarrassing SitiationEmbarrassing Sitiation
Embarrassing Sitiationdraco2111
 
Pictures of a pomeranian dog
Pictures of a pomeranian dogPictures of a pomeranian dog
Pictures of a pomeranian dogCashmagnet
 
Funny images
Funny imagesFunny images
Funny imagesNikos
 

Viewers also liked (14)

Pomeranian teacups
Pomeranian teacupsPomeranian teacups
Pomeranian teacups
 
Very realistic hand printed照片级的动物手绘插画
Very realistic hand printed照片级的动物手绘插画Very realistic hand printed照片级的动物手绘插画
Very realistic hand printed照片级的动物手绘插画
 
Interesting Photos
Interesting PhotosInteresting Photos
Interesting Photos
 
I Think...God Knew...
I Think...God Knew...I Think...God Knew...
I Think...God Knew...
 
Fine Art Photos
Fine Art PhotosFine Art Photos
Fine Art Photos
 
Funny class pic
Funny class picFunny class pic
Funny class pic
 
Visuals
VisualsVisuals
Visuals
 
Love Sayings
Love SayingsLove Sayings
Love Sayings
 
Quotes, Sayings, Ditties, don't you just love them
Quotes, Sayings, Ditties, don't you just love themQuotes, Sayings, Ditties, don't you just love them
Quotes, Sayings, Ditties, don't you just love them
 
Luna Merche
Luna MercheLuna Merche
Luna Merche
 
Funny images Gallery - gif-king.com
Funny images Gallery - gif-king.comFunny images Gallery - gif-king.com
Funny images Gallery - gif-king.com
 
Embarrassing Sitiation
Embarrassing SitiationEmbarrassing Sitiation
Embarrassing Sitiation
 
Pictures of a pomeranian dog
Pictures of a pomeranian dogPictures of a pomeranian dog
Pictures of a pomeranian dog
 
Funny images
Funny imagesFunny images
Funny images
 

Similar to Crazy sassy

Stop your share point css become a di-sass-ter today - SPS Munich
Stop your share point css become a di-sass-ter today - SPS MunichStop your share point css become a di-sass-ter today - SPS Munich
Stop your share point css become a di-sass-ter today - SPS MunichStefan Bauer
 
Authoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & SassAuthoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & Sasschriseppstein
 
Sass Essentials at Mobile Camp LA
Sass Essentials at Mobile Camp LASass Essentials at Mobile Camp LA
Sass Essentials at Mobile Camp LAJake Johnson
 
Create SASSy web parts in SPFx
Create SASSy web parts in SPFxCreate SASSy web parts in SPFx
Create SASSy web parts in SPFxStefan Bauer
 
SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!
SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!
SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!Stefan Bauer
 
Jina bolton - Refactoring Web Interfaces
Jina bolton - Refactoring Web InterfacesJina bolton - Refactoring Web Interfaces
Jina bolton - Refactoring Web InterfacesDevConFu
 
Create SASSY Web Parts - SPSMilan
Create SASSY Web Parts - SPSMilan Create SASSY Web Parts - SPSMilan
Create SASSY Web Parts - SPSMilan Stefan Bauer
 
CSS Workflow. Pre & Post
CSS Workflow. Pre & PostCSS Workflow. Pre & Post
CSS Workflow. Pre & PostAnton Dosov
 
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}Eric Carlisle
 
HTML Tour - Buenas prácticas en el desarrollo web
HTML Tour - Buenas prácticas en el desarrollo webHTML Tour - Buenas prácticas en el desarrollo web
HTML Tour - Buenas prácticas en el desarrollo webPlain Concepts
 
SCSS Implementation
SCSS ImplementationSCSS Implementation
SCSS ImplementationAmey Parab
 
SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockMarco Pinheiro
 
An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)Folio3 Software
 
The Modern Web, Part 2: HTML5
The Modern Web, Part 2: HTML5The Modern Web, Part 2: HTML5
The Modern Web, Part 2: HTML5David Pallmann
 
Atlanta Drupal User's Group - April 2015 - Sasstronauts: Advanced Sass Topics
Atlanta Drupal User's Group - April 2015 - Sasstronauts: Advanced Sass TopicsAtlanta Drupal User's Group - April 2015 - Sasstronauts: Advanced Sass Topics
Atlanta Drupal User's Group - April 2015 - Sasstronauts: Advanced Sass TopicsEric Sembrat
 
CSS Architecture - JSIL.pdf
CSS Architecture - JSIL.pdfCSS Architecture - JSIL.pdf
CSS Architecture - JSIL.pdfJonDan6
 
Using Sass in Your WordPress Projects
Using Sass in Your WordPress ProjectsUsing Sass in Your WordPress Projects
Using Sass in Your WordPress ProjectsJeremy Green
 

Similar to Crazy sassy (20)

Stop your share point css become a di-sass-ter today - SPS Munich
Stop your share point css become a di-sass-ter today - SPS MunichStop your share point css become a di-sass-ter today - SPS Munich
Stop your share point css become a di-sass-ter today - SPS Munich
 
Authoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & SassAuthoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & Sass
 
Sass Essentials at Mobile Camp LA
Sass Essentials at Mobile Camp LASass Essentials at Mobile Camp LA
Sass Essentials at Mobile Camp LA
 
Create SASSy web parts in SPFx
Create SASSy web parts in SPFxCreate SASSy web parts in SPFx
Create SASSy web parts in SPFx
 
[Bauer] SASSy web parts with SPFX
[Bauer] SASSy web parts with SPFX[Bauer] SASSy web parts with SPFX
[Bauer] SASSy web parts with SPFX
 
SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!
SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!
SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!
 
Jina bolton - Refactoring Web Interfaces
Jina bolton - Refactoring Web InterfacesJina bolton - Refactoring Web Interfaces
Jina bolton - Refactoring Web Interfaces
 
Beginning CSS.
Beginning CSS.Beginning CSS.
Beginning CSS.
 
Create SASSY Web Parts - SPSMilan
Create SASSY Web Parts - SPSMilan Create SASSY Web Parts - SPSMilan
Create SASSY Web Parts - SPSMilan
 
CSS Workflow. Pre & Post
CSS Workflow. Pre & PostCSS Workflow. Pre & Post
CSS Workflow. Pre & Post
 
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
 
HTML Tour - Buenas prácticas en el desarrollo web
HTML Tour - Buenas prácticas en el desarrollo webHTML Tour - Buenas prácticas en el desarrollo web
HTML Tour - Buenas prácticas en el desarrollo web
 
SCSS Implementation
SCSS ImplementationSCSS Implementation
SCSS Implementation
 
SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, Greensock
 
An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)
 
The Modern Web, Part 2: HTML5
The Modern Web, Part 2: HTML5The Modern Web, Part 2: HTML5
The Modern Web, Part 2: HTML5
 
Atlanta Drupal User's Group - April 2015 - Sasstronauts: Advanced Sass Topics
Atlanta Drupal User's Group - April 2015 - Sasstronauts: Advanced Sass TopicsAtlanta Drupal User's Group - April 2015 - Sasstronauts: Advanced Sass Topics
Atlanta Drupal User's Group - April 2015 - Sasstronauts: Advanced Sass Topics
 
CSS Architecture - JSIL.pdf
CSS Architecture - JSIL.pdfCSS Architecture - JSIL.pdf
CSS Architecture - JSIL.pdf
 
Using Sass in Your WordPress Projects
Using Sass in Your WordPress ProjectsUsing Sass in Your WordPress Projects
Using Sass in Your WordPress Projects
 
Death of a Themer
Death of a ThemerDeath of a Themer
Death of a Themer
 

Recently uploaded

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 

Recently uploaded (20)

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 

Crazy sassy