Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 843da47

Browse files
committed
Add codeBlock palette color
1 parent 6430217 commit 843da47

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

site/theme/palettes.ts

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ import { Palette } from "@material-ui/core/styles/createPalette"
44
*/
55
declare module "@material-ui/core/styles/createPalette" {
66
interface Palette {
7+
codeBlock: {
8+
// Text color for codeblocks
9+
contrastText: string
10+
// Background color for codeblocks
11+
main: string
12+
}
713
navbar: {
814
main: string
915
}
@@ -17,6 +23,10 @@ declare module "@material-ui/core/styles/createPalette" {
1723
}
1824

1925
interface PaletteOptions {
26+
codeBlock: {
27+
contrastText: string
28+
main: string
29+
}
2030
navbar: {
2131
main: string
2232
}
@@ -32,7 +42,18 @@ declare module "@material-ui/core/styles/createPalette" {
3242
*/
3343
export type CustomPalette = Pick<
3444
Palette,
35-
"action" | "background" | "divider" | "error" | "hero" | "info" | "navbar" | "primary" | "secondary" | "text" | "type"
45+
| "action"
46+
| "background"
47+
| "codeBlock"
48+
| "divider"
49+
| "error"
50+
| "hero"
51+
| "info"
52+
| "navbar"
53+
| "primary"
54+
| "secondary"
55+
| "text"
56+
| "type"
3657
>
3758

3859
/**
@@ -47,7 +68,10 @@ export const lightPalette: CustomPalette = {
4768
default: "#F3F3F3",
4869
paper: "#FFF",
4970
},
50-
71+
codeBlock: {
72+
main: "#F3F3F3",
73+
contrastText: "rgba(0, 0, 0, 0.9)",
74+
},
5175
primary: {
5276
main: "#519A54",
5377
light: "#A2E0A5",
@@ -108,6 +132,10 @@ export const darkPalette: CustomPalette = {
108132
secondary: lightPalette.secondary,
109133
info: lightPalette.info,
110134
error: lightPalette.error,
135+
codeBlock: {
136+
main: "rgb(24, 26, 27)",
137+
contrastText: "rgba(255, 255, 255, 0.8)",
138+
},
111139
hero: {
112140
main: "#141414",
113141
button: "#333333",

0 commit comments

Comments
 (0)