From f63e429169486dfd9e03757da20fb8d7dce8f6c1 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Sun, 9 Nov 2025 16:30:35 -0500 Subject: [PATCH] fix: theme --- astro.config.mjs | 6 ++---- public/scripts/models-of-production.js | 19 ++++++------------- public/styles/graph.css | 10 ++++++++++ public/styles/posts.css | 6 +++--- src/layouts/BaseLayout.astro | 4 +++- src/layouts/PostLayout.astro | 5 ++++- src/utils/colors.js | 2 +- 7 files changed, 29 insertions(+), 23 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index 86b2383..f1fd94c 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -14,7 +14,6 @@ const midnight = { tokenColors: [ { scope: [ - "keyword", "storage.type", "storage.modifier", "keyword.control", @@ -31,7 +30,7 @@ const midnight = { "constant.character", "number", ], - settings: { foreground: "#e5c07b" }, + settings: { foreground: "#98c379" }, }, ], }; @@ -46,7 +45,6 @@ const daylight = { tokenColors: [ { scope: [ - "keyword", "storage.type", "storage.modifier", "keyword.control", @@ -63,7 +61,7 @@ const daylight = { "constant.character", "number", ], - settings: { foreground: "#996800" }, + settings: { foreground: "#2d7f3e" }, }, ], }; diff --git a/public/scripts/models-of-production.js b/public/scripts/models-of-production.js index 9448dec..86be618 100644 --- a/public/scripts/models-of-production.js +++ b/public/scripts/models-of-production.js @@ -4,6 +4,12 @@ function urlToTopic() { return pathParts[2]; } +function getTextColor() { + return getComputedStyle(document.documentElement) + .getPropertyValue("--text") + .trim(); +} + function setUpParameters(render, parameters, modelPrefix) { parameters.forEach((param) => { const slider = document.getElementById(`slider${modelPrefix}${param}`); @@ -54,7 +60,6 @@ function drawSolowGraph() { .attr("transform", `translate(0, ${height})`) .call(d3.axisBottom(x)) .append("text") - .attr("fill", "#000") .attr("x", width + 10) .attr("y", -10) .style("text-anchor", "end") @@ -67,7 +72,6 @@ function drawSolowGraph() { .append("g") .call(d3.axisLeft(y)) .append("text") - .attr("fill", "#000") .attr("x", 0) .attr("y", -10) .style("text-anchor", "start") @@ -162,7 +166,6 @@ function drawSolowGraph() { .attr("y1", y((d * k_star) / s)) .attr("x2", x(k_star)) .attr("y2", y(0)) - .attr("stroke", "black") .attr("stroke-width", 1) .attr("stroke-dasharray", "5,5"); @@ -239,7 +242,6 @@ function drawRomerGraph() { .attr("transform", `translate(0, ${height})`) .call(d3.axisBottom(x)) .append("text") - .attr("fill", "#000") .attr("x", width + 10) .attr("y", -10) .style("text-anchor", "end") @@ -254,7 +256,6 @@ function drawRomerGraph() { .append("g") .call(d3.axisLeft(y).ticks(10, d3.format(".1s"))) .append("text") - .attr("fill", "#000") .attr("x", 0) .attr("y", -10) .style("text-anchor", "start") @@ -332,7 +333,6 @@ function drawRomerlGraph() { .attr("transform", `translate(0, ${height})`) .call(d3.axisBottom(x)) .append("text") - .attr("fill", "#000") .attr("x", width + 10) .attr("y", -10) .style("text-anchor", "end") @@ -347,7 +347,6 @@ function drawRomerlGraph() { .append("g") .call(d3.axisLeft(y).ticks(10, d3.format(".1s"))) .append("text") - .attr("fill", "#000") .attr("x", 0) .attr("y", -10) .style("text-anchor", "start") @@ -374,7 +373,6 @@ function drawRomerlGraph() { .attr("y1", y(romerData[T_MAX - 1].Y)) .attr("x2", x(t0)) .attr("y2", height) - .attr("stroke", "black") .attr("stroke-width", 1) .attr("stroke-dasharray", "4"); @@ -478,7 +476,6 @@ function drawRomerSolowGraph() { .attr("transform", `translate(0, ${height})`) .call(d3.axisBottom(x)) .append("text") - .attr("fill", "#000") .attr("x", width + 10) .attr("y", -10) .style("text-anchor", "end") @@ -493,7 +490,6 @@ function drawRomerSolowGraph() { .append("g") .call(d3.axisLeft(y).ticks(10, d3.format(".1s"))) .append("text") - .attr("fill", "#000") .attr("x", 0) .attr("y", -10) .style("text-anchor", "start") @@ -575,7 +571,6 @@ function drawRomerSolowChangeGraph() { .attr("transform", `translate(0, ${height})`) .call(d3.axisBottom(x)) .append("text") - .attr("fill", "#000") .attr("x", width + 10) .attr("y", -10) .style("text-anchor", "end") @@ -590,7 +585,6 @@ function drawRomerSolowChangeGraph() { .append("g") .call(d3.axisLeft(y).ticks(10, d3.format(".1s"))) .append("text") - .attr("fill", "#000") .attr("x", 0) .attr("y", -10) .style("text-anchor", "start") @@ -617,7 +611,6 @@ function drawRomerSolowChangeGraph() { .attr("y1", y(romerSolowData[T_MAX - 1].Y)) .attr("x2", x(t0)) .attr("y2", height) - .attr("stroke", "black") .attr("stroke-width", 1) .attr("stroke-dasharray", "4"); diff --git a/public/styles/graph.css b/public/styles/graph.css index 114fb1c..7dc16ab 100644 --- a/public/styles/graph.css +++ b/public/styles/graph.css @@ -11,6 +11,16 @@ width: 60%; } +.graph svg line, +.graph svg path.domain, +.graph svg .tick line { + stroke: var(--text); +} + +.graph svg text { + fill: var(--text); +} + .slider { display: flex; align-items: center; diff --git a/public/styles/posts.css b/public/styles/posts.css index 46399bd..ee254d1 100644 --- a/public/styles/posts.css +++ b/public/styles/posts.css @@ -22,7 +22,7 @@ li { .post-title::before { content: ""; position: absolute; - background-color: var(--topic-color, black); + background-color: var(--topic-color, var(--text)); height: 30px; width: 2px; bottom: -10px; @@ -32,7 +32,7 @@ li { .post-title::after { content: ""; position: absolute; - background-color: var(--topic-color, black); + background-color: var(--topic-color, var(--text)); width: 200px; height: 2px; bottom: -10px; @@ -103,7 +103,7 @@ article h3::before, .post-article h3::before { position: absolute; left: 0; - color: var(--topic-color, #000); + color: var(--topic-color, var(--text)); margin-right: 0.5em; } diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index f311a85..fd925ef 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -52,7 +52,9 @@ const { case "git": return "#cc5500"; default: - return "#000000"; + return getComputedStyle(document.documentElement) + .getPropertyValue("--text") + .trim(); } }; diff --git a/src/layouts/PostLayout.astro b/src/layouts/PostLayout.astro index 62b58cd..37af82e 100644 --- a/src/layouts/PostLayout.astro +++ b/src/layouts/PostLayout.astro @@ -53,7 +53,10 @@ const topicColor = getTopicColor(post?.collection); -
+

{title}

{frontmatter.date && } diff --git a/src/utils/colors.js b/src/utils/colors.js index 1d84326..587eb2c 100644 --- a/src/utils/colors.js +++ b/src/utils/colors.js @@ -11,6 +11,6 @@ export function getTopicColor(topicName) { case "git": return "#cc5500"; default: - return "#000000"; + return null; } }