Skip to content

Instantly share code, notes, and snippets.

@nolanlawson
nolanlawson / .gitignore
Last active July 22, 2022 20:34
Repro SWC wasm
node_modules
@nolanlawson
nolanlawson / index.html
Created July 11, 2022 21:41
Test @font-face in shadow DOM
<!doctype html>
<html>
<head>
<title>Test @font-face in shadow DOM</title>
</head>
<body>
<h1>Test @font-face in shadow DOM</h1>
<div></div>
<script>
document.querySelector('div')
@nolanlawson
nolanlawson / index.html
Last active July 10, 2022 15:49
Test Windows 11 emoji
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test Windows 11 emoji</title>
<style>
.emoji-1 {
font-family: "Segoe UI Emoji";
}
.emoji-2 {
@nolanlawson
nolanlawson / index.html
Created July 6, 2022 18:08
Test event capture
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test event capture</title>
</head>
<body>
<h1>Test event capture</h1>
@nolanlawson
nolanlawson / .gitignore
Last active June 30, 2022 18:46
Separate styles versus concatenated styles benchmark
node_modules
@nolanlawson
nolanlawson / chrome.results.json
Last active June 25, 2022 20:09
Raw numbers from Shadow DOM selector benchmark, Mac Mini
{
"benchmarks": [
{
"name": "Scoping - classes",
"bytesSent": 0,
"measurement": {
"name": "total",
"mode": "performance",
"entryName": "total"
},
@nolanlawson
nolanlawson / chrome.results.json
Last active June 24, 2022 02:18
Raw numbers from shadow DOM selector benchmark
{
"benchmarks": [
{
"name": "Scoping - classes",
"bytesSent": 0,
"measurement": {
"name": "total",
"mode": "performance",
"entryName": "total"
},
@nolanlawson
nolanlawson / max_dom_depth.js
Last active June 22, 2022 13:21
Measure max DOM depth
Math.max(...[...document.querySelectorAll('*')].map(node => {
let count = 0
while ((node = node.parentNode)) { count++ }
return count
}))
@nolanlawson
nolanlawson / index.html
Last active June 19, 2022 02:50
Separate styles vs one big style
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="UTF-8">
<title>Separate styles vs one big style</title>
</head>
<body>
<main style="max-width: 600px; margin: 0 auto;">
@nolanlawson
nolanlawson / imports.html
Last active June 16, 2022 22:25
Speculative preparser test
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CSS preparser: imports</title>
</head>
<body>
<h1>CSS preparser: imports</h1>
<pre id="display"></pre>
<script>