Files
clj-ui-framework/bb.edn
Florian Schroedl e4ee7b750e feat(button): add link variant and polymorphic <a> rendering
When :href is provided, the button renders as <a> instead of <button>,
enabling navigation links with full button styling.

New :link variant renders as a minimal text link (underlined, accent
color, no background/padding) — works as both <button> and <a>.

CSS includes reset styles for a.btn (removes default link decoration)
and preserves underline for a.btn-link.
2026-03-03 17:04:41 +01:00

100 lines
4.1 KiB
Clojure

{:paths ["src" "test" "dev/hiccup/src"]
:tasks
{build-theme
{:doc "Generate dist/theme.css from tokens.edn and copy to dev targets"
:requires ([ui.css.gen :as gen]
[clojure.java.io :as io])
:task (do (gen/build-theme! {:input "src/theme/tokens.edn"
:output "dist/theme.css"})
(let [css (slurp "dist/theme.css")]
(spit "dev/replicant/public/theme.css" css)
(io/make-parents "dev/squint/public/theme.css")
(spit "dev/squint/public/theme.css" css)
(println "Copied theme.css to dev targets")))}
test
{:doc "Run all unit tests"
:requires ([clojure.test :as t]
[ui.button-test]
[ui.alert-test]
[ui.badge-test]
[ui.card-test]
[ui.accordion-test]
[ui.table-test]
[ui.dialog-test]
[ui.spinner-test]
[ui.skeleton-test]
[ui.progress-test]
[ui.switch-test]
[ui.tooltip-test]
[ui.breadcrumb-test]
[ui.pagination-test]
[ui.form-test]
[ui.theme-test])
:task (let [{:keys [fail error]} (t/run-tests
'ui.button-test
'ui.alert-test
'ui.badge-test
'ui.card-test
'ui.accordion-test
'ui.table-test
'ui.dialog-test
'ui.spinner-test
'ui.skeleton-test
'ui.progress-test
'ui.switch-test
'ui.tooltip-test
'ui.breadcrumb-test
'ui.pagination-test
'ui.form-test
'ui.theme-test)]
(when (pos? (+ fail error))
(System/exit 1)))}
dev-hiccup
{:doc "Start hiccup dev server on port 3003"
:depends [build-theme]
:requires ([dev.hiccup])
:task (do (dev.hiccup/start! {:port 3003})
(deref (promise)))}
dev-replicant
{:doc "Start replicant dev server on port 3001"
:depends [build-theme]
:task (shell {:dir "dev/replicant"} "npx shadow-cljs watch app")}
dev-squint
{:doc "Start squint dev server on port 3002"
:depends [build-theme]
:task (shell {:dir "dev/squint"} "npm run dev")}
dev
{:doc "Start all dev servers"
:depends [build-theme]
:requires ([dev.hiccup])
:task (do (dev.hiccup/start! {:port 3003})
(println "Dev servers running:")
(println " Replicant: cd dev/replicant && npx shadow-cljs watch app (port 3001)")
(println " Squint: cd dev/squint && npm run dev (port 3002)")
(println " Hiccup: http://localhost:3003")
(println " Test page: dev/index.html")
(deref (promise)))}
dev-all
{:doc "Start all dev servers in tmux panes"
:depends [build-theme]
:task (let [session "ui-dev"]
(shell {:continue true} "tmux kill-session -t" session)
(shell "tmux new-session -d -s" session "bb dev-hiccup")
(shell "tmux split-window -h -t" session "bash -c 'cd dev/replicant && npx shadow-cljs watch app'")
(shell "tmux split-window -v -t" session "bash -c 'cd dev/squint && npm run dev'")
(shell "tmux select-layout -t" session "tiled")
(println "Tmux session 'ui-dev' created with 3 panes:")
(println " Pane 0: Hiccup → http://localhost:3003")
(println " Pane 1: Replicant → http://localhost:3001")
(println " Pane 2: Squint → http://localhost:3002")
(println)
(when-not (zero? (:exit (shell {:continue true} "tmux attach -t" session)))
(println "Attach with: tmux attach -t" session)))}}}