SlideShare a Scribd company logo
1 of 39
Download to read offline
Peter Gasston
@StopsAtGreen
CSS3:
        X
The boring bits.
Boring things*
 The Matrix Revolutions
The Lord of the Rings films
        Coldplay
    Apple vs Android

             *Removed images of dubious provenance
Exciting CSS
Filters
.foo { filter: grayscale(1); }
.bar { filter: sepia(0.5); }
cross-fade()
background-image: cross-fade(
  url('foo.png'),
  url('bar.png'),
  50%
);
An interesting paradox:
The more boring a CSS feature is, the
more excited I get when someone does
       something cool with it.
Backgrounds
 & Borders

     http://dev.w3.org/csswg/css4-background/
background-position: h n v n;
    background-position:
    right 20px bottom 10%;



Four values allows more flexible placing of background images.
border-corner-shape: foo;
border-corner-shape: bevel;
border-clip: [x y];
   border-clip: [visible invisible];
   border-clip: 10px 1fr 10px;



Custom border shapes; clip the border to show the areas you want.
Namespaces
@namespace "http://www.w3.org/1999/xhtml";
@namespace svg "http://www.w3.org/2000/svg";




                       http://www.w3.org/TR/css3-namespace/
a { color: #F00; }
svg|a { color: #00F; }
unicode-range
@font-face {
 font-family: foo;
 src: url('foo.woff');
 unicode-range: U+31-33;
}

       http://www.w3.org/TR/css3-fonts/#unicode-range-desc
Device Adaptation
<meta name="viewport" content="width=320">




                     http://dev.w3.org/csswg/css-device-adapt/
@viewport { width: 320px; }
@viewport {
  foo: bar;
}

@media screen and (max-width:320px) {
  @viewport {
    foo: baz;
  }
}
Values


    http://www.w3.org/TR/css3-values/
rem
  body { font-size: 10px; }
  h1 { font-size: 2.4em; }
  h1 span { font-size: 0.9167em; }
  h1 span { font-size: 2.2rem; }




The rem unit is always relative to the root font-size, not that of its parent as em is.
100vw


                   vh, vw, vmin
       div { width: 25vw; }


vh = viewport height, vw = viewport width, vmin = either vh or vw, whichever is smaller. It’s
a length measure that’s relative to the viewport, not the parent.
attr()
            attr(title)
      attr(data-color color)


The attr() value will now accept more than strings, as it currently does. You can specify the
type to be color, url, number, and more.
div::before { content: 'foo'; }
     div { content: replaced 'foo'; }




It’s proposed that you be able to replace content in any element, rather than just ::after
or ::before.
calc()
width: calc(75% - 20px)
cycle()
  em { font-style: cycle(italic,normal); }




Will cycle through the values depending on inherited values. For example, em will be have
font-style: italic if its parent is normal, or normal if its parent is italic.
Selectors


      http://dev.w3.org/csswg/selectors4/
:target
         e { color: #F00; }
         e:target { color: #00F; }


:target is applied to an internal link which the user has followed; e.g. <a href=”#foo”>
:dir()
                        e:dir(rtl) {}


Used for internationalised sites; rtl, ltr.
:not()
e:not(.foo) {}
:nth-*
:nth-child(odd):not(:last-child)
:matches()
.foo .bar h1, .foo .bar h2, .foo .bar h3 {}
.foo .bar :matches(h1,h2,h3) {}
:link, :visited
                    :any-link
                    :local-link

:any-link means any link, regardless of its visited state; :local-link is for links on the same
domain.
:column()
       :nth-column()
       :nth-last-column()

Applied to, for example, tables. Will possible work for grid layouts too.
:past
                            :current
                            :future

Selectors based on temporal position, such as combined with audio, video, screen readers.
E /x/ F
   label:hover /for/ input


A bit complicated this; the x value is an attribute of E which is equal to the id value of F. Best
example is <label for=”foo”> <input id=”foo”>
$E > F


The parent selector!!! The element E has styles applied if it contains element F.
:root { data-foo: #F00;}
   h1 { color: data(foo);}


                                                  http://dev.w3.org/csswg/css-variables/

CSS Variables. Uses the data- pattern from the HTML5 data attributes. Scoped by applying to
elements.
Boring = Exciting
Still available.
Still not boring.

      http://thebookofcss3.com

More Related Content

What's hot

Making Your Own Domain Specific Language
Making Your Own Domain Specific LanguageMaking Your Own Domain Specific Language
Making Your Own Domain Specific Language
Ancestry.com
 
Maps and Meaning: Graph-based Entity Resolution in Apache Spark & GraphX
Maps and Meaning: Graph-based Entity Resolution in Apache Spark & GraphXMaps and Meaning: Graph-based Entity Resolution in Apache Spark & GraphX
Maps and Meaning: Graph-based Entity Resolution in Apache Spark & GraphX
Databricks
 
Algebraic Data Types and Origami Patterns
Algebraic Data Types and Origami PatternsAlgebraic Data Types and Origami Patterns
Algebraic Data Types and Origami Patterns
Vasil Remeniuk
 

What's hot (20)

Working with Complex Types in DataFrames: Optics to the Rescue
Working with Complex Types in DataFrames: Optics to the RescueWorking with Complex Types in DataFrames: Optics to the Rescue
Working with Complex Types in DataFrames: Optics to the Rescue
 
Making Your Own Domain Specific Language
Making Your Own Domain Specific LanguageMaking Your Own Domain Specific Language
Making Your Own Domain Specific Language
 
Maps and Meaning: Graph-based Entity Resolution in Apache Spark & GraphX
Maps and Meaning: Graph-based Entity Resolution in Apache Spark & GraphXMaps and Meaning: Graph-based Entity Resolution in Apache Spark & GraphX
Maps and Meaning: Graph-based Entity Resolution in Apache Spark & GraphX
 
MongoDB World 2016 : Advanced Aggregation
MongoDB World 2016 : Advanced AggregationMongoDB World 2016 : Advanced Aggregation
MongoDB World 2016 : Advanced Aggregation
 
Algebraic Data Types and Origami Patterns
Algebraic Data Types and Origami PatternsAlgebraic Data Types and Origami Patterns
Algebraic Data Types and Origami Patterns
 
Language R
Language RLanguage R
Language R
 
Presentation R basic teaching module
Presentation R basic teaching modulePresentation R basic teaching module
Presentation R basic teaching module
 
Data manipulation with dplyr
Data manipulation with dplyrData manipulation with dplyr
Data manipulation with dplyr
 
4 R Tutorial DPLYR Apply Function
4 R Tutorial DPLYR Apply Function4 R Tutorial DPLYR Apply Function
4 R Tutorial DPLYR Apply Function
 
5 R Tutorial Data Visualization
5 R Tutorial Data Visualization5 R Tutorial Data Visualization
5 R Tutorial Data Visualization
 
Spark 4th Meetup Londond - Building a Product with Spark
Spark 4th Meetup Londond - Building a Product with SparkSpark 4th Meetup Londond - Building a Product with Spark
Spark 4th Meetup Londond - Building a Product with Spark
 
Python and CSV Connectivity
Python and CSV ConnectivityPython and CSV Connectivity
Python and CSV Connectivity
 
Building a Tagless Final DSL for WebGL
Building a Tagless Final DSL for WebGLBuilding a Tagless Final DSL for WebGL
Building a Tagless Final DSL for WebGL
 
8 covid19 - chp 07 - php array (shared)
8   covid19 - chp 07 - php array (shared)8   covid19 - chp 07 - php array (shared)
8 covid19 - chp 07 - php array (shared)
 
pandas - Python Data Analysis
pandas - Python Data Analysispandas - Python Data Analysis
pandas - Python Data Analysis
 
Grouping & Summarizing Data in R
Grouping & Summarizing Data in RGrouping & Summarizing Data in R
Grouping & Summarizing Data in R
 
3 R Tutorial Data Structure
3 R Tutorial Data Structure3 R Tutorial Data Structure
3 R Tutorial Data Structure
 
Pandas pythonfordatascience
Pandas pythonfordatasciencePandas pythonfordatascience
Pandas pythonfordatascience
 
Next Generation Programming in R
Next Generation Programming in RNext Generation Programming in R
Next Generation Programming in R
 
An introduction to matlab
An introduction to matlabAn introduction to matlab
An introduction to matlab
 

Similar to CSS: The Boring Bits

Software programming tools for creating/managing CSS files
Software programming tools for creating/managing CSS filesSoftware programming tools for creating/managing CSS files
Software programming tools for creating/managing CSS files
Dinu Suman
 
Big Design Conference: CSS3
Big Design Conference: CSS3 Big Design Conference: CSS3
Big Design Conference: CSS3
Wynn Netherland
 

Similar to CSS: The Boring Bits (20)

CSS
CSSCSS
CSS
 
Software programming tools for creating/managing CSS files
Software programming tools for creating/managing CSS filesSoftware programming tools for creating/managing CSS files
Software programming tools for creating/managing CSS files
 
CSS 3 Overview
CSS 3 OverviewCSS 3 Overview
CSS 3 Overview
 
Chapter 13: Colors and Backgrounds
Chapter 13: Colors and BackgroundsChapter 13: Colors and Backgrounds
Chapter 13: Colors and Backgrounds
 
CSS 3
CSS 3CSS 3
CSS 3
 
CSS3
CSS3CSS3
CSS3
 
Accelerated Stylesheets
Accelerated StylesheetsAccelerated Stylesheets
Accelerated Stylesheets
 
Big Design Conference: CSS3
Big Design Conference: CSS3 Big Design Conference: CSS3
Big Design Conference: CSS3
 
The CSS of Tomorrow (Front Row 2011)
The CSS of Tomorrow (Front Row 2011)The CSS of Tomorrow (Front Row 2011)
The CSS of Tomorrow (Front Row 2011)
 
Core CSS3
Core CSS3Core CSS3
Core CSS3
 
CSS ppt
CSS pptCSS ppt
CSS ppt
 
5. Web Technology CSS Advanced
5. Web Technology CSS Advanced 5. Web Technology CSS Advanced
5. Web Technology CSS Advanced
 
Css3
Css3Css3
Css3
 
Doing more with LESS
Doing more with LESSDoing more with LESS
Doing more with LESS
 
HTML5: The Future of Web Development with IE9, IE10 and Windows 8
HTML5: The Future of Web Development with IE9, IE10 and Windows 8HTML5: The Future of Web Development with IE9, IE10 and Windows 8
HTML5: The Future of Web Development with IE9, IE10 and Windows 8
 
Introduction to the rust programming language
Introduction to the rust programming languageIntroduction to the rust programming language
Introduction to the rust programming language
 
Fasten RWD Development with Sass
Fasten RWD Development with SassFasten RWD Development with Sass
Fasten RWD Development with Sass
 
Css
CssCss
Css
 
Css
CssCss
Css
 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet ppt
 

More from Peter Gasston (7)

Web Components: What, Why, How, and When
Web Components: What, Why, How, and WhenWeb Components: What, Why, How, and When
Web Components: What, Why, How, and When
 
CSS3 With A Safety Net - Sudweb 2012
CSS3 With A Safety Net - Sudweb 2012CSS3 With A Safety Net - Sudweb 2012
CSS3 With A Safety Net - Sudweb 2012
 
The CSS3 of Tomorrow (Version 2)
The CSS3 of Tomorrow (Version 2)The CSS3 of Tomorrow (Version 2)
The CSS3 of Tomorrow (Version 2)
 
The Home of the Future: CSS Layouts
The Home of the Future: CSS LayoutsThe Home of the Future: CSS Layouts
The Home of the Future: CSS Layouts
 
The CSS3 of Tomorrow
The CSS3 of TomorrowThe CSS3 of Tomorrow
The CSS3 of Tomorrow
 
A Sensational Exposé With Bewildering Demonstrations
A Sensational Exposé With Bewildering DemonstrationsA Sensational Exposé With Bewildering Demonstrations
A Sensational Exposé With Bewildering Demonstrations
 
The Top 10 Best Biases
The Top 10 Best BiasesThe Top 10 Best Biases
The Top 10 Best Biases
 

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
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+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)

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 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
+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...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 

CSS: The Boring Bits