SlideShare a Scribd company logo
1 of 18
New(ish)
horizons in
CSS
Luc Perkins
Janrain, Inc.
● Janrain, Inc.
● Not a CSS guru
● Sooo...
Me
<body style="background-color: #fff;">
<p style="font-family: Verdana;">
<b>No abstraction. Nope, none.</b>
</p>
</body>
Once upon a time
● Cluttered HTML
● More fine-grained styling means even
more clutter
● Redundancy
● No abstraction. Zero.
○ No class- or type-level styling
○ No event ascription
○ No z-index, padding, generic classification
○ Et cetera
● And then...
Problems
● Biggest win: abstraction
○ style.css (!!!)
○ Maintainability
○ Division of labor
○ Selection mechanisms
● Limitations
○ Still not terribly DRY friendly
○ Minimum possible abstraction layer
Solution: CSS(1)
● Move toward CSS metadata
○ @charset
○ @import
○ @media
■ all, screen, handheld, projection,
print, tv, embossed, tty, braille
○ @page (Opera)
○ @font-face
○ @namespace
● This all culminates in...
CSS3
● The good
○ Quick and dirty
○ No surprises
○ Separation of concerns
○ Basically just a vast one-direction import system
● The bad
○ Opinionated
○ Bulky
○ Trade velocity for customizability
● The ugly...
Bootstrap/Foundation
● Variables
$blue, $line-height, $main-font
● Nesting
#header { div { ul#main { li { p ...
● Mix-ins
@mixin banner($size) {
font-size: $size;
font-family: Verdana; }
#header {
@include banner(30px); }
SASS (plus LESS, Stylus, etc.)
● Hate it break it to you, but...
There's no such thing...yet
● Hodge podge of capabilities borrowed
from/reminiscent of OOP
● DRY
● Booleans (e.g. $use-grids: false)
● BEM (block-element-modifier)
○ Block: independent entity (e.g. header)
○ Element: part of a block that forms a function (e.g.
header logo)
○ Modifier: do stuff to an element
OOCSS
● Default-driven import structure
● Core data types
○ Base
○ Generic
○ Object
● Biggest win: modularity
○ More a template than a framework
○ Build your own damned modules
InuitCSS
DEMO
TIME
● CSS is not Pythonic
○ Pick a path and stick with it
○ Select a core set of elements and think of them
as your building blocks
● Careful with nesting
○ Levels of depth should correspond to importance
of what you're working with
● <div class="big bold">
● <img id="header__logo">
● /* comment all the things */
Best practices
Pseudo-classes
○ :local-link(n)
○ :indeterminate
○ :in-range/:out-of-range
○ :read-only/:read-write
○ :column/:nth-column/:nth-last-column
○ E /attribute/ F
○ :any-link
○ :matches(header, footer) h1
○ :current/:past/:future
○ :required/:optional
○ :nth-match/:nth-last-match
○ [attribute-"value" i]
The future: CSS4
○ !subject > selector
● In a nutshell...
○ Lots of fun new selectors
○ Not a lot on the "content" side
○ Nothing as exciting as media or calc
● Bold prediction
○ Every company will have a "CSS specialist"
CSS4 (cont'd)
● Drawing API
○ Goodbye Raphaël, etc.
● Go beyond the mouse
○ Key strokes
■ key:Enter { ... }
○ Gestures
■ div:left-swipe { ... }
● Basically, just colonize jQuery
● Real OOP!!!
○ Arrays, hashes, classes, etc.
■ blocks = [header, main, footer]
○ Methods
■ #main-logo.blink()
What should be next?
Contact
@lucperkins
luc@janrain.com

More Related Content

Similar to New(ish) Horizons in CSS (PDX Web & Design presentation)

Drupal Camp Kiev 2012 - High Performance Drupal Web Sites
Drupal Camp Kiev 2012 - High Performance Drupal Web SitesDrupal Camp Kiev 2012 - High Performance Drupal Web Sites
Drupal Camp Kiev 2012 - High Performance Drupal Web Sites
Skilld
 
Knockout vs. angular
Knockout vs. angularKnockout vs. angular
Knockout vs. angular
MaslowB
 
2014 03-25 - GDG Nantes - Web Components avec Polymer
2014 03-25 - GDG Nantes - Web Components avec Polymer2014 03-25 - GDG Nantes - Web Components avec Polymer
2014 03-25 - GDG Nantes - Web Components avec Polymer
Horacio Gonzalez
 
High Performance Rust UI.pdf
High Performance Rust UI.pdfHigh Performance Rust UI.pdf
High Performance Rust UI.pdf
mraaaaa
 

Similar to New(ish) Horizons in CSS (PDX Web & Design presentation) (20)

Deep dive into browser internal processing
Deep dive into  browser internal processingDeep dive into  browser internal processing
Deep dive into browser internal processing
 
Html5 training
Html5 trainingHtml5 training
Html5 training
 
Architektura html, css i javascript - Jan Kraus
Architektura html, css i javascript - Jan KrausArchitektura html, css i javascript - Jan Kraus
Architektura html, css i javascript - Jan Kraus
 
Drupalcamp performance
Drupalcamp performanceDrupalcamp performance
Drupalcamp performance
 
Introduction to Frontend Development - Session 2 - CSS Fundamentals
Introduction to Frontend Development - Session 2 - CSS FundamentalsIntroduction to Frontend Development - Session 2 - CSS Fundamentals
Introduction to Frontend Development - Session 2 - CSS Fundamentals
 
Drupal Camp Kiev 2012 - High Performance Drupal Web Sites
Drupal Camp Kiev 2012 - High Performance Drupal Web SitesDrupal Camp Kiev 2012 - High Performance Drupal Web Sites
Drupal Camp Kiev 2012 - High Performance Drupal Web Sites
 
Umbraco development across large and distributed teams
Umbraco development across large and distributed teamsUmbraco development across large and distributed teams
Umbraco development across large and distributed teams
 
#4 - CSS Selectors, CSS3 and Web typography
#4 - CSS Selectors, CSS3 and Web typography#4 - CSS Selectors, CSS3 and Web typography
#4 - CSS Selectors, CSS3 and Web typography
 
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 3/3 - Web Components avec Po...
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 3/3 - Web Components avec Po...ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 3/3 - Web Components avec Po...
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 3/3 - Web Components avec Po...
 
Dart the better Javascript 2015
Dart the better Javascript 2015Dart the better Javascript 2015
Dart the better Javascript 2015
 
JavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web frameworkJavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web framework
 
HTML, CSS & Javascript Architecture (extended version) - Jan Kraus
HTML, CSS & Javascript Architecture (extended version) - Jan KrausHTML, CSS & Javascript Architecture (extended version) - Jan Kraus
HTML, CSS & Javascript Architecture (extended version) - Jan Kraus
 
Knockout vs. angular
Knockout vs. angularKnockout vs. angular
Knockout vs. angular
 
2014 03-25 - GDG Nantes - Web Components avec Polymer
2014 03-25 - GDG Nantes - Web Components avec Polymer2014 03-25 - GDG Nantes - Web Components avec Polymer
2014 03-25 - GDG Nantes - Web Components avec Polymer
 
Drupal 8: frontend development
Drupal 8: frontend developmentDrupal 8: frontend development
Drupal 8: frontend development
 
Advanced Layout Techniques @ CMSExpo
Advanced Layout Techniques @ CMSExpoAdvanced Layout Techniques @ CMSExpo
Advanced Layout Techniques @ CMSExpo
 
Introduction to html5 and css3
Introduction to html5 and css3Introduction to html5 and css3
Introduction to html5 and css3
 
High Performance Rust UI.pdf
High Performance Rust UI.pdfHigh Performance Rust UI.pdf
High Performance Rust UI.pdf
 
Ln monitoring repositories
Ln monitoring repositoriesLn monitoring repositories
Ln monitoring repositories
 
Training Webinar: Top front-end techniques for OutSystems
 Training Webinar: Top front-end techniques for OutSystems Training Webinar: Top front-end techniques for OutSystems
Training Webinar: Top front-end techniques for OutSystems
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

New(ish) Horizons in CSS (PDX Web & Design presentation)

  • 2. ● Janrain, Inc. ● Not a CSS guru ● Sooo... Me
  • 3. <body style="background-color: #fff;"> <p style="font-family: Verdana;"> <b>No abstraction. Nope, none.</b> </p> </body> Once upon a time
  • 4. ● Cluttered HTML ● More fine-grained styling means even more clutter ● Redundancy ● No abstraction. Zero. ○ No class- or type-level styling ○ No event ascription ○ No z-index, padding, generic classification ○ Et cetera ● And then... Problems
  • 5.
  • 6. ● Biggest win: abstraction ○ style.css (!!!) ○ Maintainability ○ Division of labor ○ Selection mechanisms ● Limitations ○ Still not terribly DRY friendly ○ Minimum possible abstraction layer Solution: CSS(1)
  • 7. ● Move toward CSS metadata ○ @charset ○ @import ○ @media ■ all, screen, handheld, projection, print, tv, embossed, tty, braille ○ @page (Opera) ○ @font-face ○ @namespace ● This all culminates in... CSS3
  • 8. ● The good ○ Quick and dirty ○ No surprises ○ Separation of concerns ○ Basically just a vast one-direction import system ● The bad ○ Opinionated ○ Bulky ○ Trade velocity for customizability ● The ugly... Bootstrap/Foundation
  • 9.
  • 10. ● Variables $blue, $line-height, $main-font ● Nesting #header { div { ul#main { li { p ... ● Mix-ins @mixin banner($size) { font-size: $size; font-family: Verdana; } #header { @include banner(30px); } SASS (plus LESS, Stylus, etc.)
  • 11. ● Hate it break it to you, but... There's no such thing...yet ● Hodge podge of capabilities borrowed from/reminiscent of OOP ● DRY ● Booleans (e.g. $use-grids: false) ● BEM (block-element-modifier) ○ Block: independent entity (e.g. header) ○ Element: part of a block that forms a function (e.g. header logo) ○ Modifier: do stuff to an element OOCSS
  • 12. ● Default-driven import structure ● Core data types ○ Base ○ Generic ○ Object ● Biggest win: modularity ○ More a template than a framework ○ Build your own damned modules InuitCSS
  • 14. ● CSS is not Pythonic ○ Pick a path and stick with it ○ Select a core set of elements and think of them as your building blocks ● Careful with nesting ○ Levels of depth should correspond to importance of what you're working with ● <div class="big bold"> ● <img id="header__logo"> ● /* comment all the things */ Best practices
  • 15. Pseudo-classes ○ :local-link(n) ○ :indeterminate ○ :in-range/:out-of-range ○ :read-only/:read-write ○ :column/:nth-column/:nth-last-column ○ E /attribute/ F ○ :any-link ○ :matches(header, footer) h1 ○ :current/:past/:future ○ :required/:optional ○ :nth-match/:nth-last-match ○ [attribute-"value" i] The future: CSS4
  • 16. ○ !subject > selector ● In a nutshell... ○ Lots of fun new selectors ○ Not a lot on the "content" side ○ Nothing as exciting as media or calc ● Bold prediction ○ Every company will have a "CSS specialist" CSS4 (cont'd)
  • 17. ● Drawing API ○ Goodbye Raphaël, etc. ● Go beyond the mouse ○ Key strokes ■ key:Enter { ... } ○ Gestures ■ div:left-swipe { ... } ● Basically, just colonize jQuery ● Real OOP!!! ○ Arrays, hashes, classes, etc. ■ blocks = [header, main, footer] ○ Methods ■ #main-logo.blink() What should be next?