Skip to content

Commit 38094ed

Browse files
committed
Preview: Fix background colour
Fixes Dark Mode issue
1 parent dd10a42 commit 38094ed

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

src/components/Preview/Preview.css.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export const header = style([
3636
gap: 'small',
3737
}),
3838
{
39+
backgroundColor: colorPaletteVars.background.previewBanner,
3940
borderBottom: `1px solid ${colorPaletteVars.border.standard}`,
4041
},
4142
]);
@@ -57,6 +58,7 @@ export const footer = style([
5758
gap: 'small',
5859
}),
5960
{
61+
backgroundColor: colorPaletteVars.background.previewBanner,
6062
borderTop: `1px solid ${colorPaletteVars.border.standard}`,
6163
},
6264
]);

src/css/palettes.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,12 @@ const darkPalette = {
186186
},
187187
};
188188

189+
const surfaceLight = mix(
190+
0.5,
191+
lightPalette.background[200],
192+
lightPalette.background[100]
193+
);
194+
189195
export const light = {
190196
code: {
191197
text: lightPalette.gray[1000],
@@ -212,15 +218,12 @@ export const light = {
212218
positive: lightPalette.teal[300],
213219
critical: lightPalette.red[300],
214220
body: mix(0.5, lightPalette.gray[100], lightPalette.background[200]),
215-
surface: mix(
216-
0.5,
217-
lightPalette.background[200],
218-
lightPalette.background[100]
219-
),
221+
surface: surfaceLight,
220222
floating: lightPalette.background[100],
221223
selection: lightPalette.gray[100],
222224
tooltip: lightPalette.gray[1000],
223225
textSelection: lightPalette.blue[400],
226+
previewBanner: surfaceLight,
224227
},
225228
border: {
226229
standard: lightPalette.gray[400],
@@ -269,6 +272,7 @@ export const dark = {
269272
selection: 'hsla(0,0%,12%,1)',
270273
tooltip: 'hsla(0,0%,0%,1)',
271274
textSelection: darkPalette.blue[400],
275+
previewBanner: surfaceLight,
272276
},
273277
border: {
274278
standard: darkPalette.gray[400],

src/css/sprinkles.css.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export const colorPaletteVars = createThemeContract({
3636
selection: null,
3737
tooltip: null,
3838
textSelection: null,
39+
previewBanner: null,
3940
},
4041
border: {
4142
standard: null,

0 commit comments

Comments
 (0)