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
オープンソースAIとは何か? --「オープンソースAIの定義 v1.0」詳細解説
shujisado
10
1.1k
複雑なState管理からの脱却
sansantech
PRO
1
150
CDCL による厳密解法を採用した MILP ソルバー
imai448
3
140
10XにおけるData Contractの導入について: Data Contract事例共有会
10xinc
6
660
マルチモーダル / AI Agent / LLMOps 3つの技術トレンドで理解するLLMの今後の展望
hirosatogamo
37
12k
rootlessコンテナのすゝめ - 研究室サーバーでもできる安全なコンテナ管理
kitsuya0828
3
390
障害対応指揮の意思決定と情報共有における価値観 / Waroom Meetup #2
arthur1
5
480
Introduction to Works of ML Engineer in LY Corporation
lycorp_recruit_jp
0
140
ドメインの本質を掴む / Get the essence of the domain
sinsoku
2
160
アジャイルでの品質の進化 Agile in Motion vol.1/20241118 Hiroyuki Sato
shift_evolve
0
170
生成AIが変えるデータ分析の全体像
ishikawa_satoru
0
170
Platform Engineering for Software Developers and Architects
syntasso
1
520
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
What's new in Ruby 2.0
geeforr
343
31k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
We Have a Design System, Now What?
morganepeng
50
7.2k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
Why Our Code Smells
bkeepers
PRO
334
57k
Building Your Own Lightsaber
phodgson
103
6.1k
BBQ
matthewcrist
85
9.3k
Navigating Team Friction
lara
183
14k
Six Lessons from altMBA
skipperchong
27
3.5k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
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.