-
-
Notifications
You must be signed in to change notification settings - Fork 357
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
4 changed files
with
149 additions
and
0 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
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,74 @@ | ||
details { | ||
display: block; | ||
border: 1px solid $gray-300; | ||
border-radius: 4px; | ||
padding: 0.5rem 0.5rem 0; | ||
margin: 0.5rem 0; | ||
} | ||
|
||
summary { | ||
&::marker { | ||
content: ""; | ||
} | ||
} | ||
|
||
details summary { | ||
display: inline-block; | ||
width: calc(100% + 1rem); | ||
margin: -0.5rem -0.5rem 0; | ||
padding: 0.5rem; | ||
} | ||
|
||
details summary:hover { | ||
background: $gray-100; | ||
} | ||
|
||
/* | ||
details > summary:first-of-type { | ||
display: inline-block; | ||
} | ||
*/ | ||
|
||
details summary::before { | ||
display: inline-block; | ||
content: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='rgba%2829, 45, 53, 0.75%29' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 14l6-6-6-6'/%3e%3c/svg%3e"); | ||
transition: transform 0.35s ease; | ||
transform-origin: center center; | ||
margin-right: 0.125rem; | ||
} | ||
|
||
details[open] > summary::before { | ||
transform: rotate(90deg); | ||
} | ||
|
||
details summary > * { | ||
display: inline; | ||
} | ||
|
||
details[open] { | ||
padding: 0.5rem; | ||
} | ||
|
||
details[open] > summary { | ||
border-bottom: 1px solid $gray-300; | ||
margin-bottom: 0.5rem; | ||
} | ||
|
||
details h2, | ||
details h3, | ||
details h4 { | ||
margin: 0 0 1rem; | ||
} | ||
|
||
details p:last-child { | ||
margin-bottom: 0; | ||
} | ||
|
||
details ul, | ||
details ol { | ||
margin-bottom: 0; | ||
} | ||
|
||
details pre { | ||
margin: 0 0 1rem; | ||
} |
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
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,6 @@ | ||
<details{{ with .Get 1 }} {{ . | safeHTML }}{{ end -}}> | ||
<summary> | ||
{{ with .Get 0 }}{{ . | safeHTML }}{{ else }}{{ errorf "No summary provided"}}{{ end }} | ||
</summary> | ||
{{ with .Inner -}}{{ . | markdownify}}{{ else -}}{{ errorf "No details provided"}}{{ end -}} | ||
</details> |