SlideShare a Scribd company logo
Use atomic design WTF !
@loicgoyet
Use atomic design ftw
Use atomic design ftw
Use atomic design ftw
Use atomic design ftw
atoms molecules organisms templates pages
atom example
button
molecule example
buttoninput group
organisms example
Dr. Manhattan Home - About - Contact buttoninput group
template example
Dr. Manhattan Home - About - Contact buttoninput group
Col section heading
Lorem ipsum dolor sit
amet, consectetur
adipiscing elit. Donec ut
leo non erat vehicula
aliquam. Donec lorem
tellus, rhoncus ac orci
vel, pellentesque sodales
tellus. Aenean mollis
laoreet egestas. Aliquam
finibus sem pretium est
porta consectetur. Sed
tempor scelerisque elit
quis accumsan. Morbi
sagittis lorem feugiat
blandit lobortis. Vivamus
ut tempus ligula.
Nulla dictum tellus nec
fermentum varius. Fusce
magna ex, rutrum sit
amet scelerisque nec,
cursus sit amet elit.
Interdum et malesuada
page example
Dr. Manhattan Home - About - Contact search
Welcome
Lorem ipsum dolor sit amet,
consectetur adipiscing elit.
Donec ut leo non erat vehicula
aliquam. Donec lorem tellus,
rhoncus ac orci vel, pellentesque
sodales tellus. Aenean mollis
laoreet egestas. Aliquam finibus
sem pretium est porta
consectetur. Sed tempor
scelerisque elit quis accumsan.
Morbi sagittis lorem feugiat
blandit lobortis. Vivamus ut
scalability & consistency
-Brad Frost
assembling rather than deconstructing, we’re
crafting a system right out of the gate instead of
cherry picking patterns after the fact.
button
button
padding x-axis: 1.2empadding y-axis: 0.8em
line-height: 1.2
font-size: 1.1em
border-width: 0.01em
background-color: rgb(220, 222, 224)
border-color: rgb(166, 170, 169)
button
padding x-axis: 1.2empadding y-axis: 0.8em
line-height: 1.2
font-size: 1.1em
border-width: 0.01em
background-color: rgb(220, 222, 224)
border-color: rgb(166, 170, 169)
button
tooltips
breadcrumbs
jumbotron
thumbnails
background-color: rgb(220, 222, 224)
button
tooltips
breadcrumbs
jumbotron
thumbnails
.bg-color—gray
Use atomic design ftw
<button class="bg-color--gray border-color--gray-dark color--gray-dark padding-y--08x padding-x—12x …”>
button
</button>
-previous article comment
“What about maintenability? Consistence? Markup and style decoupling? (…)
How do you enforce component reusing? Common styling rules?”
@Extends
<button class=“button”>button</button>
// scss
.button {
@extend %bg-color--gray;
@extend %border-color--gray-dark;
@extend %color--gray-dark;
@extend %padding-y--08x;
@extend %padding-x—12x;
}
// less
.button {
&:extend(.bg-color--gray);
&:extend(.border-color--gray-dark);
&:extend(.color--gray-dark);
&:extend(.padding-y--08x);
&:extend(.padding-x—12x);
}
<button class=“button”>button</button>
.bg-color--gray,
.button {
background-color: rgb(220, 222, 224);
}
.border-color--gray,
.button {
border—color: rgb(166, 170, 169);
}
…
Use atomic design ftw
@mixins
<button class=“button”>button</button>
@mixin bg-color($color) {
background-color: map-get($colors, $color);
}
.button {
@include bg-color(‘gray’);
}
<button class=“button”>button</button>
// scss
.button {
@include bg-color(‘gray’);
@include border-color(‘gray-dark’);
@include color(‘gray-dark’);
@include padding-y(0.8);
@include padding-x(1.2);
}
// less
.button {
.bg-color(‘gray’);
.border-color(‘gray-dark’);
.color(‘gray-dark’);
.padding-y(0.8);
.padding-x(1.2);
}
<button class=“button”>button</button>
.button {
background-color: rgb(220, 222, 224);
border—color: rgb(166, 170, 169);
}
.thumbnail {
background-color: rgb(220, 222, 224);
border—color: rgb(166, 170, 169);
}
@variables
<button class=“button”>button</button>
// scss
$button—padding-x: 0.8;
.button {
@include padding-x($button-padding-x);
…
}
// less
@button-padding-x: 0.8;
.button {
.padding-x(@button-padding-x);
…
}
// main.scss
$button—bg: green;
@import ‘bower_component/button/button.scss’;
// bower_component/button/button.scss
$button—bg: gray !default;
.button {
background-color: $button-bg;
…
}
// output.css
.button {
background-color: green;
}
// bower_component/button/button.scss
$button—box-shadow: false;
.button {
background-color: $button-bg;
@if $button—box-shadow {
box-shadow: $button—box-shadow;
}
}
$button-themes: (
'primary': (
'bg': blue,
'color': white,
),
'success': (
'bg': green,
'color': white,
),
) !default;
@each $theme, $properties in $button-themes {
.button--#{$theme} {
background-color: map-get($properties, 'bg');
color: map-get($properties, 'color');
}
}
Use atomic design ftw
Use atomic design ftw
Use atomic design ftw
// gulpfile.js
var inject = require('gulp-inject');
gulp.src('./main.scss')
.pipe(inject(gulp.src(‘./bower_component/button/button.scss’), {
relative: true,
name: ‘stylevendor’,
}))
.pipe(gulp.dest(‘./main.scss'));
// main.scss
/* stylevendors:scss */
@import ‘./bower_component/button/button.scss’; // written by gulp
/* endinject */
project partial import order
1. atoms
2. molecules
3. organisms
4. templates
5. pages
project partial import order
3. atoms
4. molecules
5. organisms
6. templates
7. pages
1. code helpers
2. declaration generator
architectures
• abstracts/
• base/
• vendors/
• components/
• layout/
• pages/
• themes/
main.scss
architectures
1. abstracts/
2. base/
3. vendors/
4. components/
5. layout/
6. pages/
7. themes/
➡ code helpers
➡ declaration helpers
➡ atoms
➡ molecules
➡ organisms
➡ templates
➡ pages
css good practices specificity
only classselectors (0 / 0 / 1 / 0)
Nesting Depth max : 2
css good practices specificity
// wrong
.block {
&.is-active {
.block__component {
…
}
}
}
css good practices specificity
// good
@mixin when-block-active {
.block.is-active & {
@content;
}
}
.block__component {
@include when-block-active {
…
}
}
css good practices semantic
no business-logic in selector - design hint for selector
Titre de l’actualité
If you are an infrequent traveler you may
need some tips to keep the wife happy
while you are jet setting around the globe.
Many individuals do...
Lire la suite
css good practices semantic
no business-logic in selector - design hint for selector
// wrong
.blog-item {
…
}
Titre de l’actualité
If you are an infrequent traveler you may
need some tips to keep the wife happy
while you are jet setting around the globe.
Many individuals do...
Lire la suite
css good practices semantic
no business-logic in selector - design hint for selector
// good
.thumbnail {
…
}
Titre de l’actualité
If you are an infrequent traveler you may
need some tips to keep the wife happy
while you are jet setting around the globe.
Many individuals do...
Lire la suite
css good practices declaration type
atoms molecules organisms templates pages
+++ paint
+++ layout
++ paint
++++ layout
+ paint
+++++ layout
++++ paint
++ layout
+++++ paint
+ layout
css good practices values
No Magic Numbers !
// wrong !
.grid {
@include clearfix;
margin-left: -10px;
margin-right: -10px;
}
…
.grid__col {
float: left;
padding-left: 10px;
padding-right: 10px;
}
css good practices values
No Magic Numbers !
$grid—gutter: 20px;
.grid {
@include clearfix;
margin-left: -$grid—gutter / 2;
margin-right: -$grid—gutter / 2;
}
…
.grid__col {
float: left;
padding-left: $grid—gutter / 2;
padding-right: $grid—gutter / 2;
}
css good practices values
No Magic Numbers !
$grid—gutter: 20px;
.grid {
@include clearfix;
margin-left: ceil(-$grid—gutter / 2);
margin-right: floor(-$grid—gutter / 2);
}
…
.grid__col {
float: left;
padding-left: ceil($grid—gutter / 2);
padding-right: floor($grid—gutter / 2);
}
Use atomic design ftw
@loicgoyet - @nantescss -

More Related Content

PDF
Atomic design, a problem of expectations
PDF
Atomic design
PDF
MIMA 2014 - Changing your Responsive Design Workflow
PDF
ACSS: Rethinking CSS Best Practices
PDF
React Storybook, Atomic Design, and ITCSS
PDF
Atomic Design - An Event Apart San Diego
PDF
Atomic Design con Pattern Lab
PDF
Atomic Design - BDConf Nashville, 2013
Atomic design, a problem of expectations
Atomic design
MIMA 2014 - Changing your Responsive Design Workflow
ACSS: Rethinking CSS Best Practices
React Storybook, Atomic Design, and ITCSS
Atomic Design - An Event Apart San Diego
Atomic Design con Pattern Lab
Atomic Design - BDConf Nashville, 2013

What's hot (20)

PPTX
Atomic design React Nova Presentation
PDF
Creating Style Guides with Modularity in Mind
PDF
Brad frost: Atomic design (Webdagene 2014)
PDF
Atomic Design
PDF
Data science for infrastructure dev week 2022
PPTX
An introduction to Emulsify
PDF
Beyond Squishy: The Principles of Adaptive Design
PDF
Voorhoede - Front-end architecture
PDF
Documenting an Atomic Design System with Jekyll
PDF
So…What Do I Make? (Dan Mall)
PDF
Adventures in Atomic Design
PDF
The Death of Lorem Ipsum & Pixel Perfect Content
PDF
Styleguide-Driven Development: The New Web Development
PPTX
HTML5 and Joomla! 2.5 Template
PPT
WordPress Development Confoo 2010
PPTX
SEO Before Yoast: WordCamp Rhode Island
PPTX
WordCamp Baltimore 2016
PPTX
How to Make WordPress Your Friend
PDF
role=drinks AMS Meetup: 5 Pro Tips for Making Your Email More Accessible
PDF
Stop reinventing the wheel: Build Responsive Websites Using Bootstrap
Atomic design React Nova Presentation
Creating Style Guides with Modularity in Mind
Brad frost: Atomic design (Webdagene 2014)
Atomic Design
Data science for infrastructure dev week 2022
An introduction to Emulsify
Beyond Squishy: The Principles of Adaptive Design
Voorhoede - Front-end architecture
Documenting an Atomic Design System with Jekyll
So…What Do I Make? (Dan Mall)
Adventures in Atomic Design
The Death of Lorem Ipsum & Pixel Perfect Content
Styleguide-Driven Development: The New Web Development
HTML5 and Joomla! 2.5 Template
WordPress Development Confoo 2010
SEO Before Yoast: WordCamp Rhode Island
WordCamp Baltimore 2016
How to Make WordPress Your Friend
role=drinks AMS Meetup: 5 Pro Tips for Making Your Email More Accessible
Stop reinventing the wheel: Build Responsive Websites Using Bootstrap
Ad

Viewers also liked (20)

PDF
Better. Faster. UXier. — AToMIC Design
PDF
Atomic Design - Dallas Digital Agency
PPTX
To the Pattern Lab! Better Collaboration in Drupal Using Atomic Design Princi...
PDF
Atomic design
PDF
Building an Atomic Design System
PDF
Atomic design
PDF
Фишки продвижения мобильных приложений от Netpeak
PDF
Happiest Minds Brand Journey
PDF
Introducing Malta as a Notified AIF Regime
PDF
Whitepaper: Unified Communications Solution on Communication Enabled Business...
PPTX
система обеспечения безопасности
PDF
Ставка на iBeacon. Новинки мобильной индустрии в реальной жизни
PDF
Showcode eventer pitch
PPTX
Презентация iBeacon. Что такое iBeacon и как эту технологию применять?
PPTX
LifeHackDay 2015: MOOCology
PPTX
Sonic r system
PPTX
Yuri Trukhin - IE9 Launch
PDF
Iridium idea searcher_slice&reverse_water
PDF
Adj sample invest resentation
Better. Faster. UXier. — AToMIC Design
Atomic Design - Dallas Digital Agency
To the Pattern Lab! Better Collaboration in Drupal Using Atomic Design Princi...
Atomic design
Building an Atomic Design System
Atomic design
Фишки продвижения мобильных приложений от Netpeak
Happiest Minds Brand Journey
Introducing Malta as a Notified AIF Regime
Whitepaper: Unified Communications Solution on Communication Enabled Business...
система обеспечения безопасности
Ставка на iBeacon. Новинки мобильной индустрии в реальной жизни
Showcode eventer pitch
Презентация iBeacon. Что такое iBeacon и как эту технологию применять?
LifeHackDay 2015: MOOCology
Sonic r system
Yuri Trukhin - IE9 Launch
Iridium idea searcher_slice&reverse_water
Adj sample invest resentation
Ad

Similar to Use atomic design ftw (20)

PDF
Class 4 handout two column layout w mobile web design
PPT
Nate koechley the yui css foundation
PPT
YUI Grids slides by Nate Koechley
PPT
PPT
css.ppt
PPT
HTML Web Devlopment presentation css.ppt
PDF
Juggling
PDF
Prototyping w/HTML5 and CSS3
PPTX
BOOM Performance
PPTX
YGLF 2015 - Boom Performance | Eran Zinman (daPulse)
PPT
Basic html tags
PPT
What I brought back from Austin
PDF
Building a Single Page Application using Ember.js ... for fun and profit
PPTX
session_01_react_.pptx
KEY
Slow kinda sucks
PPT
Web Scraper Shibuya.pm tech talk #8
PDF
The Backside of the Class (CSS Day 2015)
PPT
DG Group - Active Or Passive Website
ODP
IBM Lotus Notes Domino XPages and XPages for Mobile
PPT
Using a CSS Framework
Class 4 handout two column layout w mobile web design
Nate koechley the yui css foundation
YUI Grids slides by Nate Koechley
css.ppt
HTML Web Devlopment presentation css.ppt
Juggling
Prototyping w/HTML5 and CSS3
BOOM Performance
YGLF 2015 - Boom Performance | Eran Zinman (daPulse)
Basic html tags
What I brought back from Austin
Building a Single Page Application using Ember.js ... for fun and profit
session_01_react_.pptx
Slow kinda sucks
Web Scraper Shibuya.pm tech talk #8
The Backside of the Class (CSS Day 2015)
DG Group - Active Or Passive Website
IBM Lotus Notes Domino XPages and XPages for Mobile
Using a CSS Framework

Recently uploaded (20)

PPTX
Big Data Technologies - Introduction.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
cuic standard and advanced reporting.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPT
Teaching material agriculture food technology
PDF
Approach and Philosophy of On baking technology
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
NewMind AI Weekly Chronicles - August'25 Week I
Big Data Technologies - Introduction.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Empathic Computing: Creating Shared Understanding
Review of recent advances in non-invasive hemoglobin estimation
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
MYSQL Presentation for SQL database connectivity
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Chapter 3 Spatial Domain Image Processing.pdf
Encapsulation_ Review paper, used for researhc scholars
cuic standard and advanced reporting.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Teaching material agriculture food technology
Approach and Philosophy of On baking technology
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
NewMind AI Weekly Chronicles - August'25 Week I

Use atomic design ftw

  • 1. Use atomic design WTF ! @loicgoyet
  • 6. atoms molecules organisms templates pages
  • 9. organisms example Dr. Manhattan Home - About - Contact buttoninput group
  • 10. template example Dr. Manhattan Home - About - Contact buttoninput group Col section heading Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ut leo non erat vehicula aliquam. Donec lorem tellus, rhoncus ac orci vel, pellentesque sodales tellus. Aenean mollis laoreet egestas. Aliquam finibus sem pretium est porta consectetur. Sed tempor scelerisque elit quis accumsan. Morbi sagittis lorem feugiat blandit lobortis. Vivamus ut tempus ligula. Nulla dictum tellus nec fermentum varius. Fusce magna ex, rutrum sit amet scelerisque nec, cursus sit amet elit. Interdum et malesuada
  • 11. page example Dr. Manhattan Home - About - Contact search Welcome Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ut leo non erat vehicula aliquam. Donec lorem tellus, rhoncus ac orci vel, pellentesque sodales tellus. Aenean mollis laoreet egestas. Aliquam finibus sem pretium est porta consectetur. Sed tempor scelerisque elit quis accumsan. Morbi sagittis lorem feugiat blandit lobortis. Vivamus ut
  • 12. scalability & consistency -Brad Frost assembling rather than deconstructing, we’re crafting a system right out of the gate instead of cherry picking patterns after the fact.
  • 14. button padding x-axis: 1.2empadding y-axis: 0.8em line-height: 1.2 font-size: 1.1em border-width: 0.01em background-color: rgb(220, 222, 224) border-color: rgb(166, 170, 169)
  • 15. button padding x-axis: 1.2empadding y-axis: 0.8em line-height: 1.2 font-size: 1.1em border-width: 0.01em background-color: rgb(220, 222, 224) border-color: rgb(166, 170, 169)
  • 19. <button class="bg-color--gray border-color--gray-dark color--gray-dark padding-y--08x padding-x—12x …”> button </button> -previous article comment “What about maintenability? Consistence? Markup and style decoupling? (…) How do you enforce component reusing? Common styling rules?”
  • 21. <button class=“button”>button</button> // scss .button { @extend %bg-color--gray; @extend %border-color--gray-dark; @extend %color--gray-dark; @extend %padding-y--08x; @extend %padding-x—12x; } // less .button { &:extend(.bg-color--gray); &:extend(.border-color--gray-dark); &:extend(.color--gray-dark); &:extend(.padding-y--08x); &:extend(.padding-x—12x); }
  • 22. <button class=“button”>button</button> .bg-color--gray, .button { background-color: rgb(220, 222, 224); } .border-color--gray, .button { border—color: rgb(166, 170, 169); } …
  • 25. <button class=“button”>button</button> @mixin bg-color($color) { background-color: map-get($colors, $color); } .button { @include bg-color(‘gray’); }
  • 26. <button class=“button”>button</button> // scss .button { @include bg-color(‘gray’); @include border-color(‘gray-dark’); @include color(‘gray-dark’); @include padding-y(0.8); @include padding-x(1.2); } // less .button { .bg-color(‘gray’); .border-color(‘gray-dark’); .color(‘gray-dark’); .padding-y(0.8); .padding-x(1.2); }
  • 27. <button class=“button”>button</button> .button { background-color: rgb(220, 222, 224); border—color: rgb(166, 170, 169); } .thumbnail { background-color: rgb(220, 222, 224); border—color: rgb(166, 170, 169); }
  • 29. <button class=“button”>button</button> // scss $button—padding-x: 0.8; .button { @include padding-x($button-padding-x); … } // less @button-padding-x: 0.8; .button { .padding-x(@button-padding-x); … }
  • 30. // main.scss $button—bg: green; @import ‘bower_component/button/button.scss’; // bower_component/button/button.scss $button—bg: gray !default; .button { background-color: $button-bg; … } // output.css .button { background-color: green; }
  • 31. // bower_component/button/button.scss $button—box-shadow: false; .button { background-color: $button-bg; @if $button—box-shadow { box-shadow: $button—box-shadow; } }
  • 32. $button-themes: ( 'primary': ( 'bg': blue, 'color': white, ), 'success': ( 'bg': green, 'color': white, ), ) !default; @each $theme, $properties in $button-themes { .button--#{$theme} { background-color: map-get($properties, 'bg'); color: map-get($properties, 'color'); } }
  • 36. // gulpfile.js var inject = require('gulp-inject'); gulp.src('./main.scss') .pipe(inject(gulp.src(‘./bower_component/button/button.scss’), { relative: true, name: ‘stylevendor’, })) .pipe(gulp.dest(‘./main.scss')); // main.scss /* stylevendors:scss */ @import ‘./bower_component/button/button.scss’; // written by gulp /* endinject */
  • 37. project partial import order 1. atoms 2. molecules 3. organisms 4. templates 5. pages
  • 38. project partial import order 3. atoms 4. molecules 5. organisms 6. templates 7. pages 1. code helpers 2. declaration generator
  • 39. architectures • abstracts/ • base/ • vendors/ • components/ • layout/ • pages/ • themes/ main.scss
  • 40. architectures 1. abstracts/ 2. base/ 3. vendors/ 4. components/ 5. layout/ 6. pages/ 7. themes/ ➡ code helpers ➡ declaration helpers ➡ atoms ➡ molecules ➡ organisms ➡ templates ➡ pages
  • 41. css good practices specificity only classselectors (0 / 0 / 1 / 0) Nesting Depth max : 2
  • 42. css good practices specificity // wrong .block { &.is-active { .block__component { … } } }
  • 43. css good practices specificity // good @mixin when-block-active { .block.is-active & { @content; } } .block__component { @include when-block-active { … } }
  • 44. css good practices semantic no business-logic in selector - design hint for selector Titre de l’actualité If you are an infrequent traveler you may need some tips to keep the wife happy while you are jet setting around the globe. Many individuals do... Lire la suite
  • 45. css good practices semantic no business-logic in selector - design hint for selector // wrong .blog-item { … } Titre de l’actualité If you are an infrequent traveler you may need some tips to keep the wife happy while you are jet setting around the globe. Many individuals do... Lire la suite
  • 46. css good practices semantic no business-logic in selector - design hint for selector // good .thumbnail { … } Titre de l’actualité If you are an infrequent traveler you may need some tips to keep the wife happy while you are jet setting around the globe. Many individuals do... Lire la suite
  • 47. css good practices declaration type atoms molecules organisms templates pages +++ paint +++ layout ++ paint ++++ layout + paint +++++ layout ++++ paint ++ layout +++++ paint + layout
  • 48. css good practices values No Magic Numbers ! // wrong ! .grid { @include clearfix; margin-left: -10px; margin-right: -10px; } … .grid__col { float: left; padding-left: 10px; padding-right: 10px; }
  • 49. css good practices values No Magic Numbers ! $grid—gutter: 20px; .grid { @include clearfix; margin-left: -$grid—gutter / 2; margin-right: -$grid—gutter / 2; } … .grid__col { float: left; padding-left: $grid—gutter / 2; padding-right: $grid—gutter / 2; }
  • 50. css good practices values No Magic Numbers ! $grid—gutter: 20px; .grid { @include clearfix; margin-left: ceil(-$grid—gutter / 2); margin-right: floor(-$grid—gutter / 2); } … .grid__col { float: left; padding-left: ceil($grid—gutter / 2); padding-right: floor($grid—gutter / 2); }