Skip to content

Commit

Permalink
Add icons to warning and tip boxes (via ![Boxicons](https://boxicons.com
Browse files Browse the repository at this point in the history
))
  • Loading branch information
iamgio committed Sep 5, 2024
1 parent 1a87991 commit cca062c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/src/main/resources/render/html-wrapper.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/5.1.0/reveal.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/5.1.0/theme/white.css">
[[endif:SLIDES]]
<link href='https://unpkg.com/[email protected]/css/boxicons.min.css' rel='stylesheet'>
<link rel="stylesheet" href="theme/theme.css">
<script>
[[if:SLIDES]]
Expand Down
29 changes: 29 additions & 0 deletions core/src/main/resources/render/theme/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ code.focus-lines .hljs-ln-line:not(.focused),

/* End of the target-based styling */

/* Box types */

.box.error-box {
background-color: rgb(224, 67, 64);
color: white;
Expand All @@ -332,6 +334,31 @@ code.focus-lines .hljs-ln-line:not(.focused),
color: rgb(25, 60, 102);
}

/* Box icons */

.box > header > h4::before {
font-family: 'boxicons', monospace;
font-weight: normal;
float: left;
width: 18px;
margin-right: 6px;
}

.box:is(.warning-box, .tip-box) > header > h4 {
margin-right: 24px; /* 18px icon + 6px margin, used to realign text to the center */
display: flex;
flex-direction: row;
align-items: center; /* Align icons */
}

.box.warning-box > header > h4::before {
content: "\eac5"; /* 'error' (triangle) icon */
}

.box.tip-box > header > h4::before {
content: "\ecf7"; /* 'bulb' icon */
}

.box:is(.warning-box, .error-box) > header {
background-color: rgba(0, 0, 0, 0.1);
}
Expand All @@ -340,6 +367,8 @@ code.focus-lines .hljs-ln-line:not(.focused),
background-color: rgba(25, 60, 102, 0.1);
}

/* End of box styling */

.marker {
display: none;
}
Expand Down

0 comments on commit cca062c

Please sign in to comment.