ludic/packages/ludic.ui/attr_border.ludic
Orkuncakilkaya 19fcf60599 wip(0.S3): packages and examples migrated again from their pre-0.S sources in one run
ludic migrate state packages <every example program> packages/ludic.lab/example/plate.ludic
  1804 vars into 126 states, 64 into lets; 23498 edits in 460 files

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 15:31:34 +03:00

26 lines
732 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(ui_st: mut UiState, 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(ui_st, 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 }
}