By Chen Hui Jing / @hj_chen
Join us on Discord.
Check out the code on GitHub.
❗️ Caution: The browser is only able to skip rendering work if you are also careful not to call any DOM API that forces some of rendering to occur on one of the skipped subtrees. If you're using content-visibility to improve performance, audit your code to make sure these APIs are not getting called.
–content-visibility: the new CSS property that boosts your rendering performance
CSS is awesome
contain: inline-size
Proposed in Thoughts on an implementable path forward for Container Queries
Most cards have blurbs. This is the epitome of a generic example. Oh well…
See the Pen Container Query Bookstore by Max Böck (@mxbck) on CodePen.
Container Query Bookstore by Max BöckcurrentColor
Icon by DaeSung LEE
accent-color
sRGB
HSL
LAB
okLAB
LCH
okLCH
sRGB
HSL
LAB
okLAB
LCH
okLCH
sRGB
HSL
LAB
okLAB
LCH
okLCH
sRGB
HSL
LAB
okLAB
LCH
okLCH
sRGB
HSL
LAB
okLAB
LCH
okLCH
sRGB
HSL
LAB
okLAB
LCH
okLCH
sRGB
HSL
LAB
okLAB
LCH
okLCH
sRGB
HSL
LAB
okLAB
LCH
okLCH
sRGB
HSL
LAB
okLAB
LCH
okLCH
sRGB
HSL
LAB
okLAB
LCH
okLCH
sRGB
HSL
LAB
okLAB
LCH
okLCH
Adapted from Gradient Color Spaces Exploration by Adam Argyle
Pending Firefox: Implement CSS Color 5 Relative Color Syntax
Pending Firefox: Implement CSS Color 5 Relative Color Syntax
50% darker
40% darker
30% darker
20% darker
10% darker
Base
10% lighter
20% lighter
30% lighter
40% lighter
50% lighter
Pending Firefox: Implement CSS Color 5 Relative Color Syntax
:has()
selector
/* Matches menu items with submenus in them */
nav li:has(menu) a::after { … }
/* Matches <h1> elements only if they have a <p> element directly after */
h1:has(+ p) { … }
/* Matches all <section> elements that do NOT contain headings */
section:not(:has(h1, h2, h3, h4, h5, h6)) { … }
/* Matches all <section> elements that have empty <div>s */
section:has(div:empty) { … }
Also see CSS Fool's Mate on CodePen.
0fr
to 1fr
Content that is meant to hidden
For all intents and purposes
Let's have multi-line content
Content that is meant to always shown
For all intents and purposes
Let's have multi-line content
auto
Have to enable “Experimental Web Platform features” from chrome://flags
on Chrome Canary
Content that is meant to hidden
For all intents and purposes
Let's have multi-line content
Content that is meant to always shown
For all intents and purposes
Let's have multi-line content
Font is Inclusive Sans by Olivia King.