SlideShare uma empresa Scribd logo
1 de 32
New CSS Features
Agenda
NEW CSS FEATURES
• CSS Variables
• CSS Layout Case
• CSS Grid
• Feature Queries
CSS Variables
NEW CSS FEATURES
CSS variables are entities defined by CSS authors that contain
specific values to be reused throughout a document.
CSS Variables
NEW CSS FEATURES
Declaring a variable:
Using the variable:
The Syntax
element {
--main-bg-color: brown;
}
element {
background-color: var(--main-bg-color);
}
CSS variables are case-sensitive, and can not be empty.
"Invalid at computed-value time" and will default to initial
--foo:; is invalid
--foo: ; is valid
--foo ≠ --FOO
element {
--main-bg-color:42deg;
background-color: var(--main-bg-color);
}
//(invalid) = initial = transparent
CSS Variables
NEW CSS FEATURES
CSS variables can be set with fallbacks if the variable is not set.
CSS variables can not be concatenated.
Cont.
var(--color1, var(--color2, var(--color3, red)))
// No version of this will work
element {
--height: 100;
height : var(--height) + px;
}
CSS Variables
NEW CSS FEATURES
Browser Support
NEW CSS FEATURES
Web Layout
NEW CSS FEATURES
Web Layout
Web layouts re broken.
We’ve just refined
how we break them.
NEW CSS FEATURES
Web Layout
.container
.main-content .sidebar
NEW CSS FEATURES
Web Layout
.wrap
.main-content
.sidebar
.wrap {
border: 2px solid red;
}
.main-content {
background: blue;
}
.sidebar {
background: green;
}
NEW CSS FEATURES
Web Layout
.wrap
.main-content .sidebar
.wrap {
border: 2px solid red;
}
.main-content {
background: blue;
width: 45%;
float:left;
}
.sidebar {
background: green;
width: 45%;
float:right;
}
NEW CSS FEATURES
Web Layout
.wrap
.main-content .sidebar
.wrap {
border: 2px solid red;
}
.main-content {
background: blue;
width: 45%;
float:left;
}
.sidebar {
background: green;
width: 45%;
float:right;
}
/*Clearfix*/
.wrap:after {
content: "";
display: table;
clear:both;
}
NEW CSS FEATURES
Web Layout
.wrap
.main-content .sidebar
.wrap {
display: flex;
justify-content: space-between;
border: 2px solid red;
}
.main-content {
background: blue;
width: 45%;
}
.sidebar {
background: green;
width: 45%;
}
NEW CSS FEATURES
Web Layout
.wrap
.main-content .sidebar
.other-content
NEW CSS FEATURES
Web Layout
.wrap
.main-content .sidebar
.other-content
.wrap {
display: flex;
justify-content: space-between;
border: 2px solid red;
}
.container {
width: 45%;
}
.main-content {
background: blue;
}
.main-content {
background: purple;
}
.sidebar {
width: 45%;
background: green;
}
.container
NEW CSS FEATURES
Web Layout
.wrap
.main-content .sidebar
.other-content
.container
This is hack.
Float and flex force us to create
HTML clutter in the form of
wrappers like the .container
Element in the example
NEW CSS FEATURES
Web Layout
<h1 class="page-title"></h1>
</div class="container">
<main></main>
<div class="sidebar">
<header></header>
<section>
<aside></aside>
<footer></footer>
</section>
</div><!--sidebar-->
</div><!--container-->
NEW CSS FEATURES
Web Layout
<header></header>
<h1 class="page-title"></h1>
<main></main>
<aside></aside>
<footer></footer>
<h1 class="page-title"></h1>
</div class="container">
<main></main>
<div class="sidebar">
<header></header>
<section>
<aside></aside>
<footer></footer>
</section>
</div><!--sidebar-->
</div><!--container-->
NEW CSS FEATURES
Web Layout
Solution:
Two-dimensional
layout-in tool to
separate content and
presentation.
Problem:
Current tools for web
layout are content-out
and one-dimensional.
CSS Grid Layout
Grid terminology
• Grid container
• Grid item
• Grid line
• Grid cell
• Grid track
• Grid area
• Grid Gap
NEW CSS FEATURES
NEW CSS FEATURES
CSS Grid
<header
class="masthead"></header>
<h1 class="page-title"></h1>
<main class="main-content"></main>
<aside class="sidebar"></aside>
<footer class="footer"></footer>
Grid container
Element containing a grid,
defined by setting
display: grid;
<div class="site">
</div><!--site-->
NEW CSS FEATURES
CSS Grid
<header
class="masthead"></header>
<h1 class="page-title"></h1>
<main class="main-content"></main>
<aside class="sidebar"></aside>
<footer class="footer"></footer>
Grid item
Element that is a direct
descendant of grid
container.
<div class="site">
</div><!--site-->
<header class="masthead"></header>
NEW CSS FEATURES
CSS Grid
Grid line
Horizontal (row) or
vertical (column) line
separating the grid into
sections.
NEW CSS FEATURES
CSS Grid
Grid cell
The space between two
adjacent row and two
adjacent column grid
lines.
NEW CSS FEATURES
CSS Grid
Grid area
The total space
surrounded by four grid
lines. A grid area may be
comprised of any number
of grid cells.
NEW CSS FEATURES
CSS Grid
Grid track
The space between two
adjacent grid lines.
NEW CSS FEATURES
CSS Grid
Grid gap
• Empty space between
grid tracks.
• Commonly called
gutters.
NEW CSS FEATURES
CSS Grid
Grid gap
• Empty space between
grid tracks.
• Commonly called
gutters.
NEW CSS FEATURES
CSS Grid
Demo
CSS Grid Layout
• Browser Support
NEW CSS FEATURES
Feature Queries : the @support rule
NEW CSS FEATURES
• The @supports CSS at-rule lets you specify declarations that depend on a browser's support for one or more specific CSS features.
• This is called a feature query.
• The rule may be placed at the top level of your code or nested inside any other conditional group at-rule.
@support not ( display: flex ) {
.block { display: table; }
}
Feature Queries : the @support rule
NEW CSS FEATURES
Browser support

Mais conteúdo relacionado

Mais procurados

Using LESS, the CSS Preprocessor: J and Beyond 2013
Using LESS, the CSS Preprocessor: J and Beyond 2013Using LESS, the CSS Preprocessor: J and Beyond 2013
Using LESS, the CSS Preprocessor: J and Beyond 2013Andrea Tarr
 
Tables and forms with HTML, CSS
Tables and forms with HTML, CSS  Tables and forms with HTML, CSS
Tables and forms with HTML, CSS Yaowaluck Promdee
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style SheetsSenthil Kumar
 
Introduction to SASS
Introduction to SASSIntroduction to SASS
Introduction to SASSJon Dean
 
Deep dive into sass
Deep dive into sassDeep dive into sass
Deep dive into sassKnoldus Inc.
 
CSS Preprocessors: LESS is more or look SASS-y trying
CSS Preprocessors: LESS is more or look SASS-y tryingCSS Preprocessors: LESS is more or look SASS-y trying
CSS Preprocessors: LESS is more or look SASS-y tryingJames Cryer
 

Mais procurados (14)

Using LESS, the CSS Preprocessor: J and Beyond 2013
Using LESS, the CSS Preprocessor: J and Beyond 2013Using LESS, the CSS Preprocessor: J and Beyond 2013
Using LESS, the CSS Preprocessor: J and Beyond 2013
 
Cmsc 100 xhtml and css
Cmsc 100 xhtml and cssCmsc 100 xhtml and css
Cmsc 100 xhtml and css
 
Tables and forms with HTML, CSS
Tables and forms with HTML, CSS  Tables and forms with HTML, CSS
Tables and forms with HTML, CSS
 
Css frameworks
Css frameworksCss frameworks
Css frameworks
 
Less css
Less cssLess css
Less css
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
 
03html Css
03html Css03html Css
03html Css
 
Sass
SassSass
Sass
 
PostCss
PostCssPostCss
PostCss
 
Web Development
Web DevelopmentWeb Development
Web Development
 
LESS
LESSLESS
LESS
 
Introduction to SASS
Introduction to SASSIntroduction to SASS
Introduction to SASS
 
Deep dive into sass
Deep dive into sassDeep dive into sass
Deep dive into sass
 
CSS Preprocessors: LESS is more or look SASS-y trying
CSS Preprocessors: LESS is more or look SASS-y tryingCSS Preprocessors: LESS is more or look SASS-y trying
CSS Preprocessors: LESS is more or look SASS-y trying
 

Semelhante a New css features

CSS Grid Changes Everything About Web Layouts: WordCamp Europe 2017
CSS Grid Changes Everything About Web Layouts: WordCamp Europe 2017CSS Grid Changes Everything About Web Layouts: WordCamp Europe 2017
CSS Grid Changes Everything About Web Layouts: WordCamp Europe 2017Morten Rand-Hendriksen
 
BEM Methodology — @Frontenders Ticino —17/09/2014
BEM Methodology — @Frontenders Ticino —17/09/2014BEM Methodology — @Frontenders Ticino —17/09/2014
BEM Methodology — @Frontenders Ticino —17/09/2014vzaccaria
 
Object-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSS
Object-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSSObject-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSS
Object-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSSLi-Wei Lu
 
LIS3353 SP12 Week 13
LIS3353 SP12 Week 13LIS3353 SP12 Week 13
LIS3353 SP12 Week 13Amanda Case
 
Css for Development
Css for DevelopmentCss for Development
Css for Developmenttsengsite
 
From CSS to Sass in WordPress
From CSS to Sass in WordPressFrom CSS to Sass in WordPress
From CSS to Sass in WordPressJames Steinbach
 
Html Css
Html CssHtml Css
Html Csspumas26
 
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.pptwaxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.pptIsmaciil2
 
IP - Lecture 6, 7 Chapter-3 (3).ppt
IP - Lecture 6, 7 Chapter-3 (3).pptIP - Lecture 6, 7 Chapter-3 (3).ppt
IP - Lecture 6, 7 Chapter-3 (3).pptkassahungebrie
 
9- Learn CSS Fundamentals / Pseudo-classes
9- Learn CSS Fundamentals / Pseudo-classes9- Learn CSS Fundamentals / Pseudo-classes
9- Learn CSS Fundamentals / Pseudo-classesIn a Rocket
 
Create SASSy web parts in SPFx
Create SASSy web parts in SPFxCreate SASSy web parts in SPFx
Create SASSy web parts in SPFxStefan Bauer
 
Html and css easy steps
Html and css easy stepsHtml and css easy steps
Html and css easy stepsBiswa Ranjan
 
Introduction to css by programmerblog.net
Introduction to css by programmerblog.netIntroduction to css by programmerblog.net
Introduction to css by programmerblog.netProgrammer Blog
 
TIBCO General Interface - CSS Guide
TIBCO General Interface - CSS GuideTIBCO General Interface - CSS Guide
TIBCO General Interface - CSS GuideRohan Chandane
 

Semelhante a New css features (20)

CSS Grid Changes Everything About Web Layouts: WordCamp Europe 2017
CSS Grid Changes Everything About Web Layouts: WordCamp Europe 2017CSS Grid Changes Everything About Web Layouts: WordCamp Europe 2017
CSS Grid Changes Everything About Web Layouts: WordCamp Europe 2017
 
BEM Methodology — @Frontenders Ticino —17/09/2014
BEM Methodology — @Frontenders Ticino —17/09/2014BEM Methodology — @Frontenders Ticino —17/09/2014
BEM Methodology — @Frontenders Ticino —17/09/2014
 
Object-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSS
Object-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSSObject-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSS
Object-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSS
 
LIS3353 SP12 Week 13
LIS3353 SP12 Week 13LIS3353 SP12 Week 13
LIS3353 SP12 Week 13
 
Css for Development
Css for DevelopmentCss for Development
Css for Development
 
From CSS to Sass in WordPress
From CSS to Sass in WordPressFrom CSS to Sass in WordPress
From CSS to Sass in WordPress
 
Html Css
Html CssHtml Css
Html Css
 
Class15
Class15Class15
Class15
 
html-css
html-csshtml-css
html-css
 
css1.ppt
css1.pptcss1.ppt
css1.ppt
 
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.pptwaxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
 
IP - Lecture 6, 7 Chapter-3 (3).ppt
IP - Lecture 6, 7 Chapter-3 (3).pptIP - Lecture 6, 7 Chapter-3 (3).ppt
IP - Lecture 6, 7 Chapter-3 (3).ppt
 
9- Learn CSS Fundamentals / Pseudo-classes
9- Learn CSS Fundamentals / Pseudo-classes9- Learn CSS Fundamentals / Pseudo-classes
9- Learn CSS Fundamentals / Pseudo-classes
 
Create SASSy web parts in SPFx
Create SASSy web parts in SPFxCreate SASSy web parts in SPFx
Create SASSy web parts in SPFx
 
[Bauer] SASSy web parts with SPFX
[Bauer] SASSy web parts with SPFX[Bauer] SASSy web parts with SPFX
[Bauer] SASSy web parts with SPFX
 
Html css
Html cssHtml css
Html css
 
Html and css easy steps
Html and css easy stepsHtml and css easy steps
Html and css easy steps
 
Introduction to css by programmerblog.net
Introduction to css by programmerblog.netIntroduction to css by programmerblog.net
Introduction to css by programmerblog.net
 
Css introduction
Css  introductionCss  introduction
Css introduction
 
TIBCO General Interface - CSS Guide
TIBCO General Interface - CSS GuideTIBCO General Interface - CSS Guide
TIBCO General Interface - CSS Guide
 

Último

Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 

Último (20)

Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 

New css features

  • 2. Agenda NEW CSS FEATURES • CSS Variables • CSS Layout Case • CSS Grid • Feature Queries
  • 3. CSS Variables NEW CSS FEATURES CSS variables are entities defined by CSS authors that contain specific values to be reused throughout a document.
  • 4. CSS Variables NEW CSS FEATURES Declaring a variable: Using the variable: The Syntax element { --main-bg-color: brown; } element { background-color: var(--main-bg-color); } CSS variables are case-sensitive, and can not be empty. "Invalid at computed-value time" and will default to initial --foo:; is invalid --foo: ; is valid --foo ≠ --FOO element { --main-bg-color:42deg; background-color: var(--main-bg-color); } //(invalid) = initial = transparent
  • 5. CSS Variables NEW CSS FEATURES CSS variables can be set with fallbacks if the variable is not set. CSS variables can not be concatenated. Cont. var(--color1, var(--color2, var(--color3, red))) // No version of this will work element { --height: 100; height : var(--height) + px; }
  • 6. CSS Variables NEW CSS FEATURES Browser Support
  • 8. NEW CSS FEATURES Web Layout Web layouts re broken. We’ve just refined how we break them.
  • 9. NEW CSS FEATURES Web Layout .container .main-content .sidebar
  • 10. NEW CSS FEATURES Web Layout .wrap .main-content .sidebar .wrap { border: 2px solid red; } .main-content { background: blue; } .sidebar { background: green; }
  • 11. NEW CSS FEATURES Web Layout .wrap .main-content .sidebar .wrap { border: 2px solid red; } .main-content { background: blue; width: 45%; float:left; } .sidebar { background: green; width: 45%; float:right; }
  • 12. NEW CSS FEATURES Web Layout .wrap .main-content .sidebar .wrap { border: 2px solid red; } .main-content { background: blue; width: 45%; float:left; } .sidebar { background: green; width: 45%; float:right; } /*Clearfix*/ .wrap:after { content: ""; display: table; clear:both; }
  • 13. NEW CSS FEATURES Web Layout .wrap .main-content .sidebar .wrap { display: flex; justify-content: space-between; border: 2px solid red; } .main-content { background: blue; width: 45%; } .sidebar { background: green; width: 45%; }
  • 14. NEW CSS FEATURES Web Layout .wrap .main-content .sidebar .other-content
  • 15. NEW CSS FEATURES Web Layout .wrap .main-content .sidebar .other-content .wrap { display: flex; justify-content: space-between; border: 2px solid red; } .container { width: 45%; } .main-content { background: blue; } .main-content { background: purple; } .sidebar { width: 45%; background: green; } .container
  • 16. NEW CSS FEATURES Web Layout .wrap .main-content .sidebar .other-content .container This is hack. Float and flex force us to create HTML clutter in the form of wrappers like the .container Element in the example
  • 17. NEW CSS FEATURES Web Layout <h1 class="page-title"></h1> </div class="container"> <main></main> <div class="sidebar"> <header></header> <section> <aside></aside> <footer></footer> </section> </div><!--sidebar--> </div><!--container-->
  • 18. NEW CSS FEATURES Web Layout <header></header> <h1 class="page-title"></h1> <main></main> <aside></aside> <footer></footer> <h1 class="page-title"></h1> </div class="container"> <main></main> <div class="sidebar"> <header></header> <section> <aside></aside> <footer></footer> </section> </div><!--sidebar--> </div><!--container-->
  • 19. NEW CSS FEATURES Web Layout Solution: Two-dimensional layout-in tool to separate content and presentation. Problem: Current tools for web layout are content-out and one-dimensional.
  • 20. CSS Grid Layout Grid terminology • Grid container • Grid item • Grid line • Grid cell • Grid track • Grid area • Grid Gap NEW CSS FEATURES
  • 21. NEW CSS FEATURES CSS Grid <header class="masthead"></header> <h1 class="page-title"></h1> <main class="main-content"></main> <aside class="sidebar"></aside> <footer class="footer"></footer> Grid container Element containing a grid, defined by setting display: grid; <div class="site"> </div><!--site-->
  • 22. NEW CSS FEATURES CSS Grid <header class="masthead"></header> <h1 class="page-title"></h1> <main class="main-content"></main> <aside class="sidebar"></aside> <footer class="footer"></footer> Grid item Element that is a direct descendant of grid container. <div class="site"> </div><!--site--> <header class="masthead"></header>
  • 23. NEW CSS FEATURES CSS Grid Grid line Horizontal (row) or vertical (column) line separating the grid into sections.
  • 24. NEW CSS FEATURES CSS Grid Grid cell The space between two adjacent row and two adjacent column grid lines.
  • 25. NEW CSS FEATURES CSS Grid Grid area The total space surrounded by four grid lines. A grid area may be comprised of any number of grid cells.
  • 26. NEW CSS FEATURES CSS Grid Grid track The space between two adjacent grid lines.
  • 27. NEW CSS FEATURES CSS Grid Grid gap • Empty space between grid tracks. • Commonly called gutters.
  • 28. NEW CSS FEATURES CSS Grid Grid gap • Empty space between grid tracks. • Commonly called gutters.
  • 29. NEW CSS FEATURES CSS Grid Demo
  • 30. CSS Grid Layout • Browser Support NEW CSS FEATURES
  • 31. Feature Queries : the @support rule NEW CSS FEATURES • The @supports CSS at-rule lets you specify declarations that depend on a browser's support for one or more specific CSS features. • This is called a feature query. • The rule may be placed at the top level of your code or nested inside any other conditional group at-rule. @support not ( display: flex ) { .block { display: table; } }
  • 32. Feature Queries : the @support rule NEW CSS FEATURES Browser support

Notas do Editor

  1. css variables, not to be confused with less and sass variables, completely different thing.
  2. css variables are basically custom property that start with double dash. css property can only contain letters and dashes css variables are live..can be updated from anywhere…wether inline or js…
  3. Framework to fix.. All framework take htm apply js and move html around the document. For accessibilty reason whole document is jumlbled that is not good. It means leaning on external techn
  4. Web layout the way we have been doing since beginning of web time has always been broken. Al we have doing is entire hack to refine how we break the layout. So we started with table frame layer float and clear then flex..all wat we have doing is
  5. Consider this super simple example
  6. If u look at markup…
  7. -
  8. -This is bunch of extra stuff just to do our thing.