WIP snake_case 4/?
This commit is contained in:
parent
17f2fed3c8
commit
0627c198fd
25 changed files with 428 additions and 447 deletions
|
@ -1,24 +1,23 @@
|
|||
import { ColorScheme } from "../theme/color_scheme"
|
||||
import { withOpacity } from "../theme/color"
|
||||
import { with_opacity } from "../theme/color"
|
||||
import { background, border, text } from "./components"
|
||||
import { interactive, toggleable } from "../element"
|
||||
|
||||
export default function picker(colorScheme: ColorScheme): any {
|
||||
const layer = colorScheme.lowest
|
||||
export default function picker(theme: ColorScheme): any {
|
||||
const container = {
|
||||
background: background(layer),
|
||||
border: border(layer),
|
||||
shadow: colorScheme.modal_shadow,
|
||||
background: background(theme.lowest),
|
||||
border: border(theme.lowest),
|
||||
shadow: theme.modal_shadow,
|
||||
corner_radius: 12,
|
||||
padding: {
|
||||
bottom: 4,
|
||||
},
|
||||
}
|
||||
const inputEditor = {
|
||||
placeholderText: text(layer, "sans", "on", "disabled"),
|
||||
selection: colorScheme.players[0],
|
||||
text: text(layer, "mono", "on"),
|
||||
border: border(layer, { bottom: true }),
|
||||
const input_editor = {
|
||||
placeholder_text: text(theme.lowest, "sans", "on", "disabled"),
|
||||
selection: theme.players[0],
|
||||
text: text(theme.lowest, "mono", "on"),
|
||||
border: border(theme.lowest, { bottom: true }),
|
||||
padding: {
|
||||
bottom: 8,
|
||||
left: 16,
|
||||
|
@ -29,13 +28,13 @@ export default function picker(colorScheme: ColorScheme): any {
|
|||
bottom: 4,
|
||||
},
|
||||
}
|
||||
const emptyInputEditor: any = { ...inputEditor }
|
||||
delete emptyInputEditor.border
|
||||
delete emptyInputEditor.margin
|
||||
const empty_input_editor: any = { ...input_editor }
|
||||
delete empty_input_editor.border
|
||||
delete empty_input_editor.margin
|
||||
|
||||
return {
|
||||
...container,
|
||||
emptyContainer: {
|
||||
empty_container: {
|
||||
...container,
|
||||
padding: {},
|
||||
},
|
||||
|
@ -54,21 +53,21 @@ export default function picker(colorScheme: ColorScheme): any {
|
|||
right: 4,
|
||||
},
|
||||
corner_radius: 8,
|
||||
text: text(layer, "sans", "variant"),
|
||||
highlightText: text(layer, "sans", "accent", {
|
||||
text: text(theme.lowest, "sans", "variant"),
|
||||
highlight_text: text(theme.lowest, "sans", "accent", {
|
||||
weight: "bold",
|
||||
}),
|
||||
},
|
||||
state: {
|
||||
hovered: {
|
||||
background: withOpacity(
|
||||
background(layer, "hovered"),
|
||||
background: with_opacity(
|
||||
background(theme.lowest, "hovered"),
|
||||
0.5
|
||||
),
|
||||
},
|
||||
clicked: {
|
||||
background: withOpacity(
|
||||
background(layer, "pressed"),
|
||||
background: with_opacity(
|
||||
background(theme.lowest, "pressed"),
|
||||
0.5
|
||||
),
|
||||
},
|
||||
|
@ -77,20 +76,20 @@ export default function picker(colorScheme: ColorScheme): any {
|
|||
state: {
|
||||
active: {
|
||||
default: {
|
||||
background: withOpacity(
|
||||
background(layer, "base", "active"),
|
||||
background: with_opacity(
|
||||
background(theme.lowest, "base", "active"),
|
||||
0.5
|
||||
),
|
||||
},
|
||||
hovered: {
|
||||
background: withOpacity(
|
||||
background(layer, "hovered"),
|
||||
background: with_opacity(
|
||||
background(theme.lowest, "hovered"),
|
||||
0.5
|
||||
),
|
||||
},
|
||||
clicked: {
|
||||
background: withOpacity(
|
||||
background(layer, "pressed"),
|
||||
background: with_opacity(
|
||||
background(theme.lowest, "pressed"),
|
||||
0.5
|
||||
),
|
||||
},
|
||||
|
@ -98,10 +97,10 @@ export default function picker(colorScheme: ColorScheme): any {
|
|||
},
|
||||
}),
|
||||
|
||||
inputEditor,
|
||||
emptyInputEditor,
|
||||
noMatches: {
|
||||
text: text(layer, "sans", "variant"),
|
||||
input_editor,
|
||||
empty_input_editor,
|
||||
no_matches: {
|
||||
text: text(theme.lowest, "sans", "variant"),
|
||||
padding: {
|
||||
bottom: 8,
|
||||
left: 16,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue