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)

Deep dive into browser internal processing
Deep dive into  browser internal processingDeep dive into  browser internal processing
Deep dive into browser internal processingHarunaUtsumi
 
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 KrausWomen in Technology Poland
 
Drupalcamp performance
Drupalcamp performanceDrupalcamp performance
Drupalcamp performanceFrontkom
 
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 FundamentalsKalin Chernev
 
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 SitesSkilld
 
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 teamsJanusz Stabik
 
#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 typographyiloveigloo
 
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...Horacio Gonzalez
 
Dart the better Javascript 2015
Dart the better Javascript 2015Dart the better Javascript 2015
Dart the better Javascript 2015Jorg Janke
 
JavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web frameworkJavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web frameworkAlive Kuo
 
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 KrausWomen in Technology Poland
 
Knockout vs. angular
Knockout vs. angularKnockout vs. angular
Knockout vs. angularMaslowB
 
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 PolymerHoracio Gonzalez
 
Drupal 8: frontend development
Drupal 8: frontend developmentDrupal 8: frontend development
Drupal 8: frontend developmentsparkfabrik
 
Introduction to html5 and css3
Introduction to html5 and css3Introduction to html5 and css3
Introduction to html5 and css3Sunny Batabyal
 
High Performance Rust UI.pdf
High Performance Rust UI.pdfHigh Performance Rust UI.pdf
High Performance Rust UI.pdfmraaaaa
 
Ln monitoring repositories
Ln monitoring repositoriesLn monitoring repositories
Ln monitoring repositoriessnyff
 
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 OutSystemsOutSystems
 

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

Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 

Recently uploaded (20)

Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 

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?