Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/darshanbaral/aafu.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/partials/head.html')
-rw-r--r--layouts/partials/head.html46
1 files changed, 40 insertions, 6 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 6e71286..8f37803 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -20,17 +20,51 @@
href="//fonts.googleapis.com/css?family=Didact+Gothic%7CRoboto:400%7CRoboto+Mono"
/>
- <link
- id="color-CSS"
- rel="stylesheet"
- href="{{ print `/css/aafu_` .Site.Params.theme.mainTheme `.css` | relURL }}"
- type="text/css"
- />
<link rel="stylesheet" href="{{ `/css/aafu.css` | relURL }}" />
<script>
+ const colors = {
+ light: {
+ primaryBg: "#f8f9fa",
+ primaryText: "black",
+ primaryLinks: "#007bff",
+ secondaryBg: "#fff",
+ secondaryText: "black",
+ secondaryLinks: "#007bff",
+ shadow: "#595659"
+ },
+ dark: {
+ primaryBg: "#2c2b2b",
+ primaryText: "white",
+ primaryLinks: "#ffc107",
+ secondaryBg: "#373737",
+ secondaryText: "white",
+ secondaryLinks: "#ffc107",
+ shadow: "black"
+ },
+ pinkish: {
+ primaryBg: "#f8f9fa",
+ primaryText: "black",
+ primaryLinks: "#81415f",
+ secondaryBg: "#81415f",
+ secondaryText: "white",
+ secondaryLinks: "#ffc107",
+ shadow: "#595659"
+ }
+ };
+ const mainTheme = {{ .Site.Params.theme.mainTheme }};
+ let currentTheme = mainTheme;
+ const altTheme = {{ .Site.Params.theme.altTheme }};
+ const foo = (theme) => {
+ let thisTheme = colors[theme];
+ Object.keys(thisTheme).forEach(function(key) {
+ document.documentElement.style.setProperty(`--${key}`, thisTheme[key]);
+ });
+ };
var themeColor = document.querySelector("meta[name=theme-color]");
window.onload = function() {
+ foo(currentTheme);
+ const root = document.documentElement;
themeColor.content = getComputedStyle(document.body)["background-color"];
let defaultActivePanel = document.querySelector(".accordion.active")
.nextElementSibling;