
#let tag-warning-box = html.elem.with("warning-box")

#let warning-box(
  title: [⚠️ Warning],
  color: "red",
  body
) = {
  ```raw-css
  warning-box {
    display: block;
    border-left: .5em solid;
    padding: 1em;
    margin: 0.5em;

    h4 {
      margin-top: 0;
      font-weight: bold;
    }
  }
  ```
  tag-warning-box(
    attrs: (style: "border-left-color: " + color + ";"),
  {
    if title != none {
      html.h4(
        style: "color: " + color + ";", title
      );
    }
    body
  })
}
