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
Speedy, solid, semantic layout with Susy
Search
tempertemper
April 02, 2015
Technology
0
120
Speedy, solid, semantic layout with Susy
This talk explains how to use Sass for layout, via the powerful yet light-weight Susy library.
tempertemper
April 02, 2015
Tweet
Share
More Decks by tempertemper
See All by tempertemper
Getting started with manual accessibility testing
tempertemper
0
330
Creating a culture of accessibility
tempertemper
0
100
Accessible form patterns – Sunderland Digital
tempertemper
0
250
Accessible user interface patterns – NUX
tempertemper
4
280
Accessible user interface patterns – Orange Bus
tempertemper
1
95
The Importance of Web Standards
tempertemper
0
170
Other Decks in Technology
See All in Technology
ExaDB-XSで利用されているExadata Exascaleについて
oracle4engineer
PRO
3
230
Cracking the Coding Interview 6th Edition
gdplabs
14
28k
OPENLOGI Company Profile
hr01
0
60k
内製化を加速させるlaC活用術
nrinetcom
PRO
2
130
設計を積み重ねてシステムを刷新する
sansantech
PRO
0
160
Visualize, Visualize, Visualize and rclone
tomoaki0705
9
81k
Goで作って学ぶWebSocket
ryuichi1208
3
2.7k
ABWG2024採択者が語るエンジニアとしての自分自身の見つけ方〜発信して、つながって、世界を広げていく〜
maimyyym
1
100
LINE NEWSにおけるバックエンド開発
lycorptech_jp
PRO
0
200
ディスプレイ広告(Yahoo!広告・LINE広告)におけるバックエンド開発
lycorptech_jp
PRO
0
290
データエンジニアリング領域におけるDuckDBのユースケース
chanyou0311
8
2.1k
OCI Success Journey OCIの何が評価されてる?疑問に答える事例セミナー(2025年2月実施)
oracle4engineer
PRO
2
110
Featured
See All Featured
Dealing with People You Can't Stand - Big Design 2015
cassininazir
366
25k
Product Roadmaps are Hard
iamctodd
PRO
50
11k
Fashionably flexible responsive web design (full day workshop)
malarkey
406
66k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
10
510
GitHub's CSS Performance
jonrohan
1030
460k
Automating Front-end Workflow
addyosmani
1368
200k
Bash Introduction
62gerente
611
210k
Statistics for Hackers
jakevdp
797
220k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Building Adaptive Systems
keathley
40
2.4k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Transcript
Speedy, solid, semantic layout with Susy
Ordered list of contents 1. Reasons why Susy’s great 2.
Installation 3. Basic usage 4. Advanced usage
Layout woes • Lack of flexibility • Too many dependencies
• DIY is a headache B • Separation of concerns • Jack of all trades
Semantics <div class="col-sm-5 .col-md-6">Content</div> <div class="col-sm-5 .col-sm-offset-2 .col-md-6 .col-md- offset-0">Extra
content</div> <main class="main">Content</main> <aside>Extra content</aside>
Flexibility • 4/6/10/18 column grid? • ‘Breaking’ the grid •
Different grids for different screen-widths • Asymmetric grids
Dependencies • Can slow compilation of CSS • Increases complexity
of a project
Maths
None
Master of one • Keeps codebase light • All (layout)
bases covered
http://susy.oddbird.net/
Installation • Bower • Copy/paste .zip • Ruby Gem •
GUI (Codekit, Prepros, etc.)
Compilers • Compass () • Ruby Sass • Libsass ()
Import Susy @import "susy"; @import "../components/susy/sass/susy"; Or
Grid settings (maps) $susy: ( columns: 4, gutters: .25, math:
fluid, );
Laying out body { @include container(60em); padding-right:.5em; padding-left:.5em; } [role="banner"]
.logo { @include span(2 of 4); } [role="navigation"] { @include span(last 2 of 4); }
Overriding li { @include span(4 of 14); padding-right: .5em; padding-left:
.5em; } article li { float: none; width: auto; margin-right: 0; }
Multiple maps $default: ( columns: 4, gutters: .25, math: fluid,
gutter-position: after, ); $medium: ( columns: 6, gutters: .25, math: fluid, gutter-position: after, ); $large: ( columns: 12, gutters: .25, math: fluid, gutter-position: after, );
Breakpoints • Hand-written alongside layout context • Susy breakpoints •
Breakpoint (http://breakpoint-sass.com/)
[role="banner"] .logo { @include layout($default); @include span(2 of 4); @media
(min-width: 30em) { @include layout($medium); @include span(2 of 6); } } [role="navigation"] { @include layout($default); @include span(last 2 of 4); @media (min-width: 30em) { @include layout($medium); @include span(last 4 of 6); } }
Shorthand article { @include span(8 of 12); img { @include
span(last 4 of 8 before); } }
Gallery .gallery li { @include gallery(4 of 12); }
Loads more • Asymmetric grids • Margins and padding: pre,
post, squish, pull, prefix, suffix, bleed • Using span and gutter as a function, instead of a mixin
susydocs.oddbird.net/en/latest/toolkit/
Remind me… • Keeps markup clean • Flexible • Light-weight
• Straightforward syntax • Does one thing well
@tempertemper