Skip to content

Commit 281744c

Browse files
authored
feat: add the color shortcode (#5)
1 parent 056fe87 commit 281744c

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.hb-color {
2+
&::after {
3+
content: '';
4+
background: var(--color);
5+
border: 1px solid var(--#{$prefix}dark);
6+
display: inline-block;
7+
height: 0.8rem;
8+
margin-left: .125rem;
9+
width: 0.8rem;
10+
vertical-align: -0.125rem;
11+
}
12+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
@import 'color';
12
@import 'spoiler-tag';

layouts/shortcodes/color.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{{- $color := .Get 0 }}
2+
<code
3+
class="hb-color user-select-all"
4+
style="--color: {{ $color }};">{{ $color }}</code>

0 commit comments

Comments
 (0)