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 5, 2012 14:39
Typing animation with pure CSS.
/**
* Typing animation with pure CSS.
* Works best in browsers supporting the ch unit.
*/
@keyframes typing { from { width: 0; } }
@keyframes blink-caret { 50% { border-color: transparent; } }
h1 {
font: bold 200% Consolas, Monaco, monospace;
@LeaVerou
LeaVerou / dabblet.css
Created February 12, 2012 19:00
TV screen
/**
* TV screen
*/
html { background: white; }
.tv {
position: relative;
width: 200px;
height: 150px;
@LeaVerou
LeaVerou / dabblet.css
Created August 12, 2023 22:08
CSS nesting testcase
/**
* CSS nesting testcase
*/
body {
background: red;
}
html {
& body {
@LeaVerou
LeaVerou / SassMeister-input.scss
Created July 27, 2014 18:35
Generated by SassMeister.com.
// ----
// Sass (v3.3.10)
// Compass (v1.0.0.alpha.20)
// ----
// Proposals for grayscale color notation
// See: http://lea.verou.me/2014/07/an-easy-notation-for-grayscale-colors
@function gray($l, $a:1) {
@return rgba($l, $l, $l, $a);
/**
* 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 28, 2023 17:26
CSS variables in SVG
/**
* CSS variables in SVG
*/
:root {
--foo: red;
}
svg {
--foo: #0ac;
@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;