Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
The ABCs of CSS You've Likely Never Used
Search
Alicia Sedlock
August 08, 2017
Technology
0
47
The ABCs of CSS You've Likely Never Used
That Conference 2017
Alicia Sedlock
August 08, 2017
Tweet
Share
More Decks by Alicia Sedlock
See All by Alicia Sedlock
How To Fights and Prevent Burnout
aliciasedlock
2
20k
The State of Front-End Testing
aliciasedlock
2
500
The Landscape of Front-End Testing
aliciasedlock
3
1.2k
You Can Make Games
aliciasedlock
1
120
Jumping Into Front-End Testing
aliciasedlock
3
150
Let's Get Testable: An Introduction to Unit Testing
aliciasedlock
4
810
Other Decks in Technology
See All in Technology
TSKaigi 2024 の登壇から広がったコミュニティ活動について
tsukuha
0
160
Microsoft Azure全冠になってみた ~アレを使い倒した者が試験を制す!?~/Obtained all Microsoft Azure certifications Those who use "that" to the full will win the exam! ?
yuj1osm
2
110
複雑性の高いオブジェクト編集に向き合う: プラガブルなReactフォーム設計
righttouch
PRO
0
120
NW-JAWS #14 re:Invent 2024(予選落ち含)で 発表された推しアップデートについて
nagisa53
0
270
LINE Developersプロダクト(LIFF/LINE Login)におけるフロントエンド開発
lycorptech_jp
PRO
0
120
LINEヤフーのフロントエンド組織・体制の紹介【24年12月】
lycorp_recruit_jp
0
530
re:Invent 2024 Innovation Talks(NET201)で語られた大切なこと
shotashiratori
0
320
KnowledgeBaseDocuments APIでベクトルインデックス管理を自動化する
iidaxs
1
270
LINEスキマニにおけるフロントエンド開発
lycorptech_jp
PRO
0
330
開発生産性向上! 育成を「改善」と捉えるエンジニア育成戦略
shoota
2
390
事業貢献を考えるための技術改善の目標設計と改善実績 / Targeted design of technical improvements to consider business contribution and improvement performance
oomatomo
0
100
How to be an AWS Community Builder | 君もAWS Community Builderになろう!〜2024 冬 CB募集直前対策編?!〜
coosuke
PRO
2
2.8k
Featured
See All Featured
The Language of Interfaces
destraynor
154
24k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
66k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Making Projects Easy
brettharned
116
5.9k
Making the Leap to Tech Lead
cromwellryan
133
9k
A designer walks into a library…
pauljervisheath
204
24k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
RailsConf 2023
tenderlove
29
940
How to Ace a Technical Interview
jacobian
276
23k
Reflections from 52 weeks, 52 projects
jeffersonlam
347
20k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
Transcript
The ABCs of CSS Properties You’ve Likely Never Used (Well,
Mostly!) Alicia Sedlock | @aliciability
Hi!
None
What’s your favorite CSS property or module?
None
There’s a lot of CSS I don't know.
A additive-symbols “… specify symbols when the value of a
counter system descriptor is additive.”
@counter-style custom-counter { system: additive; additive-symbol: I 1; } .list
{ list-style: custom-counter; }
@counter-style custom-counter { system: additive; additive-symbol: “>” 3; } .list
{ list-style: customer-counter; }
@counter-style custom-counter { system: additive; additive-symbol: “X” 10, “V” 5,
“I” 1; }
B ::backdrop “…is a box rendered immediately below any
element rendered in fullscreen mode.”
dialog { /* some dialog styles */ } dialog::backdrop {
background: black; opacity: .5; }
None
C caret-color “…sets the color of the caret in
an element.”
input.custom { caret-color: red; }
None
D :default “…represents any user interface element that is
the default among a group of similar elements.”
:default { background-color: pink; } <form> <input type=“button” value=“Button” />
<input type=“submit” /> <input type=“reset” /> </form>
None
E :empty “ ..any element that has no children
at all.”
div { background: lightblue; } div:empty {
background: pink; } <div><!— No content —></div> <div>Hello world!</div> <div> <!— No content —> </div>
None
F ::first-letter “…applies styles to the first letter of
the first line of a block-level element…”
p::first-letter { color: red; font-size: 3em; font-weight: bold;
} <p>The quick brown fox</p>
p::first-letter { color: red; font-size: 3em; font-weight: bold;
} <p> <img src=“fox.jpg” /> The quick brown fox </p>
G grayscale()
.fox1 { filter: grayscale(.95); } .fox2 { filter: grayscale(.55); }
.fox3 { filter: grayscale(.15); }
H hyphens “…how words should be hyphenated when text
wraps across multiple lines.”
<p>That Conference is extreme­ly rad!</p> p { hyphens: none; width:
55px; }
<p>That Conference is extreme­ly rad!</p> p { hyphens: manual; width:
55px; }
<p>That Conference is extreme­ly rad!</p> p { hyphens: auto; width:
55px; }
I :in-range “…matches when the value currently contained inside
an <input> element is inside the range limits specified by the min and max attributes.”
None
<label>Enter a number 1-10</label> <input type="number" min="1" max="10" value="12" />
input:in-range { background-color: rgba(0, 255, 0, 0.25); } input:out-of-range { background-color: rgba(255, 0, 0, 0.25); border: 2px solid red; }
None
J justify-content ONLY ENTRY “…defines how the browser distributes
space between and around content items along the main axis of their container.”
.container { display: flex; justify-content: <value>; } <div class=“container”> <div><!—
Content! —></div> <div><!— Content! —></div> <div><!— Content! —></div> </div>
.container { display: flex; justify-content: flex-start; } <div class=“container”> <div><!—
Content! —></div> <div><!— Content! —></div> <div><!— Content! —></div> </div>
.container { display: flex; justify-content: flex-end; } <div class=“container”> <div><!—
Content! —></div> <div><!— Content! —></div> <div><!— Content! —></div> </div>
.container { display: flex; justify-content: center; } <div class=“container”> <div><!—
Content! —></div> <div><!— Content! —></div> <div><!— Content! —></div> </div>
.container { display: flex; justify-content: space-around; } <div class=“container”> <div><!—
Content! —></div> <div><!— Content! —></div> <div><!— Content! —></div> </div>
.container { display: flex; justify-content: space-between; } <div class=“container”> <div><!—
Content! —></div> <div><!— Content! —></div> <div><!— Content! —></div> </div>
K khz “…represents a frequency dimension, such as the
pitch of a speaking voice.”
p.low { pitch: 105Hz; } em.high { pitch: 135Hz; }
L :lang “…matches elements based on the language the
element is determined to be in.”
<html lang=“en”></html>
<div lang=“en”>Hello, world!</div> <div lang=“fr”>Bonjour, le monde!</div> <div lang=“de”>Hallo, Welt!</div>
:lang(en) { border: 1px solid red; } :lang(fr) {
border: 1px solid blue; } :lang(de) { border: 1px solid black; }
M max-zoom “…sets the maximum zoom factor of a
document defined by the @viewport at- rule."
* { max-zoom: 150%; max-zoom: 2.0; }
N negative “…alters the representation of negative counter values,
by providing a way to specify symbols to be appended or prepended to the counter representation when the value is negative.”
<ul class="list" start="-3"> <li>One</li> <li>Two</li> <li>Three</li> <li>Four</li> <li>Five</li> </ul>
@counter-style negative-counter { system: numeric; symbols: "0" "1" "2" "3"
"4" "5" "6" "7" "8" "9"; negative: "(-" ")"; } .list { list-style: negative-counter; }
None
O object-fit “…how a replaced element, such as an
<img> or <video>, should be resized to fit its container.”
/* Base styles for examples */ img { width: 400px;
height: 500px; border: 5px solid pink; object-fit: <value>; }
None
None
None
None
None
P pointer-events “…specifies under what circumstances a particular graphic
element can become the target of mouse events.”
div { pointer-events: none; }
<div> Lorem ipsum dolor sit amet… </div> <div class="overlay"> I
am an overlay. Try selecting the text behind me. </div>
.overlay { position: absolute; top: 0; left: 40%; background: rgba(0,0,0,.75);
height: 200px; width: 250px; color: white; padding: 1em; pointer-events: auto; }
pointer-events: auto
pointer-events: none
pointer-events: visiblePainted; pointer-events: visibleFill; pointer-events: visibleStroke; pointer-events: visible; pointer-events: painted;
pointer-events: fill; pointer-events: stroke; pointer-events: all;
Q quotes “…indicates how user agents should render quotation
marks.”
<span>According to Groot, <q>I am Groot.</q>.</span> q { quotes:
"**" “**”; } q:before { content: open-quote; } q:after { content: close-quote; }
<span>Peter Quill says <q>I'm pretty sure the answer is <q>I
am Groot</q>.</q></span> q { quotes: ’””’ ‘“”’ “‘’” “‘’”; } q:before { content: open-quote; } q:after { content: close-quote; }
R revert “…rolls back the cascade so that a
property takes on the value it would have had if there were no styles in the current style origin"
None
S suffix “…specifies a symbol that will be appended
to the marker representation.”
<ul class="list"> <li>One</li> <li>Two</li> <li>Three</li> <li>Four</li> <li>Five</li> </ul>
@counter-style counter-options { system: fixed; symbols: A B C D
E F G; suffix: “) ”; } .list { list-style: counter-options; }
None
T tab-size “…used to customize the width of a
tab (U+0009) character.”
pre { tab-size: 4; /* integer values */ tab-size: 2;
tab-size: 10px; /* length values */ tab-size: 2em; }
<pre class=“default"> 	This is a line in pre! 	CSS is
a lot of fun. :) </pre> pre { border: 1px solid black; width: 500px; }
<pre class=“default"> 	This is a line in pre! 	CSS is
a lot of fun. :) </pre> pre { border: 1px solid black; width: 500px; tab-size: 4; }
<pre class=“default"> 	This is a line in pre! 	CSS is
a lot of fun. :) </pre> pre { border: 1px solid black; width: 500px; tab-size: 100px; }
U unset “…resets a property to its inherited value
if it inherits from its parent, and to its initial value if not.”
<p>I want to be blue text!</p> <div class="foo"> <p>I want
to be orange text :(</p> </div> <div class="bar"> <p>I don't want to be orange.</p> </div> .foo { color: orange; } .bar { color: green; } p { color: blue; } .bar p { color: unset; }
None
V vw/vh “Equal to 1% of the width/height of the
viewport's initial containing block.”
W will-change “…provides a way for authors to hint browsers
about the kind of changes to be expected on an element, so that the browser can set up appropriate optimizations ahead of time…”
div { will-change: transform; will-change: opacity; will-change: contents; /* custom-ident
*/ will-change: scroll-behavior; /* custom-ident */ }
A warning on will-change • Intended as a “last resort”
- don’t prematurely optimize • Meant to be used sparingly
X Y
* { xtreme: ‘heck-yeah’; }
* { yolo: 100; }
Z z-index “… specifies the z-order of a positioned element
and its descendants.”
What the heck do I do with this now?
Depth of CSS
Some of these things are • Experimental technology • In
working draft • In initial definition
Grid Layout Hype
P pointer-events “…specifies under what circumstances a particular graphic
element can become the target of mouse events.”
None
None
A Challenge
None
Thank you.