From 3cb70dc14ce0815678687a43e7c985b598890835 Mon Sep 17 00:00:00 2001 From: Nicholas Jitkoff Date: Sat, 18 Jun 2022 19:07:47 -0700 Subject: [PATCH] add theme color --- docs/index.css | 6 +++++- docs/index.html | 5 +++-- netlify/edge-functions/echo.js | 11 +++++++++++ 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 netlify/edge-functions/echo.js diff --git a/docs/index.css b/docs/index.css index 5ad2800..ee64b57 100644 --- a/docs/index.css +++ b/docs/index.css @@ -2,7 +2,11 @@ body { font-family: sans-serif; } -@media(prefers-color-scheme: dark){body{color:white;background-color:#111;}} +@media(prefers-color-scheme: dark){ + body{ + color:white; + background-color:#121212; + }} #iframe { border: none; diff --git a/docs/index.html b/docs/index.html index 98199a2..fce93f7 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4,9 +4,10 @@ - + + @@ -16,5 +17,5 @@ - + diff --git a/netlify/edge-functions/echo.js b/netlify/edge-functions/echo.js new file mode 100644 index 0000000..3d25ef8 --- /dev/null +++ b/netlify/edge-functions/echo.js @@ -0,0 +1,11 @@ +export default async (request, context) => { + let url = new URL(request.url); + let durl = url.search.substring(1); + let components = durl.split(","); + let data = components.pop(); + components = components.shift().split(":"); + let type = components.pop(); + return new Response(data, { + headers: { "content-type": type}, + }); +}