Skip to content

Instantly share code, notes, and snippets.

Avatar

Lea Verou LeaVerou

View GitHub Profile
@LeaVerou
LeaVerou / dabblet.css
Created May 6, 2023 04:04
text-wrap: balance bug
View dabblet.css
/**
* text-wrap: balance bug
*/
body { width: 750px }
div {
width: 200px; height: 200px;
background: red;
@LeaVerou
LeaVerou / dabblet.css
Last active April 23, 2023 06:43
OKLch rainbow?
View dabblet.css
/**
* OKLch rainbow?
*/
--hc: 70% .2;
background: linear-gradient(to left in oklch longer, oklch(var(--hc) 0), oklch(var(--hc) 359));
@LeaVerou
LeaVerou / dabblet.css
Created March 15, 2023 14:43
Number of angles created by corner-shape
View dabblet.css
/**
* Number of angles created by corner-shape
*/
path {
fill: slategray;
}
text {
font: bold 100% Helvetica Neue;
@LeaVerou
LeaVerou / dabblet.css
Last active February 6, 2023 00:03
CSS Grid vs Lea: 1-0
View dabblet.css
/**
* CSS Grid vs Lea: 1-0
*/
.slide {
position: absolute;
inset: 0;
z-index: 1;
padding: 2.5rem;
box-sizing: border-box;
@LeaVerou
LeaVerou / dabblet.css
Created December 8, 2022 19:13
Untitled
View dabblet.css
body { background: red }
@container style(--foo: 1) {
body { background: green; }
}
html { --foo: 1 }
@LeaVerou
LeaVerou / go-to-spec.js
Created November 1, 2022 18:46
MDN Go to spec bookmarklet
View go-to-spec.js
javascript:{ let table = document.querySelector("#specifications + div > table.standard-table, #specifications + table.standard-table"); table.scrollIntoView({behavior: "smooth"}); table.querySelector("a")?.click(); } undefined;
@LeaVerou
LeaVerou / dabblet.css
Created August 10, 2022 14:59
meter gencontent
View dabblet.css
/**
* meter gencontent
*/
meter::before {
content: "before"
}
meter::after {
content: "after"
@LeaVerou
LeaVerou / dabblet.css
Created June 23, 2022 11:17
Never use circle size to convey information
View dabblet.css
/**
* Never use circle size to convey information
*/
div {
display: inline-flex; align-items: center; justify-content: center;
width: 200px;
aspect-ratio: 1 / 1;
padding: 1em;
background: radial-gradient(closest-side, hsl(220 10% 70%) calc(var(--p)), transparent 0) hsl(220 10% 90%);
@LeaVerou
LeaVerou / dabblet.css
Created June 9, 2022 12:13
Invalid custom property values
View dabblet.css
/**
* Invalid custom property values
*/
@property --foo {
syntax: "red | orange";
initial-value: red;
inherits: false;
}
html { --foo: green }
@LeaVerou
LeaVerou / dabblet.css
Created June 6, 2022 14:58
Division by <length> test
View dabblet.css
/**
* Division by <length> test
*/
div {
background: green;
width: 100px;
height: calc(100px * (100vw / 100vh));
}