Rename stylesheets to styles

This commit is contained in:
Akira Tempaku 2024-04-22 15:00:33 +09:00
parent 4cc94d5090
commit 431e0c8de7
2 changed files with 12 additions and 12 deletions
src/view/components/document

View file

@ -1,9 +1,9 @@
(defpackage #:hp/view/components/document/main
(:use #:cl)
(:local-nicknames (#:pi #:piccolo))
(:import-from #:hp/view/components/document/stylesheets
#:stylesheets
#:on-demand-stylesheets)
(:import-from #:hp/view/components/document/styles
#:styles
#:on-demand-styles)
(:import-from #:hp/view/components/document/scripts
#:scripts)
(:import-from #:hp/view/components/document/seo
@ -17,7 +17,7 @@
(html :lang "ja"
(head
(meta :charset "UTF-8")
(stylesheets pi:children)
(styles pi:children)
(scripts)
(seo metadata))
pi:children)))
@ -26,5 +26,5 @@
(pi:h
(<>
(head :hx-head "append"
(on-demand-stylesheets pi:children))
(on-demand-styles pi:children))
pi:children)))

View file

@ -1,12 +1,12 @@
(defpackage #:hp/view/components/document/stylesheets
(defpackage #:hp/view/components/document/styles
(:use #:cl)
(:local-nicknames (#:pi #:piccolo))
(:import-from #:hp/view/asset
#:define-asset
#:get-css-paths)
(:export #:on-demand-stylesheets
#:stylesheets))
(in-package #:hp/view/components/document/stylesheets)
(:export #:on-demand-styles
#:styles))
(in-package #:hp/view/components/document/styles)
(define-asset *ress*
:vendor "ress@5.0.2.css")
@ -14,7 +14,7 @@
(define-asset *global-css*
:css "global.css")
(pi:define-element on-demand-stylesheets ()
(pi:define-element on-demand-styles ()
(let* ((pi:*escape-html* nil)
(html-str (pi:elem-str pi:children))
(css-paths (get-css-paths html-str)))
@ -24,12 +24,12 @@
(link :rel "stylesheet" :type "text/css" :href path))
css-paths)))))
(pi:define-element stylesheets ()
(pi:define-element styles ()
(pi:h
(<>
(link :rel "stylesheet" :type "text/css" :href *ress*)
(link :rel "stylesheet" :type "text/css" :href *global-css*)
(on-demand-stylesheets pi:children)
(on-demand-styles pi:children)
(link :rel "preconnect" :href "https://fonts.googleapis.com")
(link :rel "preconnect" :href "https://fonts.gstatic.com" :crossorigin t)
(link