Define package lsit-group

This commit is contained in:
Marcus Kammer 2023-07-11 19:36:56 +02:00
parent 31114ac89a
commit d900c3327b
2 changed files with 18 additions and 2 deletions

View file

@ -1,13 +1,29 @@
;; List groups
;; Create lists of content in a card with a flush list group.
(defpackage cl-sbt-list-group
(:use :cl)
(:export
:item
:list-group))
(in-package :cl-sbt-list-group)
(defmacro list-group-item (&body body)
"This macro generates a Bootstrap list group item.
BODY: The contents of the list group item."
`(spinneret:with-html
(:li :class "list-group-item" ,@body)))
(defmacro list-group (&rest rest)
"This macro generates a Bootstrap list group.
REST: A sequence of items to be included in the list group. Each item is a keyword-value pair, where the keyword is ':content' and the value is the content of the item."
`(spinneret:with-html
(:ul :class "list-group list-group-flush"
,@(loop for item in rest
collect (destructuring-bind (&key content) item
`(list-group-item ,content))))))
`(list-group-item ,content))))))

View file

@ -1,6 +1,6 @@
(defpackage cl-sbt
(:use :cl)
(:export :badge :badge-pill-primary :badge-pill-secondary :badge-pill-success :badge-pill-danger :badge-pill-warning :badge-pill-info :badge-pill-light :badge-pill-dark :btn :btn-primary :btn-secondary :btn-success :btn-danger :btn-warning :btn-info :btn-light :btn-dark :btn-link :btn-outline-primary :btn-outline-secondary :btn-outline-success :btn-outline-danger :btn-outline-warning :btn-outline-info :btn-outline-light :btn-outline-dark :btn-outline-link :list-group-item :list-group :container :col-md :col-xs :col-sm :col-lg :icon :dropdown :dropdown-menu :dropdown-item :nav :nav-item :pagination :pagination-with-icons :row :table :table-striped :table-bordered :table-hover :table-condensed :well :with-page))
(:export :badge :badge-pill-primary :badge-pill-secondary :badge-pill-success :badge-pill-danger :badge-pill-warning :badge-pill-info :badge-pill-light :badge-pill-dark :btn :btn-primary :btn-secondary :btn-success :btn-danger :btn-warning :btn-info :btn-light :btn-dark :btn-link :btn-outline-primary :btn-outline-secondary :btn-outline-success :btn-outline-danger :btn-outline-warning :btn-outline-info :btn-outline-light :btn-outline-dark :btn-outline-link :container :col-md :col-xs :col-sm :col-lg :icon :dropdown :dropdown-menu :dropdown-item :nav :nav-item :pagination :pagination-with-icons :row :table :table-striped :table-bordered :table-hover :table-condensed :well :with-page))
(in-package :cl-sbt)