Add option to align self col

This commit is contained in:
Marcus Kammer 2023-07-15 15:04:03 +02:00
parent 439e9bd04e
commit df2afe035e
Signed by: marcuskammer
GPG key ID: C374817BE285268F

View file

@ -181,26 +181,31 @@ Examples:
(lg nil) (lg nil)
(xl nil) (xl nil)
(xxl nil) (xxl nil)
(col nil)) &body body) (col nil)
(align-self nil)) &body body)
"Generates a Bootstrap column. "Generates a Bootstrap column.
COL: Specifies the number of columns the element spans (default 12). COL: Specifies the number of columns the element spans (default 12).
XS, SM, MD, LG, XL, XXL: List that specify the number of columns the element spans and optional offset at various breakpoints. XS, SM, MD, LG, XL, XXL: List that specify the number of columns the element spans and optional offset at various breakpoints.
ALIGN-SELF: Specifies the alignment of the column. Possible values are 'start', 'center', 'end'.
Example: Example:
(col (:col 6 :md (8 2)) \"Hello, world!\") (col (:col 6 :md (8 2) :align-self center) \"Hello, world!\")
This will generate a column that spans 6 columns by default, 8 medium-sized This will generate a column that spans 6 columns by default, 8 medium-sized
columns with an offset of 2 medium-sized columns, containing the text 'Hello, columns with an offset of 2 medium-sized columns, and aligns its content in the
world!'." center. The column contains the text 'Hello, world!'."
`(spinneret:with-html `(spinneret:with-html
(:div :class (:div :class
,(concatenate 'string ,(string-downcase
(if (null col) "col" (format nil "col-~d" col)) (concatenate 'string
(make-col-class "xs" xs) (if (null col) "col" (format nil "col-~d" col))
(make-col-class "sm" sm) (if (null align-self) "" (format nil " align-self-~a" align-self))
(make-col-class "md" md) (make-col-class "xs" xs)
(make-col-class "lg" lg) (make-col-class "sm" sm)
(make-col-class "xl" xl) (make-col-class "md" md)
(make-col-class "xxl" xxl)) (make-col-class "lg" lg)
(make-col-class "xl" xl)
(make-col-class "xxl" xxl)))
,@body))) ,@body)))