feat(ui): per-side borders (border-top/right/bottom/left)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
0a7525b125
commit
584e455f2d
8 changed files with 50 additions and 16 deletions
26
packages/ludic.ui/attr_border.ludic
Normal file
26
packages/ludic.ui/attr_border.ludic
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# 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 }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue