Skip to content

Commit

Permalink
add mocha theme
Browse files Browse the repository at this point in the history
  • Loading branch information
janmasrovira committed Jul 29, 2024
1 parent 1acdebe commit af60968
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 0 deletions.
106 changes: 106 additions & 0 deletions assets/css/source-mocha.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
/* Color palette based on https://github.com/catppuccin/catppuccin#-palette */

:root {
--ctp-mocha-rosewater: #f5e0dc;
--ctp-mocha-flamingo: #f2cdcd;
--ctp-mocha-pink: #f5c2e7;
--ctp-mocha-mauve: #cba6f7;
--ctp-mocha-red: #f38ba8;
--ctp-mocha-maroon: #eba0ac;
--ctp-mocha-peach: #fab387;
--ctp-mocha-yellow: #f9e2af;
--ctp-mocha-green: #a6e3a1;
--ctp-mocha-teal: #94e2d5;
--ctp-mocha-sky: #89dceb;
--ctp-mocha-sapphire: #74c7ec;
--ctp-mocha-blue: #89b4fa;
--ctp-mocha-lavender: #b4befe;
--ctp-mocha-text: #cdd6f4;
--ctp-mocha-subtext1: #bac2de;
--ctp-mocha-subtext0: #a6adc8;
--ctp-mocha-overlay2: #9399b2;
--ctp-mocha-overlay1: #7f849c;
--ctp-mocha-overlay0: #6c7086;
--ctp-mocha-surface2: #585b70;
--ctp-mocha-surface1: #45475a;
--ctp-mocha-surface0: #313244;
--ctp-mocha-base: #1e1e2e;
--ctp-mocha-mantle: #181825;
--ctp-mocha-crust: #11111b;
}

body {
background-color: var(--ctp-mocha-base);
}

.ju-inductive {
color: var(--ctp-mocha-green);
}

.ju-constructor {
color: var(--ctp-mocha-mauve);
}

.ju-function {
color: var(--ctp-mocha-yellow);
}

.ju-axiom {
color: var(--ctp-mocha-red);
}

.ju-string {
color: var(--ctp-mocha-flamingo);
}

.ju-keyword {
color: var(--ctp-mocha-sky);
}

.ju-delimiter {
color: var(--ctp-mocha-overlay2);
}

.ju-var {
color: var(--ctp-mocha-text);
}

.ju-fixity {
color: var(--ctp-mocha-sapphire);
}

.ju-comment {
color: var(--ctp-mocha-rosewater);
}

.ju-judoc {
color: var(--ctp-mocha-teal);
}

.ju-number {
color: var(--ctp-mocha-subtext1);
}

.ju-define {
font-weight: bold;
}

a:link,
a:visited {
text-decoration: none;
}

a:hover,
a.hover-highlight {
background-color: var(--ctp-mocha-mantle);
}

footer {
color: var(--ctp-mocha-subtext1);
}

footer a {
color: var(--ctp-mocha-subtext1);
font-size: small;
font-weight: bold;
}
3 changes: 3 additions & 0 deletions src/Juvix/Compiler/Backend/Html/Data/Options.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ data Theme
| Macchiato
| Latte
| Frappe
| Mocha
deriving stock (Enum, Eq, Ord, Bounded, Data)

instance Show Theme where
Expand All @@ -50,6 +51,7 @@ instance Show Theme where
Macchiato -> "macchiato"
Latte -> "latte"
Frappe -> "frappe"
Mocha -> "mocha"

data ThemeLight
= Dark
Expand All @@ -62,6 +64,7 @@ themeLight = \case
Macchiato -> Dark
Latte -> Light
Frappe -> Dark
Mocha -> Dark

data HtmlKind
= HtmlDoc
Expand Down
4 changes: 4 additions & 0 deletions src/Juvix/Compiler/Backend/Html/Extra.hs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ macchiatoCss = cssLink "source-macchiato.css"
frappeCss :: (Members '[Reader HtmlOptions] r) => Sem r Html
frappeCss = cssLink "source-frappe.css"

mochaCss :: (Members '[Reader HtmlOptions] r) => Sem r Html
mochaCss = cssLink "source-mocha.css"

themeCss :: (Members '[Reader HtmlOptions] r) => Sem r Html
themeCss = do
theme <- asks (^. htmlOptionsTheme)
Expand All @@ -77,6 +80,7 @@ themeCss = do
Macchiato -> macchiatoCss
Latte -> latteCss
Frappe -> frappeCss
Mocha -> mochaCss

highlightJs :: (Members '[Reader HtmlOptions] r) => Sem r Html
highlightJs = jsLink "highlight.js"
Expand Down

0 comments on commit af60968

Please sign in to comment.