2024-03-14 20:34:44 +01:00
|
|
|
;;;; -*- mode: lisp; coding: utf-8; tab-width: 4; fill-column: 100; indent-tabs-mode: nil; -*-
|
|
|
|
;;;; bi.lisp
|
|
|
|
;;;; Provide functions and macros related to bootstrap icons.
|
|
|
|
|
|
|
|
(in-package :dev.metalisp.sbt)
|
2024-03-19 19:26:07 +01:00
|
|
|
|
|
|
|
(defparameter bi-icons
|
|
|
|
'((0-circle . "<path d='M7.988 12.158c-1.851 0-2.941-1.57-2.941-3.99V7.84c0-2.408 1.101-3.996 2.965-3.996 1.857 0 2.935 1.57 2.935 3.996v.328c0 2.408-1.101 3.99-2.959 3.99M8 4.951c-1.008 0-1.629 1.09-1.629 2.895v.31c0 1.81.627 2.895 1.629 2.895s1.623-1.09 1.623-2.895v-.31c0-1.8-.621-2.895-1.623-2.895'/><path d='M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M1 8a7 7 0 1 0 14 0A7 7 0 0 0 1 8'/>")
|
|
|
|
(0-circle-fill . "<path d='M8 4.951c-1.008 0-1.629 1.09-1.629 2.895v.31c0 1.81.627 2.895 1.629 2.895s1.623-1.09 1.623-2.895v-.31c0-1.8-.621-2.895-1.623-2.895'/><path d='M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-8.012 4.158c1.858 0 2.96-1.582 2.96-3.99V7.84c0-2.426-1.079-3.996-2.936-3.996-1.864 0-2.965 1.588-2.965 3.996v.328c0 2.42 1.09 3.99 2.941 3.99'/>")
|
|
|
|
(0-square . "<path d='M7.988 12.158c-1.851 0-2.941-1.57-2.941-3.99V7.84c0-2.408 1.101-3.996 2.965-3.996 1.857 0 2.935 1.57 2.935 3.996v.328c0 2.408-1.101 3.99-2.959 3.99M8 4.951c-1.008 0-1.629 1.09-1.629 2.895v.31c0 1.81.627 2.895 1.629 2.895s1.623-1.09 1.623-2.895v-.31c0-1.8-.621-2.895-1.623-2.895'/><path d='M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm15 0a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1z'/>")))
|
|
|
|
|
|
|
|
(defun bi-icon (identifier)
|
|
|
|
(let ((icon-xml (rest (assoc identifier bi-icons)))
|
|
|
|
(class (concatenate 'string "bi bi-" (string-downcase identifier))))
|
|
|
|
(concatenate 'string
|
|
|
|
"<svg xmlns='http://www.w3.org/2000/svg' width=16 height=16 fill=currentColor "
|
|
|
|
"class="
|
|
|
|
class
|
|
|
|
" viewBox='0 0 16 16'>"
|
|
|
|
icon-xml
|
|
|
|
"</svg>")))
|