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

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
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
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
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
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
 
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
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
"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
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
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
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
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
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
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
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
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
 

Recently uploaded (20)

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
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
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
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
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
 
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
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
"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
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
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
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
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
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
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)
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
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
 

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?