Skip to content

Instantly share code, notes, and snippets.

@06b
Created October 19, 2018 15:11
Show Gist options
  • Save 06b/281f7cf2dcfedf2eb684083a60c8df61 to your computer and use it in GitHub Desktop.
Save 06b/281f7cf2dcfedf2eb684083a60c8df61 to your computer and use it in GitHub Desktop.
//---------------------------------------------------------------------------
/**
* ReinventTheWheel
*/
//---------------------------------------------------------------------------
// private ReinventTheWheel(): void
// {
// const html = document.documentElement;
// // TODO: Pull in theme accent color instead of using defaults
// let themeAccentColor = "#f15d22";
// const observer = new MutationObserver((mutations) => {
// mutations.forEach(() => {
// themeAccentColor = html.style.getPropertyValue("--t-accent-color");
// const themeReadableTextColor = (<IDynamicObject>TinyColor).mostReadable(themeAccentColor, ["#fff", "#444"])!.toHexString();
// document.body.style.setProperty("--t-readable-text-color-based-on-accent-color", themeReadableTextColor);
// });
// });
// observer.observe(html, { attributes : true, attributeFilter : ["style"] });
// html.style.setProperty("--t-accent-color", themeAccentColor);
// }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment