WIP Restyle channel modal
Co-Authored-By: Mikayla Maki <mikayla.c.maki@gmail.com>
This commit is contained in:
co-authored by
Mikayla Maki
parent
b21b17c120
commit
ff1261b300
@@ -0,0 +1,26 @@
|
||||
import { useTheme } from "../common"
|
||||
import { background, border, text } from "../style_tree/components"
|
||||
|
||||
export const input = () => {
|
||||
const theme = useTheme()
|
||||
|
||||
return {
|
||||
background: background(theme.highest),
|
||||
corner_radius: 8,
|
||||
min_width: 200,
|
||||
max_width: 500,
|
||||
placeholder_text: text(theme.highest, "mono", "disabled"),
|
||||
selection: theme.players[0],
|
||||
text: text(theme.highest, "mono", "default"),
|
||||
border: border(theme.highest),
|
||||
margin: {
|
||||
right: 12,
|
||||
},
|
||||
padding: {
|
||||
top: 3,
|
||||
bottom: 3,
|
||||
left: 12,
|
||||
right: 8,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@ interface TextButtonOptions {
|
||||
| Theme["lowest"]
|
||||
| Theme["middle"]
|
||||
| Theme["highest"]
|
||||
variant?: "default" | "ghost"
|
||||
color?: keyof Theme["lowest"]
|
||||
margin?: Partial<Margin>
|
||||
text_properties?: TextProperties
|
||||
@@ -23,6 +24,7 @@ type ToggleableTextButtonOptions = TextButtonOptions & {
|
||||
}
|
||||
|
||||
export function text_button({
|
||||
variant = "default",
|
||||
color,
|
||||
layer,
|
||||
margin,
|
||||
@@ -59,7 +61,7 @@ export function text_button({
|
||||
},
|
||||
state: {
|
||||
default: {
|
||||
background: background(layer ?? theme.lowest, color),
|
||||
background: variant !== "ghost" ? background(layer ?? theme.lowest, color) : null,
|
||||
color: foreground(layer ?? theme.lowest, color),
|
||||
},
|
||||
hovered: {
|
||||
@@ -76,14 +78,15 @@ export function text_button({
|
||||
|
||||
export function toggleable_text_button(
|
||||
theme: Theme,
|
||||
{ color, active_color, margin }: ToggleableTextButtonOptions
|
||||
{ variant, color, active_color, margin }: ToggleableTextButtonOptions
|
||||
) {
|
||||
if (!color) color = "base"
|
||||
|
||||
return toggleable({
|
||||
state: {
|
||||
inactive: text_button({ color, margin }),
|
||||
inactive: text_button({ variant, color, margin }),
|
||||
active: text_button({
|
||||
variant,
|
||||
color: active_color ? active_color : color,
|
||||
margin,
|
||||
layer: theme.middle,
|
||||
|
||||
Reference in New Issue
Block a user