Skip to content

Commit

Permalink
feat: ✨ Add alert boxes (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
hampoelz authored Sep 19, 2023
1 parent f1d1cf6 commit 1733aec
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion styles/commands.sty
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,34 @@
% ]
% #1
% \end{tcolorbox}%
% }
% }

% ------------- alert boxes --------------
\usepackage[most]{tcolorbox}
\usepackage{fontawesome}
\newenvironment{alertbox}[2]{
\begin{tcolorbox}[%
enhanced,%
frame hidden,%
colback=white,%
borderline west={3px}{0pt}{#1}%
]
{\large\color{#1}\textbf{#2}}
\\[0.5em]
}{
\end{tcolorbox}
}

\newenvironment{alerticonbox}[3]{\begin{alertbox}{#1}{#2\hspace{1ex}#3}}{\end{alertbox}}

% - alert box "note" -
\definecolor{note}{HTML}{0969da}
\newenvironment{note}[1][Note]{\begin{alerticonbox}{note}{\faInfoCircle}{#1}}{\end{alerticonbox}}

% - alert box "important" -
\definecolor{important}{HTML}{8250df}
\newenvironment{important}[1][Important]{\begin{alerticonbox}{important}{\faExclamation}{#1}}{\end{alerticonbox}}

% - alert box "warning" -
\definecolor{warning}{HTML}{9a6700}
\newenvironment{warning}[1][Warning]{\begin{alerticonbox}{warning}{\faExclamationTriangle}{#1}}{\end{alerticonbox}}

0 comments on commit 1733aec

Please sign in to comment.