Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Sass: An Introduction
Search
Stuart Robson
January 08, 2014
Programming
280
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Sass: An Introduction
These are the slides I used in my workshop at The Founder Hub on the 8th of January 2014
Stuart Robson
January 08, 2014
More Decks by Stuart Robson
See All by Stuart Robson
L-I-V-I-N
sturobson
2
720
A Modern Sass Artchitecture
sturobson
11
2.2k
A Modern Sass Architecture
sturobson
7
510
Cutting Edge Sass - Sass Summit 2014
sturobson
5
480
100% Pure Sass
sturobson
1
320
Make Your Code Delicious - From the Front, Italy 2014
sturobson
4
1.4k
Freelancing: One year done.
sturobson
0
1.4k
Sass: a whistle stop tour
sturobson
1
870
make your code delicious
sturobson
2
740
Other Decks in Programming
See All in Programming
軽量Java基盤の設計 DIコンテナに頼らない、長期保守と1秒起動の実現 JJUG CCC 2026 Spring
macha64
0
540
AIで効率化できた業務・日常
ochtum
0
140
LLM本来の能力を解き放つサンドボックス技術とAI民主化への適用
yukukotani
3
4.3k
ローカルLLMを使ってB2Bサービスを作っていての学び
yaotti
0
200
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
590
Composerを使ったサプライチェーン攻撃の様子を眺めてみる #phpstudy
o0h
PRO
2
250
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
560
ふつうのFeature Flag実践入門
irof
8
4k
AI 輔助遺留系統現代化的經驗分享
jame2408
1
760
Vite+ Unified Toolchain for the Web
naokihaba
0
320
C# and C++ Interoperability - cho-dotnetnew
harukasao
0
260
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
21
6.7k
Featured
See All Featured
First, design no harm
axbom
PRO
2
1.2k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
290
Design in an AI World
tapps
1
250
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
It's Worth the Effort
3n
188
29k
Visualization
eitanlees
152
17k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
370
Git: the NoSQL Database
bkeepers
PRO
432
67k
Speed Design
sergeychernyshev
33
1.9k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Documentation Writing (for coders)
carmenintech
77
5.4k
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
Transcript
Sass: An Introduction Founder’s Hub, Cardiff. January 2014
About Me. Stuart Robson ! front-end developer ! rwdcalc.com SassnotSASS.com
! Sassifaction
A small caveat I don’t know _everything_
What is Sass?
Syntactically Awesome Stylesheets A pre-processor making CSS fun again.! Hampton
Catlin created it in 2006 to work along side HAML! Nathan Weizenbaum began to assist and develop it late 2006! Chris Epstein committed the first version of Compass in Autumn 2008
Alternatives to Sass
The Tale of Two Syntaxes
Sass
SCSS
Installing Sass… PrePros
None
Your First Sass file
CSS and Sass commenting ‘CSS’ style comments are retained unless
:compressed Unless you write - /*! comment */
Sass > CSS compile options :nested :expanded :compact :compressed
@import In CSS In Sass
None
So, what can Sass do?
$variables what could we use it for?
The Facebook Blue Declared 261 times throughout all stylesheets! Imagine
if Zuck wanted to change the shade? #3B5998
None
Webfonts with easy fallbacks
None
Border Radius Margin Media Queries Border Padding
Nesting
Don’t follow DOM
3 levels deep When nesting your Sass, don’t go any
further than 3 levels deep helps performance (although negligible).! helps sanity when looking at your code.
Combining Selectors
The Powerful Ampersand
The Parent Selector using the &(ampersand) reference the parent selector
None
@mixins resusable code snippets! customisable but you can set default
$arguments
@mixins Make Sass write the menial bits of CSS for
you
@extend clones the attributes from a rule and adds them
to another rule! be careful, with great power comes great responsibility
@extends
Using @extend badly
%placeholders they can be @extend-ed just like existing classes or
IDs.! the @extend-ed %placeholder will be generated.! the actual %placeholder selector won’t be generated. or ‘silent classes’
%placeholders or ‘silent classes’
Functions Math Operators +, -, *, /, and %
Functions Number Functions
Functions Control Directives @if @for @each @while
Functions @for loop
Functions @each loop
Colour
@content allow you to pass anything into a mixin! I
mainly use it for media queries! could be added to the bottom of any mixin, just in case
@content
@content & media queries
@content, media queries and Internet Explorer
A CSS authoring framework
What’s in Compass CSS3 mixins! typographic rhythm! sprite generation! loads
of helpers
Lots of Sass mixins grids typographical ! stylesheet
Sass 3.3
Sass 3.3 Sourcemaps - so you can see what you’re
editing in devtools.! Improved & support! Maps support! @at-root rule