Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
combines dark mode and light mode into 1 css file using media queries
additionally tried to fix
kslambert#3
by using kslambert#5
  • Loading branch information
arulagrawal committed Feb 25, 2023
1 parent ddae2b0 commit 8604256
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 330 deletions.
22 changes: 16 additions & 6 deletions content.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
/* This runs after a web page loads */
var getHeader = document.getElementsByTagName('head').item(0);
var linkStyle = document.createElement("link");
var url = "https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600;700&family=Press+Start+2P&display=swap";
const header = document.getElementsByTagName('head').item(0);

// set the padding for the top bar
document.getElementById("hnmain").firstElementChild.firstElementChild.firstElementChild.setAttribute("style", "padding:16px");

//set font-url
const meta = document.createElement("meta");
meta.setAttribute("http-equiv", "Content-Security-Policy");
meta.setAttribute("content", "default-src https://*; font-src https://*; style-src https://*;")
header.appendChild(meta);

//get font
const linkStyle = document.createElement("link");
const url = "https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600;700&family=Press+Start+2P&display=swap";
linkStyle.href = url;
linkStyle.rel = 'stylesheet';
linkStyle.type = "text/css";
getHeader.appendChild(linkStyle);
linkStyle.type = "text/css";
header.appendChild(linkStyle);
283 changes: 0 additions & 283 deletions light-theme-style.css

This file was deleted.

Loading

0 comments on commit 8604256

Please sign in to comment.