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
HowAboutWe for Couples Views & Styles Patterns
Search
Rebecca Miller-Webster
March 27, 2013
Programming
0
68
HowAboutWe for Couples Views & Styles Patterns
in Rails
Rebecca Miller-Webster
March 27, 2013
Tweet
Share
More Decks by Rebecca Miller-Webster
See All by Rebecca Miller-Webster
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3k
Trust & Teams: 2019 Chicago CTO Summit
rmw
2
290
Refactoring Trust on Your Team (CTO Summit 2018)
rmw
1
1.4k
Trust and Teams: GORUCO 2017
rmw
0
240
Becoming an Engineer Leader Panel Intro Slide
rmw
0
300
Frameworks for Feedback (Long version) - 2016 May Self Conference
rmw
2
910
Frameworks for Feedback (2015 May - RailsConf)
rmw
1
490
Frameworks for Feedback - DevOpsDays Chicago
rmw
0
910
Tech Talk 101: Topic Generation
rmw
0
380
Other Decks in Programming
See All in Programming
童醫院敏捷轉型的實踐經驗
cclai999
0
190
[初登壇@jAZUG]アプリ開発者が気になるGoogleCloud/Azure+wasm/wasi
asaringo
0
130
アンドパッドの Go 勉強会「 gopher 会」とその内容の紹介
andpad
0
260
GoのGenericsによるslice操作との付き合い方
syumai
3
690
LINEヤフー データグループ紹介
lycorp_recruit_jp
0
890
GitHub Copilot and GitHub Codespaces Hands-on
ymd65536
1
120
Result型で“失敗”を型にするPHPコードの書き方
kajitack
4
380
なぜ「共通化」を考え、失敗を繰り返すのか
rinchoku
1
510
Blazing Fast UI Development with Compose Hot Reload (droidcon New York 2025)
zsmb
1
220
Beyond Portability: Live Migration for Evolving WebAssembly Workloads
chikuwait
0
390
Railsアプリケーションと パフォーマンスチューニング ー 秒間5万リクエストの モバイルオーダーシステムを支える事例 ー Rubyセミナー 大阪
falcon8823
4
950
なんとなくわかった気になるブロックテーマ入門/contents.nagoya 2025 6.28
chiilog
1
210
Featured
See All Featured
Site-Speed That Sticks
csswizardry
10
660
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
Git: the NoSQL Database
bkeepers
PRO
430
65k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Intergalactic Javascript Robots from Outer Space
tanoku
271
27k
BBQ
matthewcrist
89
9.7k
Gamification - CAS2011
davidbonilla
81
5.3k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.4k
Designing for humans not robots
tammielis
253
25k
A better future with KSS
kneath
239
17k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Transcript
Overview of Couples Views/Styles HowAboutWe Server 1 pointer March 26,
2013
• logic in views is harder to test • views
are difficult to reason about Problem: Our Views are messy WTF is happening here??
Fix #0: SASS and View Styleguide! https://github.com/howaboutwe/sass-style-guide
NOT DESIGN Markup is about content
None
Use SASS THE GOOD PARTS
None
Variables are your friend
Mixin it up ... WITH
Decorators & Helpers WHEN SHIT GETS COMPLICATED
Decorators Logic moves with the OBJECT Helpers Logic moves with
the VIEW
Move logic out of views When • if statements •
ternary • lots of states • It hurts my head Then Generate in (testable) code • Classes • Copy • Html attributes
This
TO
How?
Generate classes
Move classes up
None
Generate Copy
Encapsulate repetition in partials Sometimes zero Sometimes one Sometimes two
None
Generate html attributes From TO WITH
Our current pattern • Use & enforce styleguide for SASS
& views • Markup is about content not design • Use SASS ◦ variables ◦ mixins • Move classes up & design changes to CSS • Use decorators (or helpers) to: ◦ Generate classes ◦ Generate copy ◦ Generate HTML attributes