Skip to content

Instantly share code, notes, and snippets.

View LeaVerou's full-sized avatar

Lea Verou LeaVerou

View GitHub Profile
@LeaVerou
LeaVerou / dabblet.css
Created February 27, 2025 23:25
oklab interpolation weirdness
/**
* oklab interpolation weirdness
*/
background: no-repeat 0 / 100% 50%;
background-image: linear-gradient(to right, red, blue, aqua, lime, yellow, green),
linear-gradient(to right in oklab, red, blue, aqua, lime, yellow, green);
background-position: top, bottom;
min-height: 100%;
@LeaVerou
LeaVerou / dabblet.css
Last active February 14, 2025 05:03
Safari color space conversion bug Part 2
/**
* Safari color space conversion bug Part 2
*/
div {
width: 12em;
height: 3em;
border: 1px solid silver;
}
@LeaVerou
LeaVerou / dabblet.css
Created February 13, 2025 20:07
Safari bug potential workaround
/**
* Safari bug potential workaround
*/
oklch(from oklab(from var(--color) calc(l - 0.5) a b) calc(l + 0.5) c calc(h + var(--hue-shift)));
--color: #e5f6ff;
--hue-shift: -30;
--color-tweaked: oklch(from oklab(from var(--color) calc(l - 0.5) a b) calc(l + 0.5) c calc(h + var(--hue-shift)));
background: linear-gradient(var(--color-tweaked) 0% 100%) #e5f6ff no-repeat 0 0 / 100% 50%;
min-height: 100%;
@LeaVerou
LeaVerou / dabblet.css
Last active February 13, 2025 17:26
Safari color space conversion bug
/**
* Safari color space conversion bug
*/
div {
width: 10em;
height: 2em;
border: 1px solid silver;
}
@LeaVerou
LeaVerou / dabblet.css
Created February 13, 2025 16:45
Safari bug playground
/**
* Safari bug playground
*/
--color: rgb(from oklch(90% 0.02 230) r g b);
background: linear-gradient(oklch(from var(--color) l c h) 0% 100%) var(--color) no-repeat 0 0 / 100% 50%;
min-height: 100%;
@LeaVerou
LeaVerou / dabblet.css
Created February 13, 2025 15:58
WTF Safari?!
/**
* WTF Safari?!
*/
background: linear-gradient(oklch(from #e5f6ff l c h) 0% 100%) #e5f6ff no-repeat 0 0 / 100% 50%;
min-height: 100%;
@media (height > 600px) and (width > 900px) {
.tally-progress-bar {
position: fixed;
}
}
.tally-progress-bar-item {
height: .6em;
&.tally-progress-bar-item-done {
@LeaVerou
LeaVerou / dabblet.css
Last active September 26, 2024 22:31
:lang() parsing
/**
* :lang() parsing
*/
:lang(en) { border: 2px solid blue }
@LeaVerou
LeaVerou / dabblet.css
Last active September 26, 2024 19:38
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: accentColor linear-gradient(to right, color-mix(in oklab, accentColor, white) 50%, accentColor 0);
border: 10px color-mix(in oklab, accentColor, black 20%) solid;
height: 100vh;
@LeaVerou
LeaVerou / code.js
Created July 5, 2024 13:05
eleventyConfig properties
function getAllProperties(obj){
var allProps = []
, curr = obj
do{
var props = Object.getOwnPropertyNames(curr)
props.forEach(function(prop){
if (allProps.indexOf(prop) === -1)
allProps.push(prop)
})
}while(curr = Object.getPrototypeOf(curr))