-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
67,632 additions
and
16,717 deletions.
There are no files selected for viewing
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/* Adapted from https://iamkate.com/code/tree-views/ - thanks! */ | ||
|
||
.tree{ | ||
--spacing : 1.5rem; | ||
--radius : 10px; | ||
} | ||
|
||
.tree li{ | ||
display : block; | ||
position : relative; | ||
padding-left : calc(2 * var(--spacing) - var(--radius) - 2px); | ||
} | ||
|
||
.tree ul{ | ||
margin-left : calc(var(--radius) - var(--spacing)); | ||
padding-left : 0; | ||
} | ||
|
||
.tree ul li{ | ||
border-left : 2px solid #ddd; | ||
} | ||
|
||
.tree ul li:last-child{ | ||
border-color : transparent; | ||
} | ||
|
||
.tree ul li::before{ | ||
content : ''; | ||
display : block; | ||
position : absolute; | ||
top : calc(var(--spacing) / -2); | ||
left : -2px; | ||
width : calc(var(--spacing) + 2px); | ||
height : calc(var(--spacing) + 1px); | ||
border : solid #ddd; | ||
border-width : 0 0 2px 2px; | ||
} | ||
|
||
.tree summary{ | ||
display : block; | ||
cursor : pointer; | ||
} | ||
|
||
.tree summary::marker, | ||
.tree summary::-webkit-details-marker{ | ||
display : none; | ||
} | ||
|
||
.tree summary:focus{ | ||
outline : none; | ||
} | ||
|
||
.tree summary:focus-visible{ | ||
outline : 1px dotted #000; | ||
} | ||
|
||
.tree summary::before{ | ||
content : ''; | ||
display : block; | ||
position : absolute; | ||
top : calc(var(--spacing) / 2 - var(--radius)); | ||
left : calc(var(--spacing) - var(--radius) - 1px); | ||
width : calc(2 * var(--radius)); | ||
height : calc(2 * var(--radius)); | ||
border-radius : 50%; | ||
background : #ddd; | ||
} | ||
|
||
.tree li::after { | ||
content : ''; | ||
display : block; | ||
position : absolute; | ||
top : calc(var(--spacing) / 2 - var(--radius)); | ||
left : calc(var(--spacing) - var(--radius) - 1px); | ||
width : calc(2 * var(--radius)); | ||
height : calc(2 * var(--radius)); | ||
border-radius : 50%; | ||
background : transparent; | ||
} | ||
|
||
.tree summary::before{ | ||
z-index : 1; | ||
background : #696 url('expand-collapse.svg') 0 0; | ||
} | ||
|
||
.tree details[open] > summary::before{ | ||
background-position : calc(-2 * var(--radius)) 0; | ||
} |
This file contains 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
Oops, something went wrong.