drone build Mon Sep 21 12:47:06 PDT 2026
This commit is contained in:
1 parent
bf217f9880
commit
d6c321ca46
304 files changed
+3657
-3661
No files matched your search
@@ -70,7 +70,7 @@
|
||||
<pre class="language-css"><code class="language-css"><span class="token selector">#toc li</span> <span class="token punctuation">{</span>
|
||||
<span class="token property">border-left</span><span class="token punctuation">:</span> .095rem solid <span class="token function">var</span><span class="token punctuation">(</span>--color-pink<span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||||
<span class="token punctuation">}</span></code></pre>
|
||||
<p><img src="https://leecat.art/img/tree-styling-1.png" alt="Phase 1. There are thin pink vertical left-side borders for the list item elements, create long contiguous vertical lines. They are directly next to the list items with no spacing." loading="lazy" decoding="async" width="604" height="236"></p>
|
||||
<p><img src="https://leecat.art/img/tree-styling-1.png" alt="Phase 1. There are thin pink vertical left-side borders for the list item elements, create long contiguous vertical lines. They are directly next to the list items with no spacing." loading="lazy" decoding="async" width="610" height="297"></p>
|
||||
<p>Those are super off. First, they're tabbed too far in to the left; second, there's <em>no</em> space between the border and the list item. We're going to fix the first thing by removing left margins on the <code>&lt;ol&gt;</code>s. The second is where we pull in the most critical piece of infrastructure.</p>
|
||||
<pre class="language-css"><code class="language-css"><span class="token selector">#toc ol</span> <span class="token punctuation">{</span>
|
||||
<span class="token property">margin-left</span><span class="token punctuation">:</span> 0<span class="token punctuation">;</span>
|
||||
@@ -82,19 +82,19 @@
|
||||
<span class="token property">color</span><span class="token punctuation">:</span> <span class="token function">var</span><span class="token punctuation">(</span>--color-pink<span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||||
<span class="token punctuation">}</span></code></pre>
|
||||
<p>Notably, without additional positioning, the bars will be spaced away from the border. We want them to overlap perfectly.</p>
|
||||
<p><img src="https://leecat.art/img/tree-styling-2.png" alt="Phase 2, shown with the new characters before any positioning adjustment. There are tree line leaders before each list item, but they are a few pixels off from overlapping with the border." loading="lazy" decoding="async" width="598" height="224"></p>
|
||||
<p><img src="https://leecat.art/img/tree-styling-2.png" alt="Phase 2, shown with the new characters before any positioning adjustment. There are tree line leaders before each list item, but they are a few pixels off from overlapping with the border." loading="lazy" decoding="async" width="605" height="339"></p>
|
||||
<pre class="language-css"><code class="language-css"><span class="token selector">#toc li::before</span> <span class="token punctuation">{</span>
|
||||
<span class="token property">position</span><span class="token punctuation">:</span> relative<span class="token punctuation">;</span>
|
||||
<span class="token property">left</span><span class="token punctuation">:</span> -.34rem<span class="token punctuation">;</span> <span class="token comment">/* I fiddled a lot and this is where I landed */</span>
|
||||
<span class="token punctuation">}</span></code></pre>
|
||||
<p><img src="https://leecat.art/img/tree-styling-3.png" alt="Phase 3. The tree line leaders now perfectly overlap the border and it looks like a contiguous vertical line with small tabs inwards." loading="lazy" decoding="async" width="607" height="229"></p>
|
||||
<p><img src="https://leecat.art/img/tree-styling-3.png" alt="Phase 3. The tree line leaders now perfectly overlap the border and it looks like a contiguous vertical line with small tabs inwards." loading="lazy" decoding="async" width="607" height="341"></p>
|
||||
<h3 id="adjust-left-margins">adjust left margins</h3>
|
||||
<p>Right now, the vertical lines don't nest nicely underneath the level above. Let's change our margins. I also adjusted the line height very slightly, because I noticed on some levels of magnification that the tree line leader characters weren't actually meeting.</p>
|
||||
<pre class="language-css"><code class="language-css"><span class="token selector">#toc li</span> <span class="token punctuation">{</span>
|
||||
<span class="token property">margin-left</span><span class="token punctuation">:</span> 1.5rem<span class="token punctuation">;</span>
|
||||
<span class="token property">line-height</span><span class="token punctuation">:</span> 1.15<span class="token punctuation">;</span>
|
||||
<span class="token punctuation">}</span></code></pre>
|
||||
<p><img src="https://leecat.art/img/tree-styling-4.png" alt="Phase 4. The vertical border comes down directly below the first character of the parent level." loading="lazy" decoding="async" width="604" height="193"></p>
|
||||
<p><img src="https://leecat.art/img/tree-styling-4.png" alt="Phase 4. The vertical border comes down directly below the first character of the parent level." loading="lazy" decoding="async" width="600" height="318"></p>
|
||||
<h3 id="fix-those-pesky-last-children">fix those pesky last children</h3>
|
||||
<p>You've probably noticed that the last children in the tree output had a bend rather than the T-shape we've been using. We'll want to remove the border from the last children and change the character we're using.</p>
|
||||
<pre class="language-css"><code class="language-css"><span class="token selector">#toc li:last-child</span> <span class="token punctuation">{</span>
|
||||
@@ -108,7 +108,7 @@
|
||||
<span class="token property">content</span><span class="token punctuation">:</span> <span class="token string">'└─'</span><span class="token punctuation">;</span>
|
||||
<span class="token punctuation">}</span></code></pre>
|
||||
<p>With that, it starts to look complete!</p>
|
||||
<p><img src="https://leecat.art/img/tree-styling-5.png" alt="Phase 5, almost done. The last children no longer have a border that continues onward as though there will be more children." loading="lazy" decoding="async" width="598" height="227"></p>
|
||||
<p><img src="https://leecat.art/img/tree-styling-5.png" alt="Phase 5, almost done. The last children no longer have a border that continues onward as though there will be more children." loading="lazy" decoding="async" width="614" height="349"></p>
|
||||
<h3 id="but-what-about-really%2C-really%2C-really%2C-really%2C-really-long-headers%3F">but what about really, really, really, really, REALLY long headers?</h3>
|
||||
<p>What about line wrapping? It looks pretty bad right now.</p>
|
||||
<p><img src="https://leecat.art/img/tree-styling-6.png" alt="Table of contents now shown with the above header. When the line wraps, instead of lining up with the beginning of the first character on the previous line, it nests under the tree line leader and right in line with the vertical border." loading="lazy" decoding="async" width="609" height="405"></p>
|
||||
|
||||
Reference in new issue
Block a user