Created
February 2, 2023 19:16
-
-
Save ericorruption/0b7ca0c90983811b74b7774193d11a84 to your computer and use it in GitHub Desktop.
A stylesheet to turn my website into a quine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* References: https://css-tricks.com/this-page-is-a-truly-naked-brutalist-html-quine/ */ | |
* { | |
margin: 0; | |
padding: 0; | |
} | |
html { | |
font-family: Monospace; | |
} | |
*::before, *::after { | |
opacity: .4; | |
/* color: pink-ish */ | |
} | |
head, title, meta { display: block } | |
/* TODO move to individual components? */ | |
a { display: block } | |
*::before { content: '<' var(--name) '>' } | |
*::after { content: '</' var(--name) '>' } | |
* { --name: initial } | |
html { --name: 'html' } | |
head { --name: 'head' } | |
title { --name: 'title' } | |
body { --name: 'body' } | |
h1 { --name: 'h1' } | |
h2 { --name: 'h2' } | |
h3 { --name: 'h3' } | |
p { --name: 'p' } | |
a { --name: 'a' } | |
pre { --name: 'pre' } | |
code { --name: 'code' } | |
aside { --name: 'aside' } | |
blockquote { --name: 'blockquote' } | |
em { --name: 'em' } | |
strong { --name: 'strong' } | |
ul { --name: 'ul' } | |
li { --name: 'li' } | |
header { --name: 'header' } | |
nav { --name: 'nav' } | |
footer { --name: 'footer' } | |
div { --name: 'div' } | |
main { --name: 'main' } | |
article { --name: 'article' } | |
section { --name: 'section' } | |
hr { --name: 'hr' } | |
time { --name: 'time' } | |
html[lang]::before { content:'<html lang="' attr(lang) '">' } | |
meta[charset]::before { content: '<meta charset="' attr(charset) '" />' } | |
meta[name][content]::before { content: '<meta name="' attr(name) '" content="' attr(content)'" />' } | |
/* meta[property][content]::before { content: '<meta property="' attr(property) '" content="' attr(content)'" />' } */ | |
a[href]::before { content: '<a href="' attr(href) '">' } | |
a[href][target]::before { content: '<a href="' attr(href) '" target="' attr(target) '">' } | |
ul { list-style: none } | |
* > :not(em, strong) { | |
padding-left: 1rem; | |
} | |
li > * { display: block; padding-left: 1rem; } | |
/* TODO fix time padding on about page */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment