Skip to content

Commit 181c754

Browse files
therobroblenderom
andauthored
feat: icons for highlight shortcode (#169)
## Description i´ve added icons for the highlight shortcode. it appears next to the roofline text. i´m not entirely sure, if these icons are 100% appropriate, so please suggest others if you can think of any :) ## Checklist <!-- Check fields with: [x] / Abhaken von Punkten: [x] --> - [ ] Check the License of new pictures (non-commercial use without attribution) <!-- Die Lizenz neuer Bilder geprüft (nicht-kommerzielle Nutzung ohne Namensnennung) --> The content was modified in the following languages: <!-- Der Inhalt wurde für die folgenden Sprachen angepasst --> - [ ] English - [ ] German Co-authored-by: Lennart Rommeiss <61516567+lenderom@users.noreply.github.com>
1 parent 8ba2f8f commit 181c754

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

assets/sass/textHighlight.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
text-transform: uppercase;
1313
font-weight: bold;
1414
opacity: .8;
15+
display: flex;
16+
align-items: center;
17+
gap: .4rem;
1518
}
1619

1720
.m-text-highlight--tip {

layouts/shortcodes/highlight.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
{{- $param := .Get 0 -}}
2+
{{ $iconMapping := dict "important" "error" "inofficial" "warning" "tip" "lightbulb_2" }}
3+
24
<div class="m-text-highlight m-text-highlight--{{ $param }}">
35
{{- if $param -}}
4-
<div class="m-text-highlight__roofline">{{ T (printf "highlight.%s" $param) }}</div>
6+
<div class="m-text-highlight__roofline">
7+
{{- partial "icon" (index $iconMapping $param) -}}
8+
{{ T (printf "highlight.%s" $param) }}</div>
59
{{- end -}}
610
<div>
711
{{ .Inner }}

0 commit comments

Comments
 (0)