$30 off During Our Annual Pro Sale. View Details »
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
140
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
390
Creating a culture of accessibility
tempertemper
0
130
Accessible form patterns – Sunderland Digital
tempertemper
0
380
Accessible user interface patterns – NUX
tempertemper
4
340
Accessible user interface patterns – Orange Bus
tempertemper
1
110
The Importance of Web Standards
tempertemper
0
200
Other Decks in Technology
See All in Technology
Playwrightのソースコードに見る、自動テストを自動で書く技術
yusukeiwaki
12
3.9k
最近のLinux普段づかいWaylandデスクトップ元年
penguin2716
1
370
タグ付きユニオン型を便利に使うテクニックとその注意点
uhyo
2
710
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
38k
M5UnifiedとPicoRubyで楽しむM5シリーズ
kishima
0
120
21st ACRi Webinar - AMD Presentation Slide (Nao Sumikawa)
nao_sumikawa
0
230
Design System Documentation Tooling 2025
takanorip
2
940
ML PM Talk #1 - ML PMの分類に関する考察
lycorptech_jp
PRO
1
610
eBPFとwaruiBPF
sat
PRO
4
2.2k
Eight Engineering Unit 紹介資料
sansan33
PRO
0
5.8k
Oracle Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
0
650
GitLab Duo Agent Platformで実現する“AI駆動・継続的サービス開発”と最新情報のアップデート
jeffi7
0
190
Featured
See All Featured
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
Speed Design
sergeychernyshev
33
1.4k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.3k
A designer walks into a library…
pauljervisheath
210
24k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
Rebuilding a faster, lazier Slack
samanthasiow
84
9.3k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Thoughts on Productivity
jonyablonski
73
5k
BBQ
matthewcrist
89
9.9k
How GitHub (no longer) Works
holman
316
140k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.8k
A Modern Web Designer's Workflow
chriscoyier
697
190k
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