Skip to content
This repository has been archived by the owner on May 25, 2020. It is now read-only.

Commit

Permalink
Merge pull request #85 from maykar/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Ryan Meek committed Mar 17, 2019
2 parents b0c59fc + 0b964e3 commit bfbca11
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
19 changes: 18 additions & 1 deletion compact-custom-header.js
@@ -1,4 +1,4 @@
import "./compact-custom-header-editor.js?v=1.0.1b8";
import "./compact-custom-header-editor.js?v=1.0.1b9";

export const LitElement = Object.getPrototypeOf(
customElements.get("ha-panel-lovelace")
Expand Down Expand Up @@ -346,6 +346,7 @@ if (!customElements.get("compact-custom-header")) {
header.style.backgroundImage = null;
view.style.marginTop = "0px";
view.querySelectorAll("*")[0].style.display = "initial";
root.querySelector('[id="cch_iron_selected"]').outerHTML = "";
if (header_colors) header_colors.parentNode.removeChild(header_colors);
if (Object.keys(this.cchConfig.tab_color).length) {
for (let i = 0; i < tabs.length; i++) {
Expand Down Expand Up @@ -391,6 +392,22 @@ if (!customElements.get("compact-custom-header")) {
root.appendChild(style);
}
}

if (!root.querySelector('[id="cch_iron_selected"]') && !this.editMode) {
let style = document.createElement("style");
style.setAttribute("id", "cch_iron_selected");
style.innerHTML = `
.iron-selected {
${this.cchConfig.active_tab_color
? `color: ${this.cchConfig.active_tab_color + " !important"}`
: ""
}
}
`;
tabContainer.appendChild(style);
}

if (Object.keys(this.cchConfig.tab_color).length) {
let tab_color = this.cchConfig.tab_color;
for (let i = 0; i < tabs.length; i++) {
Expand Down
1 change: 1 addition & 0 deletions readme.md
Expand Up @@ -164,6 +164,7 @@ views:
|button_color|Set the color of a single tab. See example below.
|notify_indicator_color|Sets the color of the new notification indicator.
|notify_text_color|Sets the color of the number of new notifications inside the indicator.
|active_tab_color|Sets the color of the current tab's icon.

* <b>You may use any [valid CSS for colors](https://www.w3schools.com/cssref/pr_text_color.asp).
* If using hex colors (#ffffff) be sure to enclose in quotes ("#ffffff").
Expand Down

0 comments on commit bfbca11

Please sign in to comment.