feat: make colors configurable
This commit is contained in:
committed by
Mathias Schopmans
parent
f7e36ddc9d
commit
e1386c0385
@@ -44,14 +44,14 @@
|
||||
}
|
||||
|
||||
.content {
|
||||
background: var(--foreground);
|
||||
background: var(--content);
|
||||
color: var(--text);
|
||||
border-radius: 6px;
|
||||
padding: 30px 15px;
|
||||
}
|
||||
|
||||
.content a {
|
||||
color: var(--highlight);
|
||||
color: var(--link);
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Roboto } from "next/font/google";
|
||||
import type { FC, ReactNode } from "react";
|
||||
import { FC, ReactNode } from "react";
|
||||
|
||||
import styles from "./Layout.module.css";
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><rect width="12" height="12" x="2" y="2" fill="#FFF" rx="3" transform="rotate(-45 8 8)"/></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><rect width="12" height="12" x="2" y="2" rx="3" transform="rotate(-45 8 8)"/></svg>
|
||||
|
Before Width: | Height: | Size: 155 B After Width: | Height: | Size: 143 B |
@@ -1 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><circle cx="8" cy="8" r="6" fill="#FFF"/></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><circle cx="8" cy="8" r="6"/></svg>
|
||||
|
Before Width: | Height: | Size: 107 B After Width: | Height: | Size: 95 B |
@@ -1 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg"><path fill="#FFF" d="m.247 10.212 5.02-8.697a2 2 0 0 1 3.465 0l5.021 8.697a2 2 0 0 1-1.732 3H1.98a2 2 0 0 1-1.732-3z"/></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg"><path d="m.247 10.212 5.02-8.697a2 2 0 0 1 3.465 0l5.021 8.697a2 2 0 0 1-1.732 3H1.98a2 2 0 0 1-1.732-3z"/></svg>
|
||||
|
Before Width: | Height: | Size: 165 B After Width: | Height: | Size: 153 B |
@@ -15,6 +15,10 @@ export function getChartConfig() {
|
||||
return config.chart;
|
||||
}
|
||||
|
||||
export function getColors() {
|
||||
return config.colors;
|
||||
}
|
||||
|
||||
export function getFlags() {
|
||||
return config.flags;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,22 @@
|
||||
import { Head, Html, Main, NextScript } from "next/document";
|
||||
import { CSSProperties, useMemo } from "react";
|
||||
|
||||
import { getColors } from "@/lib/data";
|
||||
|
||||
export default function Document() {
|
||||
const style = useMemo(() => {
|
||||
const cssVariables: Record<string, any> = {};
|
||||
const colors = getColors();
|
||||
|
||||
Object.entries(colors).forEach(([key, value]) => {
|
||||
cssVariables[`--${key}`] = value;
|
||||
});
|
||||
|
||||
return cssVariables as CSSProperties;
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Html lang="en">
|
||||
<Html lang="en" style={style}>
|
||||
<Head />
|
||||
<body>
|
||||
<Main />
|
||||
|
||||
@@ -7,15 +7,12 @@
|
||||
|
||||
--foreground: #fff;
|
||||
--background: #173d7a;
|
||||
--content: #fff;
|
||||
--text: #575757;
|
||||
--link: #029df7;
|
||||
--highlight: #029df7;
|
||||
--border: rgba(255, 255, 255, 0.1);
|
||||
--tag: rgba(255, 255, 255, 0.1);
|
||||
|
||||
--overlay: #081a37b5;
|
||||
--dialog-bg: #173d7a;
|
||||
|
||||
--badge: #333; /* local color which get's overridden by the element */
|
||||
}
|
||||
|
||||
* {
|
||||
|
||||
Reference in New Issue
Block a user