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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
390
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
610
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
590
CSC307 Lecture 03
javiergs
PRO
1
490
24時間止められないシステムを守る-医療ITにおけるランサムウェア対策の実際
koukimiura
1
100
Rust 製のコードエディタ “Zed” を使ってみた
nearme_tech
PRO
0
190
Oxlintはいいぞ
yug1224
5
1.3k
CSC307 Lecture 09
javiergs
PRO
1
840
[KNOTS 2026登壇資料]AIで拡張‧交差する プロダクト開発のプロセス および携わるメンバーの役割
hisatake
0
290
AIによるイベントストーミング図からのコード生成 / AI-powered code generation from Event Storming diagrams
nrslib
2
1.9k
2026年 エンジニアリング自己学習法
yumechi
0
140
高速開発のためのコード整理術
sutetotanuki
1
400
Featured
See All Featured
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.4k
The Spectacular Lies of Maps
axbom
PRO
1
520
Speed Design
sergeychernyshev
33
1.5k
Designing Powerful Visuals for Engaging Learning
tmiket
0
240
We Are The Robots
honzajavorek
0
160
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Become a Pro
speakerdeck
PRO
31
5.8k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
230
How to build a perfect <img>
jonoalderson
1
4.9k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.6k
Reality Check: Gamification 10 Years Later
codingconduct
0
2k
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