SlideShare ist ein Scribd-Unternehmen logo
1 von 52
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Andere mochten auch

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
 

Andere mochten auch (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
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
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLManishPatel169454
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSUNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSrknatarajan
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01KreezheaRecto
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spaintimesproduction05
 

Kürzlich hochgeladen (20)

VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
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
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSUNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spain
 

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