aboutsummaryrefslogtreecommitdiff
path: root/entries/davepagurek/fib.html
diff options
context:
space:
mode:
authorDave Pagurek2022-10-24 23:31:35 +0000
committerGitHub2022-10-24 23:31:35 +0000
commit4da08849446829da335c5c59d953a5c23345d45d (patch)
tree4f160dcf328cfb377fefc0bf41cb3295d80563f6 /entries/davepagurek/fib.html
parent7ed13a92711a35a9c263c1f53e33e308653ae727 (diff)
Do some unholy things with CSS
Diffstat (limited to 'entries/davepagurek/fib.html')
-rw-r--r--entries/davepagurek/fib.html67
1 files changed, 67 insertions, 0 deletions
diff --git a/entries/davepagurek/fib.html b/entries/davepagurek/fib.html
new file mode 100644
index 0000000..9b2ea6a
--- /dev/null
+++ b/entries/davepagurek/fib.html
@@ -0,0 +1,67 @@
+<html>
+ <head>
+ <style>
+.initialize {
+ --prev: 0;
+ --next: 1;
+}
+
+.copyPrev {
+ --tmp-prev: var(--prev);
+ --tmp-next: var(--next);
+}
+
+.sumPrevious {
+ --prev: var(--tmp-next);
+ --next: calc(var(--tmp-prev) + var(--tmp-next));
+}
+
+.sumPrevious::before {
+ counter-set: fib var(--prev);
+ content: counter(fib);
+}
+ </style>
+ </head>
+ <body>
+
+ <!--
+ These are all nested divs, but browsers are happy to fix my
+ bad code, so I can write one on each line as if they're statements!
+ -->
+
+ <div class="initialize">
+
+ <div class="copyPrev">
+ <div class="sumPrevious">
+
+ <div class="copyPrev">
+ <div class="sumPrevious">
+
+ <div class="copyPrev">
+ <div class="sumPrevious">
+
+ <div class="copyPrev">
+ <div class="sumPrevious">
+
+ <div class="copyPrev">
+ <div class="sumPrevious">
+
+ <div class="copyPrev">
+ <div class="sumPrevious">
+
+ <div class="copyPrev">
+ <div class="sumPrevious">
+
+ <div class="copyPrev">
+ <div class="sumPrevious">
+
+ <div class="copyPrev">
+ <div class="sumPrevious">
+
+ <div class="copyPrev">
+ <div class="sumPrevious">
+
+ <div class="copyPrev">
+ <div class="sumPrevious">
+ </body>
+</html>