SlideShare a Scribd company logo
1
Cong Pham
Product Designer @ Anduin Transactions
cong.ph — me@cong.ph
2
There are two types of people in the world
3
1.
Ones who write well thought out, awesome and
maintainable CSS, who have good night's sleep
and fun weekends.
4
2.
5
z-index: 1000000;
6
z-index: 1000000;
7
z-index: -999999;
8
z-index: -999999;
9
.homepage-promos .grid-50 {
width: 100%;
}
.homepage-promos .grid-33 {
width: 100%;
}
.homepage-promos .grid-34 {
width: 100%;
}
10
.product-tab {
height: 568px;
width: 99.753%;
}
11
.container-inner.promo-status {
float: center;
}
12
13
What the actual fuck?
C’est quoi ce bordel?
CLGT?
14
15
16
.pizza-shop {
...
}
17
.pizza-shop {
.coke {
...
}
}
18
.sandwich-shop {
...
}
Can our sandwich shop have the same styling for its coke?
19
.pizza-shop {
.coke {
...
}
}
.sandwich-shop {
.coke {
...
}
}
20
Bad reusability
Not DRY
21
Variables aren’t centralized
22
Deep nesting was insane
23
.pizza-shop {
.menu {
.drinks {
.cold-drinks {
.coke {
...
}
}
}
}
}
24
.pizza-shop .menu .drinks .cold-drinks .coke {...}
25
.pizza-shop .menu .drinks .cold-drinks .coke {...}
26
🤣😭
Turning on SCSS-linter was a
27
The lack of systematic approach
28
1. No icon system
29
2. No appropriate color system
$grey: ...;
$lighter-grey: ...;
$xtra-light-grey: ...;
$dark-grey: ...;
$darker-grey: ...;
30
3. No typographic system
31
4. No layering system (z-index)
32
5. No good naming convention
.pizza-shop-front-door-container-wrapper {...}
33
5. No good naming convention
.pizza-shop-front-door-container-wrapper {...}
34
Anduin Component Library
35
http://anduin.design/
36
37
Things are organized based on components rather than views/pages
38
.btn {...}
.card {...}
.dropdown {...}
.nav-bar {...}
.well {...}
39
An organized page for all global variables.
40
41
New naming convention
http://rscss.io/
42
.card {
...
.title {
...
}
&.-primary {
...
}
}
43
.card {
...
.title {
...
}
&.-primary {
...
}
}
44
.card {
...
.title {
...
}
&.-primary {
...
}
}
45
.card {
...
.title {
...
}
&.-primary {
...
}
}
46
<div class=“card -primary”>
<div class=“title>...</div>
</div>
47
<div class=“card -primary”>
<div class=“title>...</div>
</div>
compares to Bootstrap
<div class=“card card-primary”>
<div class=“card-title>…</div>
</div>
48
<div class=“card -primary”>
<div class=“title>...</div>
</div>
compares to Bootstrap
<div class=“card card-primary”>
<div class=“card-title>…</div>
</div>
💯💯
49
A brand new icon set
50
Icon font vs SVG icons
51
Icon font vs SVG icons
52
• Pros
• Doesn’t get pixelate
• @font-face is widely supported
• You can use CSS color property to change color
• Cons
• Browser needs to load the entire font
• Hard to update when you want to add new icons
• They don’t work like you want them to
• Dealing with all the font’s properties isn’t pleasant
• Browser fallback on missing glyphs looks ugly
• Emojis are cooler nowadays
Icon font
53
• Pros
• Doesn’t pixelate
• Extensive customizations
• Behave & render correctly
• Browser will only need to load the chosen SVG rather than the entire
sprite
• XLINK:HREF is awesome
• Updating new icons is super easy (Grunt)
• Cons
• XLINK:HREF doesn’t work on IE.
SVG icons
54
• Pros
• Doesn’t pixelate
• Extensive customizations
• Behave & render correctly
• Browser will only need to load the chosen SVG rather than the entire
sprite
• XLINK:HREF is awesome
• Updating new icons is super easy (Grunt)
• Cons
• XLINK:HREF doesn’t work on IE.
SVG icons
55
• Pros
• Doesn’t pixelate
• Extensive customizations
• Behave & render correctly
• Browser will only need to load the chosen SVG rather than the entire
sprite
• XLINK:HREF is awesome
• Updating new icons is super easy (Grunt)
• Cons
• XLINK:HREF doesn’t work on IE.
SVG icons
56
A new z-index scale
57
// The z-index scale
$z-index-1: 100;
$z-index-2: 200;
$z-index-3: 300;
$z-index-4: 400;
$z-index-5: 500;
$z-index-6: 600;
$z-index-7: 700;
$z-index-8: 800;
$z-index-9: 900;
$z-index-10: 1000;
58
// z-index 2
$z-index-calendar-dropdown: $z-index-2;
$z-index-dropdown-list: $z-index-2;
$z-index-hover-color-scheme: $z-index-2;
$z-index-modal-content: $z-index-2;
// z-index 3
$z-index-datepicker-field: $z-index-3;
$z-index-dropdown-field: $z-index-3;
59
Better set of Utils classes
60
Last but not least, great documentation.
61
62
63
• Nicer, cleaner and maintainable CSS codebase
• Better for development
• Better for prototyping new products
• Engineers can now do simple layout adjustments
without asking a designer for help
• This acts as our UI style guide as well -> easier to
onboard new hires
64
65
More components
66
More components
67
68
blueprintjs.com
69
New ACL will include a library of different master layouts
70
Modular CSS
Involve engineers in the development of ACL’s next version
71
Further unifying and making UX patterns more consistent across all products
72
http://anduin.design/
73
74

More Related Content

Viewers also liked (8)

PDF
Breaking the Server-Client Divide with Node.js and React
Dejan Glozic
 
PDF
Introduction to React Native & Redux
Barak Cohen
 
PPT
Get MEAN! Node.js and the MEAN stack
Nicholas McClay
 
PPTX
TDC2016SP - Trilha Frameworks JavaScript
tdc-globalcode
 
PDF
Using ReactJS in AngularJS
Boris Dinkevich
 
PDF
Backbone.js with React Views - Server Rendering, Virtual DOM, and More!
Ryan Roemer
 
PPT
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
MongoDB
 
PDF
The Evolution of Airbnb's Frontend
Spike Brehm
 
Breaking the Server-Client Divide with Node.js and React
Dejan Glozic
 
Introduction to React Native & Redux
Barak Cohen
 
Get MEAN! Node.js and the MEAN stack
Nicholas McClay
 
TDC2016SP - Trilha Frameworks JavaScript
tdc-globalcode
 
Using ReactJS in AngularJS
Boris Dinkevich
 
Backbone.js with React Views - Server Rendering, Virtual DOM, and More!
Ryan Roemer
 
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
MongoDB
 
The Evolution of Airbnb's Frontend
Spike Brehm
 

Similar to Grokking TechTalk #16: F**k bad CSS (20)

PPTX
Emperors new clothes_digitalbarn_output_snakk
kevinjohngallagher
 
PPTX
Emperors new clothes - digitalbarn2012
kevinjohngallagher
 
KEY
Responsive web-design
Michael Grundkötter
 
PPTX
FITC - 2012-04-23 - Responsive Web Design
Frédéric Harper
 
PPTX
A Holistic Approach to HTML5 Game Design & Development
Karl Bunyan
 
PPTX
Kevinjohn Gallagher's: Emperors new clothes (WordUp Glasgow 2012)
kevinjohngallagher
 
PDF
6 Things to Think About Before Building Your Website
Floown
 
PPTX
Emperors new clothes_jab
kevinjohngallagher
 
KEY
The web standards gentleman: a matter of (evolving) standards)
Chris Mills
 
KEY
HTML5, CSS3, and other fancy buzzwords
Mo Jangda
 
PDF
responsive awareness
onehundred_be
 
PDF
Responsive Web Design, the secret sauce - MSDEVMTL - 2016-01-25
Frédéric Harper
 
PDF
CSS3: Using media queries to improve the web site experience
Zoe Gillenwater
 
PDF
Responsive Web Design: the secret sauce - JavaScript Open Day Montreal - 2015...
Frédéric Harper
 
KEY
RWD in the Wild
Rich Quick
 
PDF
[WebVisions 2010] CSS3 Workshop (Afternoon)
Christopher Schmitt
 
PDF
CSS3 3D Workshop
Christopher Schmitt
 
PDF
Quo vadis, JavaScript? Devday.pl keynote
Christian Heilmann
 
KEY
Designing in the Browser - Mason Wendell, Drupaldelphia
canarymason
 
PDF
TechUG Glasgow talk 22/Feb/17 Configuration Management Best Practices
Dag Sonstebo
 
Emperors new clothes_digitalbarn_output_snakk
kevinjohngallagher
 
Emperors new clothes - digitalbarn2012
kevinjohngallagher
 
Responsive web-design
Michael Grundkötter
 
FITC - 2012-04-23 - Responsive Web Design
Frédéric Harper
 
A Holistic Approach to HTML5 Game Design & Development
Karl Bunyan
 
Kevinjohn Gallagher's: Emperors new clothes (WordUp Glasgow 2012)
kevinjohngallagher
 
6 Things to Think About Before Building Your Website
Floown
 
Emperors new clothes_jab
kevinjohngallagher
 
The web standards gentleman: a matter of (evolving) standards)
Chris Mills
 
HTML5, CSS3, and other fancy buzzwords
Mo Jangda
 
responsive awareness
onehundred_be
 
Responsive Web Design, the secret sauce - MSDEVMTL - 2016-01-25
Frédéric Harper
 
CSS3: Using media queries to improve the web site experience
Zoe Gillenwater
 
Responsive Web Design: the secret sauce - JavaScript Open Day Montreal - 2015...
Frédéric Harper
 
RWD in the Wild
Rich Quick
 
[WebVisions 2010] CSS3 Workshop (Afternoon)
Christopher Schmitt
 
CSS3 3D Workshop
Christopher Schmitt
 
Quo vadis, JavaScript? Devday.pl keynote
Christian Heilmann
 
Designing in the Browser - Mason Wendell, Drupaldelphia
canarymason
 
TechUG Glasgow talk 22/Feb/17 Configuration Management Best Practices
Dag Sonstebo
 
Ad

More from Grokking VN (20)

PDF
Grokking Techtalk #46: Lessons from years hacking and defending Vietnamese banks
Grokking VN
 
PDF
Grokking Techtalk #45: First Principles Thinking
Grokking VN
 
PDF
Grokking Techtalk #42: Engineering challenges on building data platform for M...
Grokking VN
 
PDF
Grokking Techtalk #43: Payment gateway demystified
Grokking VN
 
PPTX
Grokking Techtalk #40: Consistency and Availability tradeoff in database cluster
Grokking VN
 
PPTX
Grokking Techtalk #40: AWS’s philosophy on designing MLOps platform
Grokking VN
 
PDF
Grokking Techtalk #39: Gossip protocol and applications
Grokking VN
 
PDF
Grokking Techtalk #39: How to build an event driven architecture with Kafka ...
Grokking VN
 
PDF
Grokking Techtalk #38: Escape Analysis in Go compiler
Grokking VN
 
PPTX
Grokking Techtalk #37: Data intensive problem
Grokking VN
 
PPTX
Grokking Techtalk #37: Software design and refactoring
Grokking VN
 
PDF
Grokking TechTalk #35: Efficient spellchecking
Grokking VN
 
PDF
Grokking Techtalk #34: K8S On-premise: Incident & Lesson Learned ZaloPay Mer...
Grokking VN
 
PDF
Grokking TechTalk #33: High Concurrency Architecture at TIKI
Grokking VN
 
PDF
Grokking TechTalk #33: Architecture of AI-First Systems - Engineering for Big...
Grokking VN
 
PDF
SOLID & Design Patterns
Grokking VN
 
PDF
Grokking TechTalk #31: Asynchronous Communications
Grokking VN
 
PDF
Grokking TechTalk #30: From App to Ecosystem: Lessons Learned at Scale
Grokking VN
 
PDF
Grokking TechTalk #29: Building Realtime Metrics Platform at LinkedIn
Grokking VN
 
PDF
Grokking TechTalk #27: Optimal Binary Search Tree
Grokking VN
 
Grokking Techtalk #46: Lessons from years hacking and defending Vietnamese banks
Grokking VN
 
Grokking Techtalk #45: First Principles Thinking
Grokking VN
 
Grokking Techtalk #42: Engineering challenges on building data platform for M...
Grokking VN
 
Grokking Techtalk #43: Payment gateway demystified
Grokking VN
 
Grokking Techtalk #40: Consistency and Availability tradeoff in database cluster
Grokking VN
 
Grokking Techtalk #40: AWS’s philosophy on designing MLOps platform
Grokking VN
 
Grokking Techtalk #39: Gossip protocol and applications
Grokking VN
 
Grokking Techtalk #39: How to build an event driven architecture with Kafka ...
Grokking VN
 
Grokking Techtalk #38: Escape Analysis in Go compiler
Grokking VN
 
Grokking Techtalk #37: Data intensive problem
Grokking VN
 
Grokking Techtalk #37: Software design and refactoring
Grokking VN
 
Grokking TechTalk #35: Efficient spellchecking
Grokking VN
 
Grokking Techtalk #34: K8S On-premise: Incident & Lesson Learned ZaloPay Mer...
Grokking VN
 
Grokking TechTalk #33: High Concurrency Architecture at TIKI
Grokking VN
 
Grokking TechTalk #33: Architecture of AI-First Systems - Engineering for Big...
Grokking VN
 
SOLID & Design Patterns
Grokking VN
 
Grokking TechTalk #31: Asynchronous Communications
Grokking VN
 
Grokking TechTalk #30: From App to Ecosystem: Lessons Learned at Scale
Grokking VN
 
Grokking TechTalk #29: Building Realtime Metrics Platform at LinkedIn
Grokking VN
 
Grokking TechTalk #27: Optimal Binary Search Tree
Grokking VN
 
Ad

Recently uploaded (20)

PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 

Grokking TechTalk #16: F**k bad CSS

Editor's Notes

  • #2: Self introduction Apologize for being a designer Ask who’s in the venue write CSS daily? How did I get involved in this talk? Company party.
  • #3: What is bad CSS? I will try to show you bad CSS with the following images and examples.
  • #6: Oh Peter…I think this is quite related to many of us. Here’s an example
  • #7: Search for this on Github, there’s almost 300,000 cases like this…
  • #8: I don’t think the distance from the Moon to the Earth is higher than this
  • #9: Holy shit. I’m in hell.
  • #11: Because all grids were created equal.
  • #12: Let me try with 99%. Hmm that works. How about 99.75%? Wow, still works, let’s try 99.76%. Oops that didn’t work. Let’s compromise on 99.753%.
  • #13: I’m speechless. Fuck the spec, I’m writing my own shit.
  • #15: To sum up what’s bad CSS, here’s a nice joke from Thomas Fuchs
  • #17: So what are some of the problems we faced at Anduin?
  • #18: Wrapping of elements in a giant/custom class for a specific view/page. Let’s say we have a view called pizza-shop. We’d create a file name pizza-shop. The first class that wraps everything is .pizza-shop.
  • #19: Now. In this shop we have coke that needs styling. So we add .coke
  • #20: Let’s say along the line of product development, we have a new sandwich shop. And it also offers coke. And all cokes are the same. Unless you have some Chinese cokes. Which you shouldn’t have, seriously. That shit is poison.
  • #21: Now, the bad and lazy way of doing this is copy what’s in .coke for pizza-shop over to sandwich-shop. Hoping to pass the code reviewer, he turned out to be lazy and sympathize with you. He’ll let you off the hook this time. But this is a problem because…
  • #23: We used to declare variables at the beginning of the files. Some values aren’t even in variables.
  • #24: Use SCSS they say, its nesting feature is awesome they say. And we were like, hell yea! Which ended up with something like this…
  • #25: …and the outputted CSS looks like this…
  • #27: laugh now, cry later.
  • #28: We turned on SCSS linter. And I was the new guy so I had to do the cleaning up job. And this picture was exactly what happened to me…
  • #32: I won’t get into as this is more on the design side of things.
  • #33: When something didn’t layer right, we would try z-index: 2. Oh that didn’t work, let’s try 3, then 4, then “n” until it actually looks alright
  • #35: We needed some rules to prevent this from happening. All of these problems resulted in something that I’m eager to present to you today…
  • #36: Introducing Anduin Component Library or ACL. Let me show you what is it
  • #37: …The URL was anduin.design for those who wants to check it out by themselves. But please do that at the end of the talk please hehe
  • #40: Remember the .coke example? Now .coke itself is a component and its styles can be reuse everywhere that needs a coke.
  • #41: We have a section on ACL site to show all the variables.
  • #42: Clever.
  • #50: I’m not even going to mention BEM, those ugly hyphens and underscores…
  • #51: You can see them in Icons section on the site. I’m going to talk a bit about this though.
  • #53: We started with an icon font we made ourselves, but then switched to SVG icons later that year. Here’s why.
  • #61: Show margin and padding
  • #66: We’re working hard on the next version of ACL and here are what to expect.
  • #69: Palantir’s BlueprintJS is a kick ass component library that was released a few months back. They’ve done a great job and we want ACL to be like that, even better.
  • #70: again, this is a more design-centric topic, won’t discuss here.
  • #71: Make ACL’s utils more modular. Engineers can use these classes in HTML easily. This means less CSS will be written -> less headache.
  • #72: ACL1.0 was a project from Design team. We’re hoping that this time, some engineers will also contribute on this, especially in providing these stateful components.
  • #73: An example of this could be, an upload component should work the same way across all products. Before it looks the same but might not work the same.
  • #74: Once again here’s the link to the site. And this also concludes my talk today. Thank you.