SlideShare a Scribd company logo
1 of 52
Download to read offline
berlin amsterdam san francisco stuttgart
edenspiekermann_
Lessons from the FontShop
site relaunch
UpFront talk
8th July 2014
edenspiekermann_
CSS ARCHITECTURE
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
body {!
font-size: 100%;!
font-family: Georgia, serif;!
}!
!
.o-chosen-select-box.chosen-
container,.m-font-
autocomplete{display:inline-
block;position:relative;vertical-
align:middle}.o-chosen-select-
box .chosen-single,.m-font-
autocomplete__input{background-
color:#f9f8f3;color:#262626;-webkit-box-
sizing:border-box;-moz-box-sizing:border-box;box-
sizing:border-box;border:4px solid
#fff;display:block;cursor:pointer;height:2.5em;line-
height:1.25em;padding:0 2.125em;-webkit-transition:background-
color 150ms,border-color 150ms;-moz-transition:background-color
150ms,border-color 150ms;!
.l-modal__tooltip__pane{z-index:30}.o-error{z-index:10}.o-
pulldown-panel__list{z-index:10}.l-tryout-page__canvas{z-index:
1}.l-tryout-page__header{z-index:30}.m-tryout-
textblock__action{z-index:20}.m-tryout-
textblock__editable{z-index:20}.m-tryout-
textblock__placeholder{z-index:10}.m-font-
autocomplete__dropdown,.o-chosen-select-
box{z-index:40}.l-tryout-page__template-
links,.l-tryout-page__bgimage-info{z-
index:50}.l-tryout-page__meta-links{z-
index:10000}.m-tryout-template-links
—centered{z-index:10}!
!
#footer .left-column .article
ul.links > li a img {!
border-color: #0A0;!
}!
CSS Architecture
Scientifically proven fact: a developer’s attention span
gets diluted after 34.23 continuous lines of CSS code.*
3
* = Bullshit Researching Institute GmbH, 1999
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
CSS Architecture
4
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
CSS Architecture
5
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
_config/!
! extends/!
! mixins/!
! ! _colors.sass!
! ! …!
! var/!
! ! _animations.sass!
! ! …!
! _z-index.sass!
!
globals/!
! _typography.sass!
! …!
!
objects/!
! _o-button.sass!
! …!
!
modules/!
! _m-waterfalls.sass!
! …!
!
layouts/!
! _l-homepage.sass!
! …!
!
vendor/!
! _noone.reads.me.lol.sass!
! …!
!
application.sass
CSS Architecture
Structure.
– Vars, mixins under _config ensure consistency.
– Globals folder contains non-modular global styles.
– Objects folder has the smallest modular units.
– Modules are combined Objects. Sometimes not exactly
modular but mapped to content entities.
– Layouts contain only layout (duh) information such as
width, height, margin, padding.
6
edenspiekermann_
Douchebag score
Referencing yourself
in your presentation.
+1
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
CSS Architecture
8
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
CSS Architecture
9
.m-styles__families__slider__family__rail__node
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
CSS Architecture
Good things:
– Self explanatory in both HTML & CSS.
– Shields object’s scope.
!
Bad things:
– Can easily get carried away with underlines.
– Verbal classes (but you get used to it).
!
Things to remember:
– Never nest selectors (to ensure specificity == 1).
– Always & only, use classes.
10
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
CSS Architecture
11
117CSS Objects in the project
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
CSS Architecture
12
edenspiekermann_
The
form - functionality
paradox
https://www.flickr.com/photos/astrid/2583356797
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
CSS Architecture
14
1
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
CSS Architecture
15
2
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
CSS Architecture
16
3
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
CSS Architecture
17
Same Functionality ≠ Modularity
–Elements that serve the same functionality don’t have
to be the same CSS objects.
–Otherwise it’s a game of show, hide, absolute position
elements.
–More info: http://www.edenspiekermann.com/blog/
oocss-and-the-pagification-of-modules
1 2
3
Douchebag score
Sorry, did it again!+1
edenspiekermann_
Living Styleguides
Hardboiled Front End Development 10.06.2014edenspiekermann_
CSS Architecture
Requirements-Challenges:
–Auto-maintained. No duplicate views in production &
styleguide.
–CSS Refactoring at the same time, to normalise objects.
!
Advantages:
–Nice overview of all your objects.
–Enforces good practices.
–Enhances developer — designer collaboration.
–Helps you scale your project.
!
Tool:
–https://github.com/kneath/kss
19
Hardboiled Front End Development 10.06.2014edenspiekermann_
gem install kss
CSS Architecture
Setting up KSS.
– Install gem.
20
Hardboiled Front End Development 10.06.2014edenspiekermann_
@styleguides = Kss::Parser.new(“/
public/css“)!
CSS Architecture
Setting up KSS.
– Install gem.
– Parse CSS folder into an object.
21
Hardboiled Front End Development 10.06.2014edenspiekermann_
CSS Architecture
Setting up KSS.
– Install gem.
– Parse CSS folder into an object.
– Iterate object in view.
22
- @styleguides.each do |styleguide|!
- [...]!
Hardboiled Front End Development 10.06.2014edenspiekermann_
/*!
The global button object.!
!
.button - Primary button.!
.button--green - Green variation.!
!
Styleguide 1.0 Button!
*/!
!
.button {!
height: 20px;!
text-align: center;!
width: 100px;!
}!
!
.button--green {!
background-color: green;!
}!
CSS Architecture
Setting up KSS.
– Install gem.
– Parse CSS folder into an object.
– Iterate object in view.
– Use the magic KSS syntax.
23
edenspiekermann_
http://next.fontshop.com/styleguide/objects
edenspiekermann_
Sass
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
CSS Architecture
26
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ 27
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ 28
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
.o-logo__block--left!
+fs-color(secondary, background-color)!
CSS Architecture
Using Sass to create themes:
– Too much labor to create theme variations for each
selector.
– Created Sass function to do that automatically.
!
Problems:
– Specificity issues in overriding styles (trying to
convince myself that using “!important” is ok).
– Slow compilation times.
29
body.theme--white .o-logo__block--left {!
background-color: yellow;!
}!
body.theme--yellow .o-logo__block--left {!
background-color: white;!
}!
body.theme--black .o-logo__block--left{!
background-color: yellow;!
}!
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
CSS Architecture
30
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
CSS Architecture
31
~12secCSS loading time during development
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
CSS Architecture
32
~12secCSS loading time during development
On a frickin’ 2.8Ghz, 16GB Ram, SSD Machine.
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
CSS Architecture
Tips:
– Helpful to prefix classes (“o-“, “l-“, “m-“), that way you recognize their
type in markup.
– Prefix JS hooks with “js-“. That way HTML/CSS restructuring doesn’t
affect javascript functionality.
– Put all rushed code in shame.css. Always write reason of inclusion in
comments.
– Keep all z-index values in z-index.css and always use increments of 10 or
more.
33
edenspiekermann_
JAVASCRIPT
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
Javascript Modules
35
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
Javascript Modules
36
AMD FTW!
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
Javascript Modules
37
AMD FTW!Module Structure
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
Javascript Modules
38
AMD FTW!Module Structure r.js wrapper -> .min.js
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
Javascript Modules
39
AMD FTW!Module Structure r.js wrapper -> .min.js
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
Javascript Modules
40
AMD FTW!Module Structure r.js wrapper -> .min.js
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
Javascript Modules
41
AMD FTW!Module Structure r.js wrapper -> .min.js?
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
Javascript Modules
42
AMD FTW!Module Structure r.js wrapper -> .min.js?
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
Javascript Modules
43
AMD FTW!Module Structure r.js wrapper -> .min.js?
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
Javascript Modules
44
AMD FTW!Module Structure r.js wrapper -> .min.js
HAHAHAHA!
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
Javascript Modules
45
AMD FTW!Module Structure r.js wrapper -> .min.js
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
Javascript Modules
46
Module Structure r.js wrapper -> .min.js
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
Javascript Modules
47
Module Structure
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
Javascript Modules
48
//= require xxx.js
//= require_tree /js/JS Modules
Tryout
Site
Buy
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
//= require jquery!
!
(function (win) {!
!
var GlobalLikes = {};!
!
GlobalLikes = Backbone.View.extend({!
!
initialize: function () {!
this.options = _.extend({}, !
this.defaults, this.$el.data());!
this.getLikes();!
},!
! !
!
…!
…!
…!
!
! ! !
});!
!
win.fs.Modules.GlobalLikes = GlobalLikes;!
!
})(window);!
!
Javascript
Working well with Sprockets. Eventually.
– Declare dependencies with “//=require xxx”.
– Scope everything to window.fs (and pray we don’t ever
need Node’s FS module).
– Expose modules to global window.fs.Modules object.
– Using bower-rails gem for dependencies.
49
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_
Javascript
50
JS Mike = Finally Happy
Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ 51
FontShop is always looking for new dev talent!
Contact Ivo Gabrowitsch: ivo@fontshop.com.
Mention this awesome presentation.
berlin amsterdam san francisco stuttgart
edenspiekermann_
Thank you.
Spiros Martzoukos, Web Developer
tw @martzoukos
T +49 157 84340808
!
s.martzoukos@de.edenspiekermann.com
www.edenspiekermann.com

More Related Content

Viewers also liked

Mastering Positive Change
Mastering Positive ChangeMastering Positive Change
Mastering Positive ChangeBusiness901
 
Laura lopez burning season
Laura lopez burning seasonLaura lopez burning season
Laura lopez burning seasonRedestrans
 
C.P.C Abog Carlos Zambrano Aranda. Gerente de Soluciones Legales & Contables ...
C.P.C Abog Carlos Zambrano Aranda. Gerente de Soluciones Legales & Contables ...C.P.C Abog Carlos Zambrano Aranda. Gerente de Soluciones Legales & Contables ...
C.P.C Abog Carlos Zambrano Aranda. Gerente de Soluciones Legales & Contables ...Carlos Zambrano Aranda
 
Social mediaoverviewupdated
Social mediaoverviewupdatedSocial mediaoverviewupdated
Social mediaoverviewupdatedayoungkin
 
Presentacion tecnochip
Presentacion tecnochipPresentacion tecnochip
Presentacion tecnochipmrorange0422
 
Presentación de la Cátedra Externa del Dolor de la Fundación Grunenthal y la UCA
Presentación de la Cátedra Externa del Dolor de la Fundación Grunenthal y la UCAPresentación de la Cátedra Externa del Dolor de la Fundación Grunenthal y la UCA
Presentación de la Cátedra Externa del Dolor de la Fundación Grunenthal y la UCALuis Miguel Torres Morera
 
Water Solutions for Harbors
Water Solutions for HarborsWater Solutions for Harbors
Water Solutions for HarborsAndreas Thoma
 
Matanza en san pedro de la cueva
Matanza en san pedro de la cuevaMatanza en san pedro de la cueva
Matanza en san pedro de la cuevaJudith Zarate
 
Talk given at Internet of Things Helsinki Meetup held at the premise of Zalando
Talk given at Internet of Things Helsinki Meetup held at the premise of ZalandoTalk given at Internet of Things Helsinki Meetup held at the premise of Zalando
Talk given at Internet of Things Helsinki Meetup held at the premise of ZalandoNissanka Wickremasinghe
 
Inflammatory arthritis; a quick run through.
Inflammatory arthritis; a quick run through.Inflammatory arthritis; a quick run through.
Inflammatory arthritis; a quick run through.Ronan Kavanagh
 
Salesforce.com Relaunch Featuring Customer Success Story From Aon
Salesforce.com Relaunch Featuring Customer Success Story From AonSalesforce.com Relaunch Featuring Customer Success Story From Aon
Salesforce.com Relaunch Featuring Customer Success Story From AonRightpoint
 
Super x launch proposal
Super x launch proposalSuper x launch proposal
Super x launch proposalMathew Roy
 
Holiday Inn Eindhoven relaunch
Holiday Inn Eindhoven relaunchHoliday Inn Eindhoven relaunch
Holiday Inn Eindhoven relaunchJeroen
 
Polaroid Proyect. Relaunch Brand
Polaroid Proyect. Relaunch BrandPolaroid Proyect. Relaunch Brand
Polaroid Proyect. Relaunch BrandESPOL
 
Certified entrepreneurial community program relaunch
Certified entrepreneurial community program relaunchCertified entrepreneurial community program relaunch
Certified entrepreneurial community program relaunchCrystal Morphis, CEcD
 

Viewers also liked (18)

Innovation for Businesses
Innovation for BusinessesInnovation for Businesses
Innovation for Businesses
 
FEM Magazine 2013
FEM Magazine 2013FEM Magazine 2013
FEM Magazine 2013
 
Mastering Positive Change
Mastering Positive ChangeMastering Positive Change
Mastering Positive Change
 
Laura lopez burning season
Laura lopez burning seasonLaura lopez burning season
Laura lopez burning season
 
C.P.C Abog Carlos Zambrano Aranda. Gerente de Soluciones Legales & Contables ...
C.P.C Abog Carlos Zambrano Aranda. Gerente de Soluciones Legales & Contables ...C.P.C Abog Carlos Zambrano Aranda. Gerente de Soluciones Legales & Contables ...
C.P.C Abog Carlos Zambrano Aranda. Gerente de Soluciones Legales & Contables ...
 
Social mediaoverviewupdated
Social mediaoverviewupdatedSocial mediaoverviewupdated
Social mediaoverviewupdated
 
Presentacion tecnochip
Presentacion tecnochipPresentacion tecnochip
Presentacion tecnochip
 
3 present inv_publica
3 present inv_publica3 present inv_publica
3 present inv_publica
 
Presentación de la Cátedra Externa del Dolor de la Fundación Grunenthal y la UCA
Presentación de la Cátedra Externa del Dolor de la Fundación Grunenthal y la UCAPresentación de la Cátedra Externa del Dolor de la Fundación Grunenthal y la UCA
Presentación de la Cátedra Externa del Dolor de la Fundación Grunenthal y la UCA
 
Water Solutions for Harbors
Water Solutions for HarborsWater Solutions for Harbors
Water Solutions for Harbors
 
Matanza en san pedro de la cueva
Matanza en san pedro de la cuevaMatanza en san pedro de la cueva
Matanza en san pedro de la cueva
 
Talk given at Internet of Things Helsinki Meetup held at the premise of Zalando
Talk given at Internet of Things Helsinki Meetup held at the premise of ZalandoTalk given at Internet of Things Helsinki Meetup held at the premise of Zalando
Talk given at Internet of Things Helsinki Meetup held at the premise of Zalando
 
Inflammatory arthritis; a quick run through.
Inflammatory arthritis; a quick run through.Inflammatory arthritis; a quick run through.
Inflammatory arthritis; a quick run through.
 
Salesforce.com Relaunch Featuring Customer Success Story From Aon
Salesforce.com Relaunch Featuring Customer Success Story From AonSalesforce.com Relaunch Featuring Customer Success Story From Aon
Salesforce.com Relaunch Featuring Customer Success Story From Aon
 
Super x launch proposal
Super x launch proposalSuper x launch proposal
Super x launch proposal
 
Holiday Inn Eindhoven relaunch
Holiday Inn Eindhoven relaunchHoliday Inn Eindhoven relaunch
Holiday Inn Eindhoven relaunch
 
Polaroid Proyect. Relaunch Brand
Polaroid Proyect. Relaunch BrandPolaroid Proyect. Relaunch Brand
Polaroid Proyect. Relaunch Brand
 
Certified entrepreneurial community program relaunch
Certified entrepreneurial community program relaunchCertified entrepreneurial community program relaunch
Certified entrepreneurial community program relaunch
 

Similar to Lessons learnt from the FontShop site relaunch

Branding SharePoint from Prototype to Deployment - Workshop
Branding SharePoint from Prototype to Deployment - WorkshopBranding SharePoint from Prototype to Deployment - Workshop
Branding SharePoint from Prototype to Deployment - WorkshopEric Overfield
 
Hardboiled Front End Development — Found.ation
Hardboiled Front End Development — Found.ationHardboiled Front End Development — Found.ation
Hardboiled Front End Development — Found.ationSpiros Martzoukos
 
Getting Started with Sass & Compass
Getting Started with Sass & CompassGetting Started with Sass & Compass
Getting Started with Sass & CompassRob Davarnia
 
Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)Tahmina Khatoon
 
Hppg r819 gallery presentation, search by color introduced
Hppg r819 gallery presentation, search by color introducedHppg r819 gallery presentation, search by color introduced
Hppg r819 gallery presentation, search by color introducedRemigijus Kiminas
 
Advanced sass/compass
Advanced sass/compassAdvanced sass/compass
Advanced sass/compassNick Cooley
 
Sakai Meet MORPHEUS: Slides
Sakai Meet MORPHEUS: SlidesSakai Meet MORPHEUS: Slides
Sakai Meet MORPHEUS: Slidesalienresident
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3hstryk
 
Rapid Prototyping with Sass, Compass and Middleman by Bermon Painter
Rapid Prototyping with Sass, Compass and Middleman by Bermon PainterRapid Prototyping with Sass, Compass and Middleman by Bermon Painter
Rapid Prototyping with Sass, Compass and Middleman by Bermon PainterCodemotion
 
CSS & eCSStender [CSS Summit 2011]
CSS & eCSStender [CSS Summit 2011]CSS & eCSStender [CSS Summit 2011]
CSS & eCSStender [CSS Summit 2011]Aaron Gustafson
 
Web Frontend development: tools and good practices to (re)organize the chaos
Web Frontend development: tools and good practices to (re)organize the chaosWeb Frontend development: tools and good practices to (re)organize the chaos
Web Frontend development: tools and good practices to (re)organize the chaosMatteo Papadopoulos
 
Adobe MAX 2008: HTML/CSS + Fireworks
Adobe MAX 2008: HTML/CSS + FireworksAdobe MAX 2008: HTML/CSS + Fireworks
Adobe MAX 2008: HTML/CSS + FireworksNathan Smith
 
(2018) Webpack Encore - Asset Management for the rest of us
(2018) Webpack Encore - Asset Management for the rest of us(2018) Webpack Encore - Asset Management for the rest of us
(2018) Webpack Encore - Asset Management for the rest of usStefan Adolf
 
OOScss Architecture For Rails Apps
OOScss Architecture For Rails AppsOOScss Architecture For Rails Apps
OOScss Architecture For Rails AppsNetguru
 
Modularization css with sass
Modularization css with sassModularization css with sass
Modularization css with sassHuiyi Yan
 
"今" 使えるJavaScriptのトレンド
"今" 使えるJavaScriptのトレンド"今" 使えるJavaScriptのトレンド
"今" 使えるJavaScriptのトレンドHayato Mizuno
 
CSS Regression Tests
CSS Regression TestsCSS Regression Tests
CSS Regression TestsKaloyan Kosev
 

Similar to Lessons learnt from the FontShop site relaunch (20)

Branding SharePoint from Prototype to Deployment - Workshop
Branding SharePoint from Prototype to Deployment - WorkshopBranding SharePoint from Prototype to Deployment - Workshop
Branding SharePoint from Prototype to Deployment - Workshop
 
Hardboiled Front End Development — Found.ation
Hardboiled Front End Development — Found.ationHardboiled Front End Development — Found.ation
Hardboiled Front End Development — Found.ation
 
Death of a Themer
Death of a ThemerDeath of a Themer
Death of a Themer
 
Getting Started with Sass & Compass
Getting Started with Sass & CompassGetting Started with Sass & Compass
Getting Started with Sass & Compass
 
Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)
 
Hppg r819 gallery presentation, search by color introduced
Hppg r819 gallery presentation, search by color introducedHppg r819 gallery presentation, search by color introduced
Hppg r819 gallery presentation, search by color introduced
 
Advanced sass/compass
Advanced sass/compassAdvanced sass/compass
Advanced sass/compass
 
Sakai Meet MORPHEUS: Slides
Sakai Meet MORPHEUS: SlidesSakai Meet MORPHEUS: Slides
Sakai Meet MORPHEUS: Slides
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
 
Rapid Prototyping with Sass, Compass and Middleman by Bermon Painter
Rapid Prototyping with Sass, Compass and Middleman by Bermon PainterRapid Prototyping with Sass, Compass and Middleman by Bermon Painter
Rapid Prototyping with Sass, Compass and Middleman by Bermon Painter
 
CSS & eCSStender [CSS Summit 2011]
CSS & eCSStender [CSS Summit 2011]CSS & eCSStender [CSS Summit 2011]
CSS & eCSStender [CSS Summit 2011]
 
Team styles
Team stylesTeam styles
Team styles
 
Web Frontend development: tools and good practices to (re)organize the chaos
Web Frontend development: tools and good practices to (re)organize the chaosWeb Frontend development: tools and good practices to (re)organize the chaos
Web Frontend development: tools and good practices to (re)organize the chaos
 
Adobe MAX 2008: HTML/CSS + Fireworks
Adobe MAX 2008: HTML/CSS + FireworksAdobe MAX 2008: HTML/CSS + Fireworks
Adobe MAX 2008: HTML/CSS + Fireworks
 
(2018) Webpack Encore - Asset Management for the rest of us
(2018) Webpack Encore - Asset Management for the rest of us(2018) Webpack Encore - Asset Management for the rest of us
(2018) Webpack Encore - Asset Management for the rest of us
 
OOScss Architecture For Rails Apps
OOScss Architecture For Rails AppsOOScss Architecture For Rails Apps
OOScss Architecture For Rails Apps
 
Seven deadly theming sins
Seven deadly theming sinsSeven deadly theming sins
Seven deadly theming sins
 
Modularization css with sass
Modularization css with sassModularization css with sass
Modularization css with sass
 
"今" 使えるJavaScriptのトレンド
"今" 使えるJavaScriptのトレンド"今" 使えるJavaScriptのトレンド
"今" 使えるJavaScriptのトレンド
 
CSS Regression Tests
CSS Regression TestsCSS Regression Tests
CSS Regression Tests
 

Recently uploaded

Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...soginsider
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxSCMS School of Architecture
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdfKamal Acharya
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesMayuraD1
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
Bridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptxBridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptxnuruddin69
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
 
Learn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksLearn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksMagic Marks
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxmaisarahman1
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stageAbc194748
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwaitjaanualu31
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 

Recently uploaded (20)

Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Bridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptxBridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptx
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Learn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksLearn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic Marks
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stage
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 

Lessons learnt from the FontShop site relaunch

  • 1. berlin amsterdam san francisco stuttgart edenspiekermann_ Lessons from the FontShop site relaunch UpFront talk 8th July 2014
  • 3. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ body {! font-size: 100%;! font-family: Georgia, serif;! }! ! .o-chosen-select-box.chosen- container,.m-font- autocomplete{display:inline- block;position:relative;vertical- align:middle}.o-chosen-select- box .chosen-single,.m-font- autocomplete__input{background- color:#f9f8f3;color:#262626;-webkit-box- sizing:border-box;-moz-box-sizing:border-box;box- sizing:border-box;border:4px solid #fff;display:block;cursor:pointer;height:2.5em;line- height:1.25em;padding:0 2.125em;-webkit-transition:background- color 150ms,border-color 150ms;-moz-transition:background-color 150ms,border-color 150ms;! .l-modal__tooltip__pane{z-index:30}.o-error{z-index:10}.o- pulldown-panel__list{z-index:10}.l-tryout-page__canvas{z-index: 1}.l-tryout-page__header{z-index:30}.m-tryout- textblock__action{z-index:20}.m-tryout- textblock__editable{z-index:20}.m-tryout- textblock__placeholder{z-index:10}.m-font- autocomplete__dropdown,.o-chosen-select- box{z-index:40}.l-tryout-page__template- links,.l-tryout-page__bgimage-info{z- index:50}.l-tryout-page__meta-links{z- index:10000}.m-tryout-template-links —centered{z-index:10}! ! #footer .left-column .article ul.links > li a img {! border-color: #0A0;! }! CSS Architecture Scientifically proven fact: a developer’s attention span gets diluted after 34.23 continuous lines of CSS code.* 3 * = Bullshit Researching Institute GmbH, 1999
  • 4. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ CSS Architecture 4
  • 5. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ CSS Architecture 5
  • 6. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ _config/! ! extends/! ! mixins/! ! ! _colors.sass! ! ! …! ! var/! ! ! _animations.sass! ! ! …! ! _z-index.sass! ! globals/! ! _typography.sass! ! …! ! objects/! ! _o-button.sass! ! …! ! modules/! ! _m-waterfalls.sass! ! …! ! layouts/! ! _l-homepage.sass! ! …! ! vendor/! ! _noone.reads.me.lol.sass! ! …! ! application.sass CSS Architecture Structure. – Vars, mixins under _config ensure consistency. – Globals folder contains non-modular global styles. – Objects folder has the smallest modular units. – Modules are combined Objects. Sometimes not exactly modular but mapped to content entities. – Layouts contain only layout (duh) information such as width, height, margin, padding. 6
  • 8. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ CSS Architecture 8
  • 9. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ CSS Architecture 9 .m-styles__families__slider__family__rail__node
  • 10. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ CSS Architecture Good things: – Self explanatory in both HTML & CSS. – Shields object’s scope. ! Bad things: – Can easily get carried away with underlines. – Verbal classes (but you get used to it). ! Things to remember: – Never nest selectors (to ensure specificity == 1). – Always & only, use classes. 10
  • 11. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ CSS Architecture 11 117CSS Objects in the project
  • 12. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ CSS Architecture 12
  • 14. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ CSS Architecture 14 1
  • 15. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ CSS Architecture 15 2
  • 16. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ CSS Architecture 16 3
  • 17. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ CSS Architecture 17 Same Functionality ≠ Modularity –Elements that serve the same functionality don’t have to be the same CSS objects. –Otherwise it’s a game of show, hide, absolute position elements. –More info: http://www.edenspiekermann.com/blog/ oocss-and-the-pagification-of-modules 1 2 3 Douchebag score Sorry, did it again!+1
  • 19. Hardboiled Front End Development 10.06.2014edenspiekermann_ CSS Architecture Requirements-Challenges: –Auto-maintained. No duplicate views in production & styleguide. –CSS Refactoring at the same time, to normalise objects. ! Advantages: –Nice overview of all your objects. –Enforces good practices. –Enhances developer — designer collaboration. –Helps you scale your project. ! Tool: –https://github.com/kneath/kss 19
  • 20. Hardboiled Front End Development 10.06.2014edenspiekermann_ gem install kss CSS Architecture Setting up KSS. – Install gem. 20
  • 21. Hardboiled Front End Development 10.06.2014edenspiekermann_ @styleguides = Kss::Parser.new(“/ public/css“)! CSS Architecture Setting up KSS. – Install gem. – Parse CSS folder into an object. 21
  • 22. Hardboiled Front End Development 10.06.2014edenspiekermann_ CSS Architecture Setting up KSS. – Install gem. – Parse CSS folder into an object. – Iterate object in view. 22 - @styleguides.each do |styleguide|! - [...]!
  • 23. Hardboiled Front End Development 10.06.2014edenspiekermann_ /*! The global button object.! ! .button - Primary button.! .button--green - Green variation.! ! Styleguide 1.0 Button! */! ! .button {! height: 20px;! text-align: center;! width: 100px;! }! ! .button--green {! background-color: green;! }! CSS Architecture Setting up KSS. – Install gem. – Parse CSS folder into an object. – Iterate object in view. – Use the magic KSS syntax. 23
  • 26. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ CSS Architecture 26
  • 27. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ 27
  • 28. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ 28
  • 29. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ .o-logo__block--left! +fs-color(secondary, background-color)! CSS Architecture Using Sass to create themes: – Too much labor to create theme variations for each selector. – Created Sass function to do that automatically. ! Problems: – Specificity issues in overriding styles (trying to convince myself that using “!important” is ok). – Slow compilation times. 29 body.theme--white .o-logo__block--left {! background-color: yellow;! }! body.theme--yellow .o-logo__block--left {! background-color: white;! }! body.theme--black .o-logo__block--left{! background-color: yellow;! }!
  • 30. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ CSS Architecture 30
  • 31. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ CSS Architecture 31 ~12secCSS loading time during development
  • 32. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ CSS Architecture 32 ~12secCSS loading time during development On a frickin’ 2.8Ghz, 16GB Ram, SSD Machine.
  • 33. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ CSS Architecture Tips: – Helpful to prefix classes (“o-“, “l-“, “m-“), that way you recognize their type in markup. – Prefix JS hooks with “js-“. That way HTML/CSS restructuring doesn’t affect javascript functionality. – Put all rushed code in shame.css. Always write reason of inclusion in comments. – Keep all z-index values in z-index.css and always use increments of 10 or more. 33
  • 35. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ Javascript Modules 35
  • 36. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ Javascript Modules 36 AMD FTW!
  • 37. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ Javascript Modules 37 AMD FTW!Module Structure
  • 38. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ Javascript Modules 38 AMD FTW!Module Structure r.js wrapper -> .min.js
  • 39. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ Javascript Modules 39 AMD FTW!Module Structure r.js wrapper -> .min.js
  • 40. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ Javascript Modules 40 AMD FTW!Module Structure r.js wrapper -> .min.js
  • 41. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ Javascript Modules 41 AMD FTW!Module Structure r.js wrapper -> .min.js?
  • 42. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ Javascript Modules 42 AMD FTW!Module Structure r.js wrapper -> .min.js?
  • 43. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ Javascript Modules 43 AMD FTW!Module Structure r.js wrapper -> .min.js?
  • 44. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ Javascript Modules 44 AMD FTW!Module Structure r.js wrapper -> .min.js HAHAHAHA!
  • 45. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ Javascript Modules 45 AMD FTW!Module Structure r.js wrapper -> .min.js
  • 46. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ Javascript Modules 46 Module Structure r.js wrapper -> .min.js
  • 47. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ Javascript Modules 47 Module Structure
  • 48. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ Javascript Modules 48 //= require xxx.js //= require_tree /js/JS Modules Tryout Site Buy
  • 49. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ //= require jquery! ! (function (win) {! ! var GlobalLikes = {};! ! GlobalLikes = Backbone.View.extend({! ! initialize: function () {! this.options = _.extend({}, ! this.defaults, this.$el.data());! this.getLikes();! },! ! ! ! …! …! …! ! ! ! ! });! ! win.fs.Modules.GlobalLikes = GlobalLikes;! ! })(window);! ! Javascript Working well with Sprockets. Eventually. – Declare dependencies with “//=require xxx”. – Scope everything to window.fs (and pray we don’t ever need Node’s FS module). – Expose modules to global window.fs.Modules object. – Using bower-rails gem for dependencies. 49
  • 50. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ Javascript 50 JS Mike = Finally Happy
  • 51. Lessons from the FontShop site relaunch 08.07.2014edenspiekermann_ 51 FontShop is always looking for new dev talent! Contact Ivo Gabrowitsch: ivo@fontshop.com. Mention this awesome presentation.
  • 52. berlin amsterdam san francisco stuttgart edenspiekermann_ Thank you. Spiros Martzoukos, Web Developer tw @martzoukos T +49 157 84340808 ! s.martzoukos@de.edenspiekermann.com www.edenspiekermann.com