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
79
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
35
3.4k
Trust & Teams: 2019 Chicago CTO Summit
rmw
2
330
Refactoring Trust on Your Team (CTO Summit 2018)
rmw
1
1.5k
Trust and Teams: GORUCO 2017
rmw
0
270
Becoming an Engineer Leader Panel Intro Slide
rmw
0
330
Frameworks for Feedback (Long version) - 2016 May Self Conference
rmw
2
980
Frameworks for Feedback (2015 May - RailsConf)
rmw
1
530
Frameworks for Feedback - DevOpsDays Chicago
rmw
0
950
Tech Talk 101: Topic Generation
rmw
0
420
Other Decks in Programming
See All in Programming
例外処理とどう使い分ける?Result型を使ったエラー設計 #burikaigi
kajitack
16
6.1k
dchart: charts from deck markup
ajstarks
3
990
QAフローを最適化し、品質水準を満たしながらリリースまでの期間を最短化する #RSGT2026
shibayu36
2
4.4k
余白を設計しフロントエンド開発を 加速させる
tsukuha
7
2.1k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
590
FOSDEM 2026: STUNMESH-go: Building P2P WireGuard Mesh Without Self-Hosted Infrastructure
tjjh89017
0
170
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
310
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
390
開発者から情シスまで - 多様なユーザー層に届けるAPI提供戦略 / Postman API Night Okinawa 2026 Winter
tasshi
0
200
AI巻き込み型コードレビューのススメ
nealle
2
400
コントリビューターによるDenoのすゝめ / Deno Recommendations by a Contributor
petamoriken
0
200
ノイジーネイバー問題を解決する 公平なキューイング
occhi
0
110
Featured
See All Featured
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
210
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
640
Code Review Best Practice
trishagee
74
20k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
54
Game over? The fight for quality and originality in the time of robots
wayneb77
1
120
Docker and Python
trallard
47
3.7k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
83
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.1k
Paper Plane
katiecoart
PRO
0
46k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
730
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
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