Skip to content

refactor: Add <CodeBlock /> component #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Feb 7, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add codeBlock palette color
  • Loading branch information
bryphe-coder committed Feb 4, 2022
commit 843da47e606087adce02523aad88cf43e654d5fc
32 changes: 30 additions & 2 deletions site/theme/palettes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ import { Palette } from "@material-ui/core/styles/createPalette"
*/
declare module "@material-ui/core/styles/createPalette" {
interface Palette {
codeBlock: {
// Text color for codeblocks
contrastText: string
// Background color for codeblocks
main: string
}
navbar: {
main: string
}
Expand All @@ -17,6 +23,10 @@ declare module "@material-ui/core/styles/createPalette" {
}

interface PaletteOptions {
codeBlock: {
contrastText: string
main: string
}
navbar: {
main: string
}
Expand All @@ -32,7 +42,18 @@ declare module "@material-ui/core/styles/createPalette" {
*/
export type CustomPalette = Pick<
Palette,
"action" | "background" | "divider" | "error" | "hero" | "info" | "navbar" | "primary" | "secondary" | "text" | "type"
| "action"
| "background"
| "codeBlock"
| "divider"
| "error"
| "hero"
| "info"
| "navbar"
| "primary"
| "secondary"
| "text"
| "type"
>

/**
Expand All @@ -47,7 +68,10 @@ export const lightPalette: CustomPalette = {
default: "#F3F3F3",
paper: "#FFF",
},

codeBlock: {
main: "#F3F3F3",
contrastText: "rgba(0, 0, 0, 0.9)",
},
primary: {
main: "#519A54",
light: "#A2E0A5",
Expand Down Expand Up @@ -108,6 +132,10 @@ export const darkPalette: CustomPalette = {
secondary: lightPalette.secondary,
info: lightPalette.info,
error: lightPalette.error,
codeBlock: {
main: "rgb(24, 26, 27)",
contrastText: "rgba(255, 255, 255, 0.8)",
},
hero: {
main: "#141414",
button: "#333333",
Expand Down