Skip to content

Commit

Permalink
add spacing theme options
Browse files Browse the repository at this point in the history
  • Loading branch information
piitaya committed Feb 1, 2022
1 parent 77b1e98 commit c50244f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/cards/cover-card/controls/cover-buttons-control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class CoverButtonsControl extends LitElement {
width: 100%;
}
:host *:not(:last-child) {
margin-right: 12px;
margin-right: var(--spacing);
}
mushroom-button {
flex: 1;
Expand Down
5 changes: 0 additions & 5 deletions src/cards/person-card/person-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,6 @@ export class PersonCard extends LitElement implements LovelaceCard {
return [
cardStyle,
css`
.container {
display: flex;
flex-direction: column;
padding: 12px;
}
mushroom-state-item {
cursor: pointer;
}
Expand Down
2 changes: 1 addition & 1 deletion src/shared/slider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export class SliderItem extends LitElement {
height: 42px;
}
.container > *:not(:last-child) {
margin-right: 12px;
margin-right: var(--spacing);
}
.slider {
position: relative;
Expand Down
4 changes: 2 additions & 2 deletions src/shared/state-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class StateItem extends LitElement {
align-items: center;
}
.container > *:not(:last-child) {
margin-right: 12px;
margin-right: var(--spacing);
}
.icon {
position: relative;
Expand All @@ -54,7 +54,7 @@ export class StateItem extends LitElement {
flex-direction: column;
}
.container.vertical > *:not(:last-child) {
margin-bottom: 12px;
margin-bottom: var(--spacing);
margin-right: 0;
}
.container.vertical .info {
Expand Down
7 changes: 4 additions & 3 deletions src/utils/card-styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { colorCss } from "./colors";
export const cardStyle = css`
:host {
${colorCss}
--spacing: var(--mush-spacing, 12px)
}
ha-card {
height: 100%;
Expand All @@ -15,10 +16,10 @@ export const cardStyle = css`
justify-content: center;
display: flex;
flex-direction: column;
padding: 12px;
padding: var(--spacing);
}
.container > *:not(:last-child) {
margin-bottom: 12px;
margin-bottom: var(--spacing);
}
.actions {
display: flex;
Expand All @@ -27,7 +28,7 @@ export const cardStyle = css`
overflow-y: auto;
}
.actions *:not(:last-child) {
margin-right: 12px;
margin-right: var(--spacing);
}
.unavailable {
--main-color: var(--warning-color);
Expand Down

0 comments on commit c50244f

Please sign in to comment.