Skip to content

Instantly share code, notes, and snippets.

@kubarium
Last active July 3, 2019 17:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kubarium/cb9b9467a02d54497bc3c178c104e402 to your computer and use it in GitHub Desktop.
Save kubarium/cb9b9467a02d54497bc3c178c104e402 to your computer and use it in GitHub Desktop.
Adjusts gutenberg.com layout for large monitors.
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