SlideShare a Scribd company logo
The Near Future of CSS
Rachel Andrew
Rachel Andrew
» https://rachelandrew.co.uk
» https://grabaperch.com
» @rachelandrew
» Invited Expert to the CSS Working Group
» Google Developer Expert
Box Alignment Level 3
This is the vertical centering
module!
Centre the content of .box
.box {
display: flex;
align-items: center;
justify-content: center;
}
<div class="box">
<img alt="balloon" src="square-balloon.jpg">
</div>
http://codepen.io/rachelandrew/pen/XKaZWm
The Near Future of CSS
CSS Box Alignment Level 3
"The box alignment properties in CSS are a set of 6 properties that
control alignment of boxes within other boxes."
-- https://drafts.csswg.org/css-align/
CSS Box Alignment Level 3
Defines:
» justify-content
» align-content
» justify-self
» align-self
» justify-items
» align-items
The Near Future of CSS
.wrapper {
display: flex;
}
.wrapper li {
min-width: 1%;
flex: 1 0 25%;
}
.wrapper li:nth-child(2) {
align-self: center;
}
.wrapper li:nth-child(3) {
align-self: flex-start;
}
.wrapper li:nth-child(4) {
align-self: flex-end;
}
http://codepen.io/rachelandrew/pen/RavbmN
The Box Alignment spec defines
how these properties work in other
layout methods
.wrapper {
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
}
.wrapper li {
min-width: 1%;
}
.wrapper li:nth-child(2) {
align-self: center;
}
.wrapper li:nth-child(3) {
align-self: start;
}
.wrapper li:nth-child(4) {
align-self: end;
}
http://codepen.io/rachelandrew/pen/jqdNoL
CSS Grid Layout
"Unlike Flexbox, however, which is single-axis–oriented, Grid Layout is
optimized for 2-dimensional layouts: those in which alignment of
content is desired in both dimensions."
-- https://drafts.csswg.org/css-grid/
Defining a simple grid
.cards {
display:grid;
grid-template-columns: 1fr 1fr 1fr;
grid-gap: 10px;
}
The fr unit
Defines a fraction unit - a fraction of the available space.
Works in a similar way to using flex-grow with a positive value.
The Near Future of CSS
Wrapped Flexbox Layout
.cards {
display:flex;
flex-wrap: wrap;
}
.card {
flex: 1 1 250px;
margin: 5px;
}
http://codepen.io/rachelandrew/pen/Gqvrwz
The Near Future of CSS
.cards {
display:grid;
grid-template-columns: repeat(auto-fill, minmax(200px,1fr));
grid-gap: 10px;
}
http://codepen.io/rachelandrew/pen/VjzrgG
The Near Future of CSS
.cards {
display:grid;
grid-template-columns: repeat(12,1fr);
grid-gap: 10px;
}
.card:nth-child(1) { grid-column: 1 / 4; }
.card:nth-child(2) { grid-column: 1 / 4; grid-row: 2; }
.card:nth-child(3) { grid-column: 9 / 13; grid-row: 2; }
.card:nth-child(4) { grid-column: 4 / 10; }
.card:nth-child(5) { grid-column: 10 / 13; }
http://codepen.io/rachelandrew/pen/XKaZwa
The Near Future of CSS
.card:nth-child(1) { grid-area: side1; }
.card:nth-child(2) { grid-area: side2; }
.card:nth-child(3) { grid-area: side3; }
.card:nth-child(4) { grid-area: middle1; }
.card:nth-child(5) { grid-area: side4; }
.cards {
display:grid;
grid-template-columns: repeat(4, 1fr);
grid-gap: 10px;
grid-template-areas:
"side1 middle1 middle1 side3"
"side2 ....... ....... side4";
}
The Near Future of CSS
The Near Future of CSS
Lots of Grid Examples
http://gridbyexample.com
CSS Shapes
"CSS Shapes describe geometric shapes for use in CSS. For Level 1, CSS
Shapes can be applied to floats. A circle shape on a float will cause inline
content to wrap around the circle shape instead of the float’s bounding
box."
-- https://drafts.csswg.org/css-shapes/
The Near Future of CSS
A simple circle
.balloon {
float: left;
width: 429px;
shape-outside: circle(50%);
}
<div class="box">
<img class="balloon" src="round-balloon.png" alt="balloon">
<p>...</p>
</div>
http://codepen.io/rachelandrew/pen/KrvyQq
The Near Future of CSS
Floating generated content to use
Shapes
.box::before {
content: "";
display: block;
float: left;
width: 429px;
height: 409px;
shape-outside: circle(50%);
}
http://codepen.io/rachelandrew/pen/mErqxy
The Near Future of CSS
Shapes and clip-path
.balloon {
float: right;
width: 640px;
height: 427px;
shape-outside: ellipse(33% 50% at 460px);
-webkit-clip-path: ellipse(28% 50% at 460px);
clip-path: ellipse(28% 50% at 460px);
}
http://codepen.io/rachelandrew/pen/xOLPLa/
The Near Future of CSS
CSS Feature Queries with
@supports
Like Modernizr but in native CSS.
"The ‘@supports’ rule is a conditional group rule whose condition tests
whether the user agent supports CSS property:value pairs."
-- https://www.w3.org/TR/css3-conditional/#at-supports
The Near Future of CSS
Does my browser support
display: flex?
@supports (display: flex) {
.has-flex {
display: block;
background-color: #0084AD;
color: #fff;
}
}
Does my browser support
display: grid?
@supports (display: grid) {
.has-grid {
display: block;
background-color: #284C6D;
color: #fff;
}
}
Test more than 1 thing
@supports ((display: grid) and (shape-outside: circle())) {
.has-grid-shapes {
display: block;
background-color: #666;
color: #fff;
}
}
http://codepen.io/rachelandrew/pen/RRkWKX/
.balloon {
border: 1px solid #999;
padding: 2px;
}
@supports ((shape-outside: ellipse()) and ((clip-path: ellipse()) or (-webkit-clip-path:ellipse()))) {
.balloon {
border: none;
padding: 0;
float: right;
width: 640px;
min-width: 640px;
height: 427px;
shape-outside: ellipse(33% 50% at 460px);
-webkit-clip-path: ellipse(28% 50% at 460px);
clip-path: ellipse(28% 50% at 460px);
}
}
The Near Future of CSS
The Near Future of CSS
Using feature queries
» Write the css for older browsers
» Inside the feature query reset those properties
» Inside the feature query write your new CSS
http://codepen.io/rachelandrew/pen/vKJmXR
CSS Custom Properties
(CSS Variables!)
CSS Custom Properties
"This module introduces a family of custom author-defined properties
known collectively as custom properties, which allow an author to
assign arbitrary values to a property with an author-chosen name, and
the var() function, which allow an author to then use those values in
other properties elsewhere in the document."
-- https://drafts.csswg.org/css-variables/
:root {
--primary: blue;
--secondary: orange;
}
h1 {
color: var(--primary);
}
http://codepen.io/rachelandrew/pen/qNXpEZ
Testing for custom properties
:root {
--primary: blue;
--secondary: orange;
}
@supports (--primary: blue) {
h1 {
color: var(--primary);
}
h2 {
color: var(--secondary);
}
}
http://codepen.io/rachelandrew/pen/mErpZA
The Near Future of CSS
Getting Involved
CSS Specification discussion and
issues are on github
https://github.com/w3c/csswg-drafts
The Near Future of CSS
Raise issues with browsers
» Mozilla https://bugzilla.mozilla.org/
» Edge https://developer.microsoft.com/en-us/microsoft-edge/
platform/issues/
» Chrome https://bugs.chromium.org/p/chromium/issues/list
Request features
Directly request features where browsers give you the means to
do so.
Writing blog posts, presentations and demos also helps.
If we don’t ask we
don’t get
Make some noise for the new shiny!
Thank you!
@rachelandrew
https://cssgrid.me/melbjs

More Related Content

What's hot (20)

PDF
An Event Apart SF: CSS Grid Layout
Rachel Andrew
 
PDF
CSS3 - is everything we used to do wrong?
Russ Weakley
 
PDF
Looking Back to Move Forward: Building the Modern Web
Rachel Andrew
 
PDF
Compass, Sass, and the Enlightened CSS Developer
Wynn Netherland
 
KEY
Bringing sexy back to CSS: SASS/SCSS, LESS and Compass
Claudina Sarahe
 
KEY
Sass, Compass
Serg Diniovskiy
 
PDF
LESS
Joe Seifi
 
PPTX
Scalable and Modular CSS FTW!
FITC
 
PDF
Rapid Prototyping
Even Wu
 
PDF
Landing Pages 101
Celeste Horgan
 
PDF
Preprocessor presentation
Mario Noble
 
PDF
Think Vitamin CSS
Nathan Smith
 
PDF
CSSプリプロセッサの取扱説明書
拓樹 谷
 
PPT
CSS Preprocessors: LESS is more or look SASS-y trying
James Cryer
 
KEY
Taming CSS Selectors
Nicole Sullivan
 
KEY
Sass, Compass and the new tools - Open Web Camp IV
Dirk Ginader
 
PDF
Sassive Aggressive: Using Sass to Make Your Life Easier (Refresh Boston Version)
Adam Darowski
 
PDF
CSS Reset
Russ Weakley
 
PDF
Sass
Bram Verdyck
 
PPTX
SASS is more than LESS
Itai Koren
 
An Event Apart SF: CSS Grid Layout
Rachel Andrew
 
CSS3 - is everything we used to do wrong?
Russ Weakley
 
Looking Back to Move Forward: Building the Modern Web
Rachel Andrew
 
Compass, Sass, and the Enlightened CSS Developer
Wynn Netherland
 
Bringing sexy back to CSS: SASS/SCSS, LESS and Compass
Claudina Sarahe
 
Sass, Compass
Serg Diniovskiy
 
LESS
Joe Seifi
 
Scalable and Modular CSS FTW!
FITC
 
Rapid Prototyping
Even Wu
 
Landing Pages 101
Celeste Horgan
 
Preprocessor presentation
Mario Noble
 
Think Vitamin CSS
Nathan Smith
 
CSSプリプロセッサの取扱説明書
拓樹 谷
 
CSS Preprocessors: LESS is more or look SASS-y trying
James Cryer
 
Taming CSS Selectors
Nicole Sullivan
 
Sass, Compass and the new tools - Open Web Camp IV
Dirk Ginader
 
Sassive Aggressive: Using Sass to Make Your Life Easier (Refresh Boston Version)
Adam Darowski
 
CSS Reset
Russ Weakley
 
SASS is more than LESS
Itai Koren
 

Similar to The Near Future of CSS (20)

PDF
The Future of Frontend - what is new in CSS?
Rachel Andrew
 
PDF
Next-level CSS
Rachel Andrew
 
PDF
The Creative New World of CSS
Rachel Andrew
 
PDF
GOTO Berlin - You can use CSS for that
Rachel Andrew
 
PDF
What I discovered about layout vis CSS Grid
Rachel Andrew
 
PDF
But what about old browsers?
Rachel Andrew
 
PDF
Post-Modern CSS: Start learning CSS Grid, Flexbox and other new properties
Bryan Robinson
 
PDF
CSS Conf Budapest - New CSS Layout
Rachel Andrew
 
PDF
Fluent: Making Sense of the New CSS Layout
Rachel Andrew
 
PDF
ConFoo 2016: Making Sense of CSS Layout
Rachel Andrew
 
PDF
Evolution of CSS
Ecaterina Moraru (Valica)
 
PDF
View Source London: Solving Layout Problems with CSS Grid & Friends
Rachel Andrew
 
PDF
Flexbox, Grid and Sass
Seble Nigussie
 
PDF
Future Layout & Performance
Rachel Andrew
 
PPT
Tutorial0eesrtjfzjgxkgxkxxkxkgxkgxjffj3.ppt
narenkumar321q
 
PDF
AEA Chicago CSS Grid Layout
Rachel Andrew
 
PDF
Solving Layout Problems with CSS Grid & Friends - DevFest17
Rachel Andrew
 
PDF
Solving Layout Problems With CSS Grid and Friends
FITC
 
PDF
Solving Layout Problems with CSS Grid & Friends - WEBU17
Rachel Andrew
 
PDF
Solving Layout Problems with CSS Grid & Friends - NordicJS
Rachel Andrew
 
The Future of Frontend - what is new in CSS?
Rachel Andrew
 
Next-level CSS
Rachel Andrew
 
The Creative New World of CSS
Rachel Andrew
 
GOTO Berlin - You can use CSS for that
Rachel Andrew
 
What I discovered about layout vis CSS Grid
Rachel Andrew
 
But what about old browsers?
Rachel Andrew
 
Post-Modern CSS: Start learning CSS Grid, Flexbox and other new properties
Bryan Robinson
 
CSS Conf Budapest - New CSS Layout
Rachel Andrew
 
Fluent: Making Sense of the New CSS Layout
Rachel Andrew
 
ConFoo 2016: Making Sense of CSS Layout
Rachel Andrew
 
Evolution of CSS
Ecaterina Moraru (Valica)
 
View Source London: Solving Layout Problems with CSS Grid & Friends
Rachel Andrew
 
Flexbox, Grid and Sass
Seble Nigussie
 
Future Layout & Performance
Rachel Andrew
 
Tutorial0eesrtjfzjgxkgxkxxkxkgxkgxjffj3.ppt
narenkumar321q
 
AEA Chicago CSS Grid Layout
Rachel Andrew
 
Solving Layout Problems with CSS Grid & Friends - DevFest17
Rachel Andrew
 
Solving Layout Problems With CSS Grid and Friends
FITC
 
Solving Layout Problems with CSS Grid & Friends - WEBU17
Rachel Andrew
 
Solving Layout Problems with CSS Grid & Friends - NordicJS
Rachel Andrew
 
Ad

More from Rachel Andrew (20)

PDF
All Day Hey! Unlocking The Power of CSS Grid Layout
Rachel Andrew
 
PDF
SmashingConf SF: Unlocking the Power of CSS Grid Layout
Rachel Andrew
 
PDF
Unlocking the Power of CSS Grid Layout
Rachel Andrew
 
PDF
Into the Weeds of CSS Layout
Rachel Andrew
 
PDF
Graduating to Grid
Rachel Andrew
 
PDF
DevFest Nantes - Start Using CSS Grid Layout today
Rachel Andrew
 
PDF
Start Using CSS Grid Layout Today - RuhrJS
Rachel Andrew
 
PDF
404.ie: Solving Layout Problems with CSS Grid & Friends
Rachel Andrew
 
PDF
Web Summer Camp Keynote
Rachel Andrew
 
PDF
New CSS Layout Meets the Real World
Rachel Andrew
 
PDF
An Event Apart DC - New CSS Layout meets the Real World
Rachel Andrew
 
PDF
Perch, Patterns and Old Browsers
Rachel Andrew
 
PDF
Evergreen websites for Evergreen browsers
Rachel Andrew
 
PDF
Frontend United: Start using CSS Grid Layout today!
Rachel Andrew
 
PDF
Where does CSS come from?
Rachel Andrew
 
PDF
CSS Grid for html5j
Rachel Andrew
 
PDF
Grid and Flexbox - Smashing Conf SF
Rachel Andrew
 
PDF
An Event Apart Seattle - New CSS Layout Meets the Real World
Rachel Andrew
 
PDF
Render Conf: Start using CSS Grid Layout Today
Rachel Andrew
 
PDF
Laracon Online: Grid and Flexbox
Rachel Andrew
 
All Day Hey! Unlocking The Power of CSS Grid Layout
Rachel Andrew
 
SmashingConf SF: Unlocking the Power of CSS Grid Layout
Rachel Andrew
 
Unlocking the Power of CSS Grid Layout
Rachel Andrew
 
Into the Weeds of CSS Layout
Rachel Andrew
 
Graduating to Grid
Rachel Andrew
 
DevFest Nantes - Start Using CSS Grid Layout today
Rachel Andrew
 
Start Using CSS Grid Layout Today - RuhrJS
Rachel Andrew
 
404.ie: Solving Layout Problems with CSS Grid & Friends
Rachel Andrew
 
Web Summer Camp Keynote
Rachel Andrew
 
New CSS Layout Meets the Real World
Rachel Andrew
 
An Event Apart DC - New CSS Layout meets the Real World
Rachel Andrew
 
Perch, Patterns and Old Browsers
Rachel Andrew
 
Evergreen websites for Evergreen browsers
Rachel Andrew
 
Frontend United: Start using CSS Grid Layout today!
Rachel Andrew
 
Where does CSS come from?
Rachel Andrew
 
CSS Grid for html5j
Rachel Andrew
 
Grid and Flexbox - Smashing Conf SF
Rachel Andrew
 
An Event Apart Seattle - New CSS Layout Meets the Real World
Rachel Andrew
 
Render Conf: Start using CSS Grid Layout Today
Rachel Andrew
 
Laracon Online: Grid and Flexbox
Rachel Andrew
 
Ad

Recently uploaded (20)

PDF
introduction to computer hardware and sofeware
chauhanshraddha2007
 
PPTX
Agentic AI in Healthcare Driving the Next Wave of Digital Transformation
danielle hunter
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
PDF
Per Axbom: The spectacular lies of maps
Nexer Digital
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
PDF
Market Insight : ETH Dominance Returns
CIFDAQ
 
PPTX
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
Build with AI and GDG Cloud Bydgoszcz- ADK .pdf
jaroslawgajewski1
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
introduction to computer hardware and sofeware
chauhanshraddha2007
 
Agentic AI in Healthcare Driving the Next Wave of Digital Transformation
danielle hunter
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
Per Axbom: The spectacular lies of maps
Nexer Digital
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
Market Insight : ETH Dominance Returns
CIFDAQ
 
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
Build with AI and GDG Cloud Bydgoszcz- ADK .pdf
jaroslawgajewski1
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 

The Near Future of CSS

  • 1. The Near Future of CSS Rachel Andrew
  • 2. Rachel Andrew » https://rachelandrew.co.uk » https://grabaperch.com » @rachelandrew » Invited Expert to the CSS Working Group » Google Developer Expert
  • 3. Box Alignment Level 3 This is the vertical centering module!
  • 4. Centre the content of .box .box { display: flex; align-items: center; justify-content: center; } <div class="box"> <img alt="balloon" src="square-balloon.jpg"> </div> http://codepen.io/rachelandrew/pen/XKaZWm
  • 6. CSS Box Alignment Level 3 "The box alignment properties in CSS are a set of 6 properties that control alignment of boxes within other boxes." -- https://drafts.csswg.org/css-align/
  • 7. CSS Box Alignment Level 3 Defines: » justify-content » align-content » justify-self » align-self » justify-items » align-items
  • 9. .wrapper { display: flex; } .wrapper li { min-width: 1%; flex: 1 0 25%; } .wrapper li:nth-child(2) { align-self: center; } .wrapper li:nth-child(3) { align-self: flex-start; } .wrapper li:nth-child(4) { align-self: flex-end; } http://codepen.io/rachelandrew/pen/RavbmN
  • 10. The Box Alignment spec defines how these properties work in other layout methods
  • 11. .wrapper { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; } .wrapper li { min-width: 1%; } .wrapper li:nth-child(2) { align-self: center; } .wrapper li:nth-child(3) { align-self: start; } .wrapper li:nth-child(4) { align-self: end; } http://codepen.io/rachelandrew/pen/jqdNoL
  • 12. CSS Grid Layout "Unlike Flexbox, however, which is single-axis–oriented, Grid Layout is optimized for 2-dimensional layouts: those in which alignment of content is desired in both dimensions." -- https://drafts.csswg.org/css-grid/
  • 13. Defining a simple grid .cards { display:grid; grid-template-columns: 1fr 1fr 1fr; grid-gap: 10px; }
  • 14. The fr unit Defines a fraction unit - a fraction of the available space. Works in a similar way to using flex-grow with a positive value.
  • 16. Wrapped Flexbox Layout .cards { display:flex; flex-wrap: wrap; } .card { flex: 1 1 250px; margin: 5px; } http://codepen.io/rachelandrew/pen/Gqvrwz
  • 18. .cards { display:grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); grid-gap: 10px; } http://codepen.io/rachelandrew/pen/VjzrgG
  • 20. .cards { display:grid; grid-template-columns: repeat(12,1fr); grid-gap: 10px; } .card:nth-child(1) { grid-column: 1 / 4; } .card:nth-child(2) { grid-column: 1 / 4; grid-row: 2; } .card:nth-child(3) { grid-column: 9 / 13; grid-row: 2; } .card:nth-child(4) { grid-column: 4 / 10; } .card:nth-child(5) { grid-column: 10 / 13; } http://codepen.io/rachelandrew/pen/XKaZwa
  • 22. .card:nth-child(1) { grid-area: side1; } .card:nth-child(2) { grid-area: side2; } .card:nth-child(3) { grid-area: side3; } .card:nth-child(4) { grid-area: middle1; } .card:nth-child(5) { grid-area: side4; }
  • 23. .cards { display:grid; grid-template-columns: repeat(4, 1fr); grid-gap: 10px; grid-template-areas: "side1 middle1 middle1 side3" "side2 ....... ....... side4"; }
  • 26. Lots of Grid Examples http://gridbyexample.com
  • 27. CSS Shapes "CSS Shapes describe geometric shapes for use in CSS. For Level 1, CSS Shapes can be applied to floats. A circle shape on a float will cause inline content to wrap around the circle shape instead of the float’s bounding box." -- https://drafts.csswg.org/css-shapes/
  • 29. A simple circle .balloon { float: left; width: 429px; shape-outside: circle(50%); } <div class="box"> <img class="balloon" src="round-balloon.png" alt="balloon"> <p>...</p> </div> http://codepen.io/rachelandrew/pen/KrvyQq
  • 31. Floating generated content to use Shapes .box::before { content: ""; display: block; float: left; width: 429px; height: 409px; shape-outside: circle(50%); } http://codepen.io/rachelandrew/pen/mErqxy
  • 33. Shapes and clip-path .balloon { float: right; width: 640px; height: 427px; shape-outside: ellipse(33% 50% at 460px); -webkit-clip-path: ellipse(28% 50% at 460px); clip-path: ellipse(28% 50% at 460px); } http://codepen.io/rachelandrew/pen/xOLPLa/
  • 35. CSS Feature Queries with @supports Like Modernizr but in native CSS. "The ‘@supports’ rule is a conditional group rule whose condition tests whether the user agent supports CSS property:value pairs." -- https://www.w3.org/TR/css3-conditional/#at-supports
  • 37. Does my browser support display: flex? @supports (display: flex) { .has-flex { display: block; background-color: #0084AD; color: #fff; } }
  • 38. Does my browser support display: grid? @supports (display: grid) { .has-grid { display: block; background-color: #284C6D; color: #fff; } }
  • 39. Test more than 1 thing @supports ((display: grid) and (shape-outside: circle())) { .has-grid-shapes { display: block; background-color: #666; color: #fff; } } http://codepen.io/rachelandrew/pen/RRkWKX/
  • 40. .balloon { border: 1px solid #999; padding: 2px; } @supports ((shape-outside: ellipse()) and ((clip-path: ellipse()) or (-webkit-clip-path:ellipse()))) { .balloon { border: none; padding: 0; float: right; width: 640px; min-width: 640px; height: 427px; shape-outside: ellipse(33% 50% at 460px); -webkit-clip-path: ellipse(28% 50% at 460px); clip-path: ellipse(28% 50% at 460px); } }
  • 43. Using feature queries » Write the css for older browsers » Inside the feature query reset those properties » Inside the feature query write your new CSS http://codepen.io/rachelandrew/pen/vKJmXR
  • 45. CSS Custom Properties "This module introduces a family of custom author-defined properties known collectively as custom properties, which allow an author to assign arbitrary values to a property with an author-chosen name, and the var() function, which allow an author to then use those values in other properties elsewhere in the document." -- https://drafts.csswg.org/css-variables/
  • 46. :root { --primary: blue; --secondary: orange; } h1 { color: var(--primary); } http://codepen.io/rachelandrew/pen/qNXpEZ
  • 47. Testing for custom properties :root { --primary: blue; --secondary: orange; } @supports (--primary: blue) { h1 { color: var(--primary); } h2 { color: var(--secondary); } } http://codepen.io/rachelandrew/pen/mErpZA
  • 49. Getting Involved CSS Specification discussion and issues are on github https://github.com/w3c/csswg-drafts
  • 51. Raise issues with browsers » Mozilla https://bugzilla.mozilla.org/ » Edge https://developer.microsoft.com/en-us/microsoft-edge/ platform/issues/ » Chrome https://bugs.chromium.org/p/chromium/issues/list
  • 52. Request features Directly request features where browsers give you the means to do so. Writing blog posts, presentations and demos also helps.
  • 53. If we don’t ask we don’t get Make some noise for the new shiny!