Update utility
This commit is contained in:
parent
73c9bd8ba3
commit
9f6a9048b0
1 changed files with 43 additions and 27 deletions
|
@ -133,9 +133,9 @@ Example 4:
|
||||||
(opacity :level :auto)
|
(opacity :level :auto)
|
||||||
; This will generate a string 'opacity-auto'"
|
; This will generate a string 'opacity-auto'"
|
||||||
(let ((level-str (if (null level) "" (if (eq level :auto)
|
(let ((level-str (if (null level) "" (if (eq level :auto)
|
||||||
"auto"
|
"opacity-auto"
|
||||||
(format nil "~d" level)))))
|
(format nil "opacity-~d" level)))))
|
||||||
(string-downcase (concatenate 'string "opacity-" level-str " "))))
|
(string-downcase (concatenate 'string level-str " "))))
|
||||||
|
|
||||||
(defun overflow (&key (direction nil) (value nil))
|
(defun overflow (&key (direction nil) (value nil))
|
||||||
"Generates a Bootstrap overflow class.
|
"Generates a Bootstrap overflow class.
|
||||||
|
@ -161,41 +161,40 @@ Example 4:
|
||||||
; This will generate a string 'overflow-x-scroll'"
|
; This will generate a string 'overflow-x-scroll'"
|
||||||
(let* ((dir-str (if (null direction) "" (format nil "-~a" direction)))
|
(let* ((dir-str (if (null direction) "" (format nil "-~a" direction)))
|
||||||
(value-str (if (null value) "" (string value)))
|
(value-str (if (null value) "" (string value)))
|
||||||
(class-str (concatenate 'string "overflow" dir-str "-" value-str)))
|
(class-str (concatenate 'string "overflow" dir-str "-" value-str " ")))
|
||||||
(string-downcase class-str " ")))
|
(string-downcase class-str)))
|
||||||
|
|
||||||
(defun sizing (&key (direction nil) (size nil))
|
(defun sizing (&key (direction nil) (size nil))
|
||||||
"Generates a Bootstrap sizing class.
|
"Generates a Bootstrap sizing class.
|
||||||
|
|
||||||
DIRECTION: Specifies the direction, should be :width or :height.
|
DIRECTION: Specifies the direction, should be :w or :h.
|
||||||
|
|
||||||
SIZE: Specifies the size, should be a number from 0 to 100, :25, :50, :75,
|
SIZE: Specifies the size, should be a number from 0 to 100, :25, :50, :75,
|
||||||
:100, :auto, or nil (default size).
|
:100, :auto, or nil (default size).
|
||||||
|
|
||||||
Example 1:
|
Example 1:
|
||||||
(sizing :direction :width :size 50)
|
(sizing :direction :w :size 50)
|
||||||
; This will generate a string 'w-50'
|
; This will generate a string 'w-50'
|
||||||
|
|
||||||
Example 2:
|
Example 2:
|
||||||
(sizing :direction :height :size :auto)
|
(sizing :direction :h :size :auto)
|
||||||
; This will generate a string 'h-auto'
|
; This will generate a string 'h-auto'
|
||||||
|
|
||||||
Example 3:
|
Example 3:
|
||||||
(sizing :direction :width :size :100)
|
(sizing :direction :w :size :100)
|
||||||
; This will generate a string 'w-100'
|
; This will generate a string 'w-100'
|
||||||
|
|
||||||
Example 4:
|
Example 4:
|
||||||
(sizing :direction :height :size 75)
|
(sizing :direction :h :size 75)
|
||||||
; This will generate a string 'h-75'"
|
; This will generate a string 'h-75'"
|
||||||
(let* ((dir-str (if (null direction) "" (string direction)))
|
(let* ((dir-str (if (null direction) "" (format nil "~a-" direction)))
|
||||||
(size-str (if (null size) ""
|
(size-str (if (null size) ""
|
||||||
(if (eq size :auto)
|
(if (eq size :auto)
|
||||||
"auto"
|
"auto"
|
||||||
(if (numberp size)
|
(if (numberp size)
|
||||||
(format nil "~d" size)
|
(format nil "~d" size)
|
||||||
(format nil "~a" size)))))
|
(format nil "~a" size))))))
|
||||||
(class-str (concatenate 'string dir-str "-" size-str " ")))
|
(string-downcase (concatenate 'string dir-str size-str " "))))
|
||||||
(string-downcase class-str)))
|
|
||||||
|
|
||||||
(defun spacing (&key (property nil) (side nil) (size nil) (breakpoint nil))
|
(defun spacing (&key (property nil) (side nil) (size nil) (breakpoint nil))
|
||||||
"Generates a Bootstrap spacing class.
|
"Generates a Bootstrap spacing class.
|
||||||
|
@ -211,28 +210,33 @@ BREAKPOINT: Specifies the breakpoint, should be :xs, :sm, :md, :lg, :xl, or
|
||||||
:xxl, or nil (all breakpoints).
|
:xxl, or nil (all breakpoints).
|
||||||
|
|
||||||
Example 1:
|
Example 1:
|
||||||
(spacing (:property :m :side :t :size 3 :breakpoint :md))
|
(spacing :property :m :side :t :size 3 :breakpoint :md)
|
||||||
; This will generate a string 'mt-md-3'
|
; This will generate a string 'mt-md-3'
|
||||||
|
|
||||||
Example 2:
|
Example 2:
|
||||||
(spacing (:property :p :side :b :size 2 :breakpoint :lg))
|
(spacing :property :p :side :b :size 2 :breakpoint :lg)
|
||||||
; This will generate a string 'pb-lg-2', which represents a large breakpoint
|
; This will generate a string 'pb-lg-2', which represents a large breakpoint
|
||||||
; with bottom padding of size 2.
|
; with bottom padding of size 2.
|
||||||
|
|
||||||
Example 3:
|
Example 3:
|
||||||
(spacing (:property :m :size :auto))
|
(spacing :property :m :size :auto)
|
||||||
; This will generate a string 'm-auto', which sets auto margin on all sides
|
; This will generate a string 'm-auto', which sets auto margin on all sides
|
||||||
; for all breakpoints.
|
; for all breakpoints.
|
||||||
|
|
||||||
Example 4:
|
Example 4:
|
||||||
(spacing (:property :p :side :x :size 5))
|
(spacing :property :p :side :x :size 5)
|
||||||
; This will generate a string 'px-5', which sets horizontal padding of size 5
|
; This will generate a string 'px-5', which sets horizontal padding of size 5
|
||||||
; for all breakpoints."
|
; for all breakpoints."
|
||||||
(let ((property-str (if (null property) "" (string property)))
|
(let ((property-str (if (null property) "" (format nil "~a" property)))
|
||||||
(side-str (if (null side) "" (string side)))
|
(side-str (if (null side) "" (format nil "~a" side)))
|
||||||
(size-str (if (null size) "" (if (eq size :auto) "auto" (format nil "~d" size))))
|
(size-str (if (null size) "" (if (eq size :auto) "auto" (format nil "~d" size))))
|
||||||
(breakpoint-str (if (null breakpoint) "" (format nil "~a-" breakpoint))))
|
(breakpoint-str (if (null breakpoint) "" (format nil "~a" breakpoint))))
|
||||||
(string-downcase (concatenate 'string property-str side-str "-" breakpoint-str size-str " "))))
|
(string-downcase
|
||||||
|
(concatenate 'string
|
||||||
|
property-str
|
||||||
|
side-str
|
||||||
|
(if breakpoint "-" "") breakpoint-str
|
||||||
|
(if size "-" "") size-str))))
|
||||||
|
|
||||||
(defun text (&key (alignment nil) (transform nil) (weight nil) (wrap nil) (monospace nil))
|
(defun text (&key (alignment nil) (transform nil) (weight nil) (wrap nil) (monospace nil))
|
||||||
"Generates a Bootstrap text utility class.
|
"Generates a Bootstrap text utility class.
|
||||||
|
@ -261,7 +265,19 @@ Example 3:
|
||||||
|
|
||||||
Example 4:
|
Example 4:
|
||||||
(text :alignment :center :transform :lowercase)
|
(text :alignment :center :transform :lowercase)
|
||||||
; This will generate a string 'text-center text-lowercase'"
|
; This will generate a string 'text-center text-lowercase'
|
||||||
|
|
||||||
|
Example 5:
|
||||||
|
(text :alignment :end :weight :light :monospace t)
|
||||||
|
; This will generate a string 'text-end fw-light font-monospace '
|
||||||
|
|
||||||
|
Example 6:
|
||||||
|
(text :transform :capitalize :wrap :wrap)
|
||||||
|
; This will generate a string 'text-capitalize text-wrap '
|
||||||
|
|
||||||
|
Example 7:
|
||||||
|
(text :alignment :center :transform :uppercase :weight :bolder :wrap :nowrap :monospace t)
|
||||||
|
; This will generate a string 'text-center text-uppercase fw-bolder text-nowrap font-monospace '"
|
||||||
(let ((alignment-str (if (null alignment) "" (format nil "text-~a " alignment)))
|
(let ((alignment-str (if (null alignment) "" (format nil "text-~a " alignment)))
|
||||||
(transform-str (if (null transform) "" (format nil "text-~a " transform)))
|
(transform-str (if (null transform) "" (format nil "text-~a " transform)))
|
||||||
(weight-str (if (null weight) "" (format nil "fw-~a " weight)))
|
(weight-str (if (null weight) "" (format nil "fw-~a " weight)))
|
||||||
|
|
Loading…
Add table
Reference in a new issue