Skip to content

Instantly share code, notes, and snippets.

@mathewmariani
Created April 3, 2024 18:41
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 mathewmariani/bca64fab3b5ba19e27036bdae7425112 to your computer and use it in GitHub Desktop.
Save mathewmariani/bca64fab3b5ba19e27036bdae7425112 to your computer and use it in GitHub Desktop.
// https://flatuicolors.com/palette/ca
const colors = ["#ff9ff3", "#feca57", "#ff6b6b", "#48dbfb", "#1dd1a1"];
window.addEventListener("mousedown", (e) => {
const color = colors.shift();
document.documentElement.style.setProperty("--highlight-color", color);
colors.push(color);
});
:root {
--highlight-color: null;
}
::selection {
background: var(--highlight-color);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment