Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/button-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ class ButtonCard extends LitElement {
// we have en entity
if (stateActive(state)) {
// entity is on
if (state.attributes.rgb_color) {
if (cardColorType === 'card' || cardColorType === 'label-card') { color = stateColorCss(state, state.state, cardColorType) || DEFAULT_COLOR; } else if (state.attributes.rgb_color) {
// entity has RGB attributes
color = `rgb(${state.attributes.rgb_color.join(',')})`;
} else if (
Expand All @@ -853,7 +853,7 @@ class ButtonCard extends LitElement {
// all the other lights
color = stateColorCss(state, state.state, cardColorType) || DEFAULT_COLOR;
}
if (state.attributes.brightness) {
if (state.attributes.brightness && cardColorType !== 'card' && cardColorType !== 'label-card') {
color = applyBrightnessToColor(this, color, (state.attributes.brightness + 245) / 5);
}
} else {
Expand Down
6 changes: 5 additions & 1 deletion src/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,13 @@ export const styles = css`
--iron-icon-height: 100%;
}
ha-card.button-card-main {
color: var(--primary-text-color, inherit);
background-color: var(--ha-card-background, var(--card-background-color, var(--primary-background-color, white)));
font-family: var(--primary-font-family, var(--ha-font-family-body, inherit));font-weight: var(--ha-font-weight-normal, 400);
font-size: var(--ha-font-size-m, 1.2rem);font-weight: var(--ha-font-weight-normal, 400);
padding: 4% 0px;
text-transform: none;
font-weight: 400;
font-weight: var(--ha-font-weight-normal, 400);
font-size: 1.2rem;
align-items: center;
text-align: center;
Expand Down