ludic/packages/ludic.ui/attr_border.ludic
Orkuncakilkaya 584e455f2d feat(ui): per-side borders (border-top/right/bottom/left)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 17:43:42 +03:00

26 lines
705 B
Text

# attr_border.ludic - border widths, all sides or one
# every side's border the same width
function el_sides_border(n: UiNode, w: float) -> void {
n.border = w
n.bt = w
n.br = w
n.bb = w
n.bl = w
}
# border-bottom: 3px solid var(--accent) - one side's width, and the colour for the border
function el_border_side(n: UiNode, key: string, s: string) -> void {
let keep_t = n.bt
let keep_r = n.br
let keep_b = n.bb
let keep_l = n.bl
el_border(n, s)
let w = n.bt
n.bt = keep_t
n.br = keep_r
n.bb = keep_b
n.bl = keep_l
if key == "border-top" { n.bt = w }
if key == "border-right" { n.br = w }
if key == "border-bottom" { n.bb = w }
if key == "border-left" { n.bl = w }
}