Created
October 19, 2018 15:11
-
-
Save 06b/281f7cf2dcfedf2eb684083a60c8df61 to your computer and use it in GitHub Desktop.
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
//--------------------------------------------------------------------------- | |
/** | |
* 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