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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
7.4k
Fragmented Architectures
denyspoltorak
0
160
dchart: charts from deck markup
ajstarks
3
990
Smart Handoff/Pickup ガイド - Claude Code セッション管理
yukiigarashi
0
140
AI & Enginnering
codelynx
0
110
インターン生でもAuth0で認証基盤刷新が出来るのか
taku271
0
190
FOSDEM 2026: STUNMESH-go: Building P2P WireGuard Mesh Without Self-Hosted Infrastructure
tjjh89017
0
170
AIによる開発の民主化を支える コンテキスト管理のこれまでとこれから
mulyu
3
340
要求定義・仕様記述・設計・検証の手引き - 理論から学ぶ明確で統一された成果物定義
orgachem
PRO
1
140
CSC307 Lecture 04
javiergs
PRO
0
660
組織で育むオブザーバビリティ
ryota_hnk
0
180
開発者から情シスまで - 多様なユーザー層に届けるAPI提供戦略 / Postman API Night Okinawa 2026 Winter
tasshi
0
200
Featured
See All Featured
Navigating Weather and Climate Data
rabernat
0
110
Information Architects: The Missing Link in Design Systems
soysaucechin
0
780
WCS-LA-2024
lcolladotor
0
450
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.6k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Done Done
chrislema
186
16k
Technical Leadership for Architectural Decision Making
baasie
1
240
Discover your Explorer Soul
emna__ayadi
2
1.1k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
140
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
sira's awesome portfolio website redesign presentation
elsirapls
0
150
The Invisible Side of Design
smashingmag
302
51k
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