forked from kslambert/hacker-news-arc-boost
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
1 parent
ddae2b0
commit 8604256
Showing
3 changed files
with
106 additions
and
330 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.