Skip to content

Instantly share code, notes, and snippets.

@ludeeus
Last active November 24, 2019 08:52
Show Gist options
  • Save ludeeus/fb0a8410d6c04e7f2f58b23cbd4e1542 to your computer and use it in GitHub Desktop.
Save ludeeus/fb0a8410d6c04e7f2f58b23cbd4e1542 to your computer and use it in GitHub Desktop.
/*
Idea stolen from https://gist.github.com/thomasloven/2a37152725c582fec4420ecedb65ebe3
Add this to your configuration.yaml
frontend:
extra_module_url:
- /local/ThemeOverride.js
And put the following into <config-dir>/www/ThemeOverride.js
*/
document.documentElement.style.setProperty('--ha-card-border-radius', '20px');
window.addEventListener("hass-more-info", () => { window.setTimeout(styleMoreInfo, 1)});
function styleMoreInfo() {
var dialog = document.querySelector("home-assistant")._moreInfoEl
dialog.style.borderRadius = "20px";
var dialogHeader = dialog && dialog.shadowRoot;
dialogHeader = dialogHeader && dialogHeader.querySelector("more-info-controls");
dialogHeader = dialogHeader && dialogHeader.shadowRoot;
dialogHeader = dialogHeader && dialogHeader.querySelector("app-toolbar");
if (dialogHeader !== null) {
dialogHeader.style.borderRadius = "20px 20px 0 0";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment