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
Last active October 9, 2023 01:48
none keyword test
/**
* none keyword test
* Pass: There should be no red, nor any distinct squares
*/
html {
background: red; /* if you see this, the none keyword is not supported */
background: color-mix(in hsl, hsl(80 50% 90%) 0%, hsl(none none 50%));
}
@LeaVerou
LeaVerou / dabblet.css
Created August 12, 2023 22:08
CSS nesting testcase
/**
* CSS nesting testcase
*/
body {
background: red;
}
html {
& body {
/**
* Tooltips
*/
span {
font: bold 300%/1.5 system-ui;
}
@LeaVerou
LeaVerou / dabblet.css
Created May 6, 2023 04:04
text-wrap: balance bug
/**
* 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?
/**
* 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
/**
* 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
/**
* 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
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
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
/**
* meter gencontent
*/
meter::before {
content: "before"
}
meter::after {
content: "after"