Rework darkest color in base16, shadows, and add hoverPopover styleTree

This commit is contained in:
Keith Simmons
2022-06-07 11:47:38 -07:00
parent 0c4f798a2d
commit 02249dc2e8
8 changed files with 128 additions and 99 deletions
+4 -3
View File
@@ -4,9 +4,10 @@ import {
backgroundColor,
border,
player,
shadow,
modalShadow,
text,
TextColor
TextColor,
popoverShadow
} from "./components";
export default function chatPanel(theme: Theme) {
@@ -69,7 +70,7 @@ export default function chatPanel(theme: Theme) {
cornerRadius: 6,
padding: 4,
border: border(theme, "primary"),
shadow: shadow(theme),
shadow: popoverShadow(theme),
},
},
signInPrompt: text(theme, "sans", "secondary", { underline: true }),
+11 -2
View File
@@ -1,4 +1,5 @@
import chroma from "chroma-js";
import { isIPv4 } from "net";
import Theme, { BackgroundColorSet } from "../themes/common/theme";
import { fontFamilies, fontSizes, FontWeight } from "../tokens";
import { Color } from "../utils/color";
@@ -84,10 +85,18 @@ export function backgroundColor(
return theme.backgroundColor[name][state || "base"].value;
}
export function shadow(theme: Theme) {
export function modalShadow(theme: Theme) {
return {
blur: 16,
color: chroma("black").alpha(theme.shadowAlpha.value).hex(),
color: theme.shadow.value,
offset: [0, 2],
};
}
export function popoverShadow(theme: Theme) {
return {
blur: 4,
color: theme.shadow.value,
offset: [1, 2],
};
}
+2
View File
@@ -4,6 +4,7 @@ import {
border,
iconColor,
player,
popoverShadow,
text,
TextColor
} from "./components";
@@ -80,6 +81,7 @@ export default function editor(theme: Theme) {
cornerRadius: 8,
padding: 4,
border: border(theme, "secondary"),
shadow: popoverShadow(theme),
item: autocompleteItem,
hoveredItem: {
...autocompleteItem,
+20
View File
@@ -0,0 +1,20 @@
import Theme from "../themes/common/theme";
import { backgroundColor, border, popoverShadow } from "./components";
export default function HoverPopover(theme: Theme) {
return {
background: backgroundColor(theme, 500),
cornerRadius: 8,
padding: {
left: 8,
right: 8,
top: 4,
bottom: 4
},
shadow: popoverShadow(theme),
border: border(theme, "primary"),
margin: {
left: -14,
},
}
}
+2 -2
View File
@@ -1,5 +1,5 @@
import Theme from "../themes/common/theme";
import { backgroundColor, border, player, shadow, text } from "./components";
import { backgroundColor, border, player, modalShadow, text } from "./components";
export default function picker(theme: Theme) {
return {
@@ -48,6 +48,6 @@ export default function picker(theme: Theme) {
top: 7,
},
},
shadow: shadow(theme),
shadow: modalShadow(theme),
};
}
+2 -2
View File
@@ -1,6 +1,6 @@
import Theme from "../themes/common/theme";
import { withOpacity } from "../utils/color";
import { backgroundColor, border, iconColor, shadow, text } from "./components";
import { backgroundColor, border, iconColor, modalShadow, text } from "./components";
import statusBar from "./statusBar";
export function workspaceBackground(theme: Theme) {
@@ -164,7 +164,7 @@ export default function workspace(theme: Theme) {
cornerRadius: 6,
padding: 12,
border: border(theme, "primary"),
shadow: shadow(theme),
shadow: modalShadow(theme),
},
notifications: {
width: 380,