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
45
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
Adopting Jetpack Compose in Your Existing Project - GDG DevFest Bangkok 2024
akexorcist
0
110
DynamoDB でスロットリングが発生したとき/when_throttling_occurs_in_dynamodb_short
emiki
0
230
Oracle Cloud Infrastructureデータベース・クラウド:各バージョンのサポート期間
oracle4engineer
PRO
28
13k
The Rise of LLMOps
asei
7
1.6k
ドメインの本質を掴む / Get the essence of the domain
sinsoku
2
160
[CV勉強会@関東 ECCV2024 読み会] オンラインマッピング x トラッキング MapTracker: Tracking with Strided Memory Fusion for Consistent Vector HD Mapping (Chen+, ECCV24)
abemii
0
220
SSMRunbook作成の勘所_20241120
koichiotomo
2
150
テストコード品質を高めるためにMutation Testingライブラリ・Strykerを実戦導入してみた話
ysknsid25
7
2.6k
飲食店データの分析事例とそれを支えるデータ基盤
kimujun
0
110
OTelCol_TailSampling_and_SpanMetrics
gumamon
1
180
Flutterによる 効率的なAndroid・iOS・Webアプリケーション開発の事例
recruitengineers
PRO
0
110
マルチモーダル / AI Agent / LLMOps 3つの技術トレンドで理解するLLMの今後の展望
hirosatogamo
37
12k
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
52
13k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
What's in a price? How to price your products and services
michaelherold
243
12k
The Cult of Friendly URLs
andyhume
78
6k
The Invisible Side of Design
smashingmag
298
50k
Music & Morning Musume
bryan
46
6.2k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
KATA
mclloyd
29
14k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
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.