$30 off During Our Annual Pro Sale. View Details »
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
78
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.3k
Trust & Teams: 2019 Chicago CTO Summit
rmw
2
330
Refactoring Trust on Your Team (CTO Summit 2018)
rmw
1
1.4k
Trust and Teams: GORUCO 2017
rmw
0
250
Becoming an Engineer Leader Panel Intro Slide
rmw
0
320
Frameworks for Feedback (Long version) - 2016 May Self Conference
rmw
2
970
Frameworks for Feedback (2015 May - RailsConf)
rmw
1
520
Frameworks for Feedback - DevOpsDays Chicago
rmw
0
930
Tech Talk 101: Topic Generation
rmw
0
410
Other Decks in Programming
See All in Programming
AIの誤りが許されない業務システムにおいて“信頼されるAI” を目指す / building-trusted-ai-systems
yuya4
6
3.9k
Deno Tunnel を使ってみた話
kamekyame
0
230
Findy AI+の開発、運用におけるMCP活用事例
starfish719
0
1.7k
エディターってAIで操作できるんだぜ
kis9a
0
750
マスタデータ問題、マイクロサービスでどう解くか
kts
0
120
開発に寄りそう自動テストの実現
goyoki
2
1.4k
Full-Cycle Reactivity in Angular: SignalStore mit Signal Forms und Resources
manfredsteyer
PRO
0
170
Canon EOS R50 V と R5 Mark II 購入でみえてきた最近のデジイチ VR180 事情、そして VR180 静止画に活路を見出すまで
karad
0
130
メルカリのリーダビリティチームが取り組む、AI時代のスケーラブルな品質文化
cloverrose
2
360
実は歴史的なアップデートだと思う AWS Interconnect - multicloud
maroon1st
0
250
Navigation 3: 적응형 UI를 위한 앱 탐색
fornewid
1
440
[AtCoder Conference 2025] LLMを使った業務AHCの上⼿な解き⽅
terryu16
5
700
Featured
See All Featured
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
69
Making Projects Easy
brettharned
120
6.5k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
710
Typedesign – Prime Four
hannesfritz
42
2.9k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
170
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
850
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
The SEO Collaboration Effect
kristinabergwall1
0
310
Prompt Engineering for Job Search
mfonobong
0
120
The World Runs on Bad Software
bkeepers
PRO
72
12k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
97
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
30
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