minor tweaks

This commit is contained in:
K Simmons 2022-09-21 16:25:07 -07:00
parent db5c83eb36
commit 79b9420017
2 changed files with 59 additions and 4 deletions

View File

@ -36,7 +36,7 @@ export default function tabBar(colorScheme: ColorScheme) {
const activePaneActiveTab = {
...tab,
background: background(elevation.top),
text: text(elevation.top, "sans", "base", "active", { size: "sm" }),
text: text(elevation.top, "sans", { size: "sm" }),
border: {
...tab.border,
bottom: false
@ -52,7 +52,7 @@ export default function tabBar(colorScheme: ColorScheme) {
const inactivePaneActiveTab = {
...tab,
background: background(layer),
text: text(layer, "sans", "base", "active", { size: "sm" }),
text: text(layer, "sans", "base", "variant", { size: "sm" }),
border: {
...tab.border,
bottom: false

View File

@ -144,13 +144,69 @@ function elevation(ramps: RampSet, isLight: boolean, shadow?: Shadow): Elevation
ramps,
bottom: topLayer(ramps, isLight),
middle: topLayer(ramps, isLight),
middle: middleLayer(ramps, isLight),
top: topLayer(ramps, isLight),
shadow,
};
}
function middleLayer(ramps: RampSet, isLight: boolean): Layer {
let defaultStyle: Style = {
background: ramps.neutral(0.2).hex(),
border: ramps.neutral(0.7).hex(),
foreground: ramps.neutral(1).hex(),
};
let variantStyle: Style = {
background: ramps.neutral(0.3).hex(),
border: ramps.neutral(0.6).hex(),
foreground: ramps.neutral(0.8).hex(),
};
let hoveredStyle: Style = {
background: ramps.neutral(0.4).hex(),
border: ramps.neutral(1.0).hex(),
foreground: ramps.neutral(0.9).hex(),
};
let pressedStyle: Style = {
background: ramps.neutral(0.55).hex(),
border: ramps.neutral(0.9).hex(),
foreground: ramps.neutral(0.9).hex(),
};
let activeStyle: Style = {
background: ramps.neutral(0.8).hex(),
border: ramps.neutral(0.8).hex(),
foreground: ramps.neutral(0.1).hex(),
};
let disabledStyle: Style = {
background: ramps.neutral(0.25).hex(),
border: ramps.neutral(1).hex(),
foreground: ramps.neutral(0.9).hex(),
};
let styleSet: StyleSet = {
default: defaultStyle,
variant: variantStyle,
hovered: hoveredStyle,
pressed: pressedStyle,
active: activeStyle,
disabled: disabledStyle,
};
return {
base: styleSet,
on: styleSet,
info: styleSet,
positive: styleSet,
warning: styleSet,
negative: styleSet
};
}
function topLayer(ramps: RampSet, isLight: boolean): Layer {
let defaultStyle: Style = {
background: ramps.neutral(0).hex(),
@ -164,7 +220,6 @@ function topLayer(ramps: RampSet, isLight: boolean): Layer {
foreground: ramps.neutral(0.8).hex(),
};
let hoveredStyle: Style = {
background: ramps.neutral(0.4).hex(),
border: ramps.neutral(1.0).hex(),