fixing hitTest bounds for clickable. using Constructors for Clickable events. starting to think about design systems..
parent
5af3af6b6c
commit
86996ed4ef
@ -0,0 +1,38 @@
|
|||||||
|
colors = {
|
||||||
|
primary = "#0066cc",
|
||||||
|
primaryDark = "#0052a3",
|
||||||
|
danger = "#dc3545",
|
||||||
|
success = "#28a745",
|
||||||
|
bg = "#ffffff",
|
||||||
|
bgGray = "#f8f9fa",
|
||||||
|
text = "#212529",
|
||||||
|
textLight = "#6c757d",
|
||||||
|
border = "#dee2e6"
|
||||||
|
};
|
||||||
|
|
||||||
|
spacing = {
|
||||||
|
xs = 4,
|
||||||
|
sm = 8,
|
||||||
|
md = 16,
|
||||||
|
lg = 32,
|
||||||
|
xl = 64
|
||||||
|
};
|
||||||
|
|
||||||
|
primaryStyle = {
|
||||||
|
bg = colors.primary,
|
||||||
|
fg = colors.bg,
|
||||||
|
px = spacing.md,
|
||||||
|
py = spacing.sm
|
||||||
|
};
|
||||||
|
|
||||||
|
dangerStyle = {
|
||||||
|
bg = colors.danger,
|
||||||
|
fg = colors.bg,
|
||||||
|
px = spacing.md,
|
||||||
|
py = spacing.sm
|
||||||
|
};
|
||||||
|
|
||||||
|
theme = {
|
||||||
|
colors = colors,
|
||||||
|
spacing = spacing
|
||||||
|
};
|
||||||
@ -1,10 +1,11 @@
|
|||||||
|
# button : Record -> UI
|
||||||
button = config \
|
button = config \
|
||||||
Clickable {
|
Clickable {
|
||||||
event = config.event,
|
event = config.event,
|
||||||
child = Stack {
|
child = Stack {
|
||||||
children = [
|
children = [
|
||||||
Rect { w = 100, h = 40, color = "blue" },
|
Rect { w = 100, h = 40, color = config.theme.colors.primary },
|
||||||
Text { content = config.label, x = 10, y = 25}
|
Text { content = config.label, x = 10, y = 25, color = config.theme.colors.bg }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue