Function: htmlize-css-specs

htmlize-css-specs is a byte-compiled function defined in htmlize.el.

Signature

(htmlize-css-specs FSTRUCT)

Source Code

;; Defined in ~/.emacs.d/elpa/htmlize-20250724.1703/htmlize.el
;;; CSS based output support.

;; Internal function; not a method.
(defun htmlize-css-specs (fstruct)
  (let (result)
    (when (htmlize-fstruct-foreground fstruct)
      (push (format "color: %s;" (htmlize-fstruct-foreground fstruct))
            result))
    (when (htmlize-fstruct-background fstruct)
      (push (format "background-color: %s;"
                    (htmlize-fstruct-background fstruct))
            result))
    (let ((size (htmlize-fstruct-size fstruct)))
      (when (and size (not (eq htmlize-ignore-face-size t)))
        (cond ((floatp size)
               (push (format "font-size: %d%%;" (* 100 size)) result))
              ((not (eq htmlize-ignore-face-size 'absolute))
               (push (format "font-size: %spt;" (/ size 10.0)) result)))))
    (when (htmlize-fstruct-boldp fstruct)
      (push "font-weight: bold;" result))
    (when (htmlize-fstruct-italicp fstruct)
      (push "font-style: italic;" result))
    (when (htmlize-fstruct-underlinep fstruct)
      (push "text-decoration: underline;" result))
    (when (htmlize-fstruct-overlinep fstruct)
      (push "text-decoration: overline;" result))
    (when (htmlize-fstruct-strikep fstruct)
      (push "text-decoration: line-through;" result))
    (nreverse result)))