Update alerts

This commit is contained in:
Marcus Kammer 2023-07-08 22:25:20 +02:00
parent 57a33029e3
commit 82c0e3eb1f
Signed by: marcuskammer
GPG key ID: C374817BE285268F

View file

@ -2,13 +2,17 @@
(defmacro alert ((&key (type nil) (dismissible nil)) &body body)
`(spinneret:with-html
(:div :class ,(if dismissible
(format nil "alert alert-~a alert-dismissible" type)
(format nil "alert alert-~a" type)) :role "alert"
,(when dismissible
`(:button :type "button" :class "close" :data-dismiss "alert" :aria-label "Close"
(:span :aria-hidden "true" "×")))
,@body)))
(:div :role "alert"
:class ,(if dismissible
(format nil "alert alert-~a alert-dismissible" type)
(format nil "alert alert-~a" type))
,(when dismissible
`(:button :type "button"
:class "close"
:data-dismiss "alert"
:aria-label "Close"
(:span :aria-hidden "true" "×")))
,@body)))
(defmacro alert-primary (&body body)
`(alert (:type "primary") ,@body))