Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ✨ Add alert boxes #46

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}}