Skip to content

Instantly share code, notes, and snippets.

@ivarvong
Last active February 24, 2021 21:09
Show Gist options
  • Save ivarvong/7fd06f509519e77d77f37555677a7220 to your computer and use it in GitHub Desktop.
Save ivarvong/7fd06f509519e77d77f37555677a7220 to your computer and use it in GitHub Desktop.
// Paste this into the console
var colors = [...document.querySelectorAll("*")].flatMap((el) => {
const style = getComputedStyle(el);
return [
style.getPropertyValue("color"),
style.getPropertyValue("background-color"),
];
});
[...new Set(colors)].forEach((color) => {
console.log(
`%c.%c${color}`,
`padding: 0 30px; background: ${color}; color: transparent;`,
`padding-left: 15px; background: transparent; color: unset;`
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment