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
96
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
HowAboutWe for Couples Views & Styles Patterns
in Rails
Rebecca Miller-Webster
March 27, 2013
More Decks by Rebecca Miller-Webster
See All by Rebecca Miller-Webster
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.8k
Trust & Teams: 2019 Chicago CTO Summit
rmw
2
380
Refactoring Trust on Your Team (CTO Summit 2018)
rmw
1
1.6k
Trust and Teams: GORUCO 2017
rmw
0
320
Becoming an Engineer Leader Panel Intro Slide
rmw
0
380
Frameworks for Feedback (Long version) - 2016 May Self Conference
rmw
2
1.1k
Frameworks for Feedback (2015 May - RailsConf)
rmw
1
580
Frameworks for Feedback - DevOpsDays Chicago
rmw
0
1k
Tech Talk 101: Topic Generation
rmw
0
470
Other Decks in Programming
See All in Programming
Dockerfile CMD for Node.js
grazie1999
0
120
運用ダッシュボードの設計を誰も教えてくれないのだけどみなさんどうしてるんですか? - チームに監視するという文化を根付かせるための第一歩を踏みたい -
satoshi256kbyte
1
140
バグを直したら useEffect が消えた
colorful12
3
700
freeeにおけるEvalsの実践例の紹介
freee
PRO
0
140
komatsuna「分散システムにおけるバグ分析手法」
komatsunaqa
0
270
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
710
書籍「プロフェッショナルAI駆動開発」紹介スライド
juntaromatsumoto
0
340
Android CLI
fornewid
0
230
Detecting Compromised CI with eBPF and Cilium Tetragon
lizrice
0
250
AI Engineeringは、AIプロダクトだけのものか? 〜AIがソフトウェアを作る時代の新しい当たり前〜 / No AI in your product. AI Engineering in your development.
rkaga
5
510
Building a Meta Ray-Ban display app
akkeylab
0
180
思考垂れ流し開発 ~音声入力 × AIエージェント × 開発ハーネスによる試行錯誤~
npostring
0
120
Featured
See All Featured
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.4k
How to build a perfect <img>
jonoalderson
1
5.9k
WCS-LA-2024
lcolladotor
0
800
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
440
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
400
sira's awesome portfolio website redesign presentation
elsirapls
0
340
Evolving SEO for Evolving Search Engines
ryanjones
0
260
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.1k
Statistics for Hackers
jakevdp
799
230k
Building Adaptive Systems
keathley
44
3.2k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
280
Practical Orchestrator
shlominoach
191
12k
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