feat: add code block colors & fonts

This commit is contained in:
thecodrr
2022-06-04 11:52:06 +05:00
committed by Abdullah Atta
parent 98f7cc8007
commit ca49c36228
4 changed files with 24 additions and 3 deletions

View File

@@ -1,11 +1,11 @@
{
"name": "notesnook-editor",
"name": "@notesnook/theme",
"version": "0.0.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "notesnook-editor",
"name": "@notesnook/theme",
"version": "0.0.1",
"dependencies": {
"@rebass/forms": "^4.0.6",

View File

@@ -12,6 +12,14 @@ export type StaticColors = {
warn: string;
warnBg: string;
favorite: string;
codeBg: string;
codeFg: string;
codeHighlight: string;
codeSelectionBg: string;
codeSelectionFg: string;
codeBorder: string;
codeSelection: string;
};
export function getStaticColors(accent: string): StaticColors {
return {
@@ -26,5 +34,14 @@ export function getStaticColors(accent: string): StaticColors {
warn: "#FF5722",
warnBg: "#FF572220",
favorite: "#ffd700",
// dracula colors
codeBg: "#282a36",
codeFg: "#6c7393",
codeHighlight: "#50fa7b",
codeSelectionFg: "#f8f8f2",
codeSelectionBg: "#44475a",
codeBorder: "#6c7393",
codeSelection: "#9580ff1a",
};
}

View File

@@ -8,6 +8,7 @@ export function getFontSizes(scale?: number): FontSizes {
body: "0.8rem",
menu: "0.8rem",
subBody: "0.750rem",
code: "0.9rem",
};
}
@@ -20,4 +21,5 @@ export type FontSizes = {
body: string;
menu: string;
subBody: string;
code: string;
};

View File

@@ -8,7 +8,7 @@ export type FontConfig = {
heading: number;
bold: number;
};
fonts: { body: string; heading: string };
fonts: { body: string; monospace: string; heading: string };
};
export function getFontConfig(scale?: number): FontConfig {
return {
@@ -21,6 +21,8 @@ export function getFontConfig(scale?: number): FontConfig {
},
fonts: {
body: `Open Sans,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Oxygen-Sans,Ubuntu,Cantarell,sans-serif;`,
monospace:
"ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace",
heading: `Open Sans,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Oxygen-Sans,Ubuntu,Cantarell,sans-serif;`,
},
};