From 2fd6bf3deceae84d829dd8a9c3827a7ceeabd5b5 Mon Sep 17 00:00:00 2001 From: Anubis <102488279+AnubisNekhet@users.noreply.github.com> Date: Mon, 11 Mar 2024 19:39:12 +0530 Subject: [PATCH] add latex support --- .prettierignore | 1 + obsidian.css | 24 ++++++++++++++ .../src/ext-colorschemes/flexoki-dark.scss | 31 +++++++++++++++++++ src/modules/Core/style-settings.scss | 19 ++++++++++++ src/modules/Markdown-Elements/index.scss | 1 + src/modules/Markdown-Elements/latex.scss | 4 +++ theme.css | 24 ++++++++++++++ 7 files changed, 104 insertions(+) create mode 100644 .prettierignore create mode 100644 snippets/src/ext-colorschemes/flexoki-dark.scss create mode 100644 src/modules/Markdown-Elements/latex.scss diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..b3a5267 --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +*.css diff --git a/obsidian.css b/obsidian.css index 5fbb3a0..68b24eb 100644 --- a/obsidian.css +++ b/obsidian.css @@ -569,6 +569,25 @@ settings: type: variable-number default: 200 +# File Editor & Markdown Elements :: LaTeX + + - + id: anp-latex-header + title: LaTex + type: heading + level: 2 + collapsed: true + - + id: anp-latex-color + title: LaTeX Color + type: variable-themed-color + description: Applies to LaTeX blocks + allowEmpty: true + format: hex + opacity: false + default-light: '#' + default-dark: '#' + # File Editor & Markdown Elements :: Lists - @@ -5224,6 +5243,11 @@ hr { background-color: transparent; } +/*-LaTeX-*/ +.math { + color: var(--anp-latex-color, var(--text-normal)); +} + .anp-toggle-metadata .frontmatter-container, .markdown-rendered.hide-metadata .frontmatter-container { display: none; } diff --git a/snippets/src/ext-colorschemes/flexoki-dark.scss b/snippets/src/ext-colorschemes/flexoki-dark.scss new file mode 100644 index 0000000..a6f2f91 --- /dev/null +++ b/snippets/src/ext-colorschemes/flexoki-dark.scss @@ -0,0 +1,31 @@ +$theme-flexoki-dark: ( + ctp-rosewater: #F5E0DC, + ctp-flamingo: #F2CDCD, + ctp-pink: #F5C2E7, + ctp-mauve: #CBA6F7, + ctp-red: #F38BA8, + ctp-maroon: #EBA0AC, + ctp-peach: #FAB387, + ctp-yellow: #F9E2AF, + ctp-green: #A6E3A1, + ctp-teal: #94E2D5, + ctp-sky: #89DCEB, + ctp-sapphire: #74C7EC, + ctp-blue: #87B0F9, + ctp-lavender: #B4BEFE, + ctp-text: #cfcec4, + ctp-subtext1: #b3b1a8, + ctp-subtext0: #9e9c94, + ctp-overlay2: #888681, + ctp-overlay1: #7b7a74, + ctp-overlay0: #6F6E69, + ctp-surface2: #575653, + ctp-surface1: #403E3C, + ctp-surface0: #343331, + ctp-base: #1C1B1A, + ctp-mantle: #100F0F, + ctp-crust: #080707, + ctp-accent: #24837B, + theme-mode: "dark", + theme-name: "flexoki-dark", +); diff --git a/src/modules/Core/style-settings.scss b/src/modules/Core/style-settings.scss index 25daa1f..a6bbd8c 100644 --- a/src/modules/Core/style-settings.scss +++ b/src/modules/Core/style-settings.scss @@ -555,6 +555,25 @@ settings: type: variable-number default: 200 +# File Editor & Markdown Elements :: LaTeX + + - + id: anp-latex-header + title: LaTex + type: heading + level: 2 + collapsed: true + - + id: anp-latex-color + title: LaTeX Color + type: variable-themed-color + description: Applies to LaTeX blocks + allowEmpty: true + format: hex + opacity: false + default-light: '#' + default-dark: '#' + # File Editor & Markdown Elements :: Lists - diff --git a/src/modules/Markdown-Elements/index.scss b/src/modules/Markdown-Elements/index.scss index f3e5771..ebfde6a 100644 --- a/src/modules/Markdown-Elements/index.scss +++ b/src/modules/Markdown-Elements/index.scss @@ -5,6 +5,7 @@ @import "headers.scss"; @import "hr.scss"; @import "lists.scss"; +@import "latex.scss"; @import "metadata.scss"; @import "tables.scss"; @import "properties.scss"; diff --git a/src/modules/Markdown-Elements/latex.scss b/src/modules/Markdown-Elements/latex.scss new file mode 100644 index 0000000..b25db0c --- /dev/null +++ b/src/modules/Markdown-Elements/latex.scss @@ -0,0 +1,4 @@ +/*-LaTeX-*/ +.math { + color: var(--anp-latex-color, var(--text-normal)); +} diff --git a/theme.css b/theme.css index 5fbb3a0..68b24eb 100644 --- a/theme.css +++ b/theme.css @@ -569,6 +569,25 @@ settings: type: variable-number default: 200 +# File Editor & Markdown Elements :: LaTeX + + - + id: anp-latex-header + title: LaTex + type: heading + level: 2 + collapsed: true + - + id: anp-latex-color + title: LaTeX Color + type: variable-themed-color + description: Applies to LaTeX blocks + allowEmpty: true + format: hex + opacity: false + default-light: '#' + default-dark: '#' + # File Editor & Markdown Elements :: Lists - @@ -5224,6 +5243,11 @@ hr { background-color: transparent; } +/*-LaTeX-*/ +.math { + color: var(--anp-latex-color, var(--text-normal)); +} + .anp-toggle-metadata .frontmatter-container, .markdown-rendered.hide-metadata .frontmatter-container { display: none; }