Last active
July 3, 2019 17:22
-
-
Save kubarium/cb9b9467a02d54497bc3c178c104e402 to your computer and use it in GitHub Desktop.
Adjusts gutenberg.com layout for large monitors.
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
var styles = { | |
body: { | |
"margin-right": "25%", | |
"margin-left": "25%" | |
}, | |
p: { | |
"font-size": "x-large", | |
"line-height": "1.3em" | |
}, | |
td: { | |
"font-size": "x-large", | |
} | |
}; | |
function stylize(id) { | |
return Object.keys(styles[id]) | |
.reduce((cssText, key) => cssText.concat(`${key}:${styles[id][key]};`), []) | |
.join(""); | |
} | |
function adjust(){ | |
body = document.querySelector("body"); | |
body.setAttribute("style", stylize("body")); | |
td = document.querySelectorAll("td"); | |
td.forEach(td=>td.setAttribute("style", stylize("td"))); | |
p = document.querySelectorAll("p"); | |
p.forEach(p=>p.setAttribute("style", stylize("p"))); | |
} | |
adjust(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment