UNPKG

verstak

Version:
31 lines (30 loc) 1.29 kB
import { runTransactional, ReactiveTreeVariable, Isolation } from "reactronic"; import { DefaultButtonStyling } from "./theme/Button.s.js"; import { DefaultInputStyling } from "./theme/Input.s.js"; import { DefaultIconStyling } from "./theme/Icon.s.js"; import { DefaultToggleStyling } from "./theme/Toggle.s.js"; export class Theme { constructor() { this.name = "Default Gost Theme"; this.fillColor = "white"; this.textColor = "black"; this.positiveColor = "green"; this.negativeColor = "red"; this.borderRadius = "0.35rem"; this.outlineWidth = "1px"; this.outlineColor = "rgba(127, 127, 127, 0.5)"; this.outlinePadding = "0.25em"; this.shadow = "0.1rem 0.1rem 0.5rem 0 rgba(127, 127, 127, 0.5)"; this.button = new DefaultButtonStyling(this); this.input = new DefaultInputStyling(this); this.icon = new DefaultIconStyling(this); this.toggle = new DefaultToggleStyling(this); } static get current() { return Theme.gCurrent.value; } static set current(value) { Theme.gCurrent.value = value; } } Theme.gCurrent = new ReactiveTreeVariable(Theme.name, runTransactional({ isolation: Isolation.disjoinFromOuterTransaction }, () => new Theme()));