Skip to content

Commit

Permalink
Implement #12: CSS variable for control padding
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeSG committed Mar 27, 2021
1 parent f4c8fd2 commit c9705e2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ you can use the following variables in your theme's config file:
| time-picker-accent-color | `var(--primary-color)` | AM / PM active color |
| time-picker-off-color | `var(--disabled-text-color)` | AM / PM inactive color |
| time-picker-border-radius | `var(--ha-card-border-radius)` | Border radius of the card |
| time-picker-control-padding | `8px` | Padding for interactive elements. Increase for larger hitboxes of the controls. Example: `10px 12px` |

## Meta

Expand Down
2 changes: 1 addition & 1 deletion src/components/time-period.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class TimePeriodComponent extends LitElement {
.time-period {
width: 30px;
padding: 8px;
padding: var(--tpc-control-padding);
background: var(--tpc-off-color);
color: var(--tpc-text-color);
text-align: center;
Expand Down
4 changes: 2 additions & 2 deletions src/components/time-unit.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ export class TimeUnitComponent extends LitElement {
.time-picker-icon {
width: 30px;
padding: 8px;
padding: var(--tpc-control-padding);
text-align: center;
cursor: pointer;
color: var(--tpc-icon-color);
}
.time-input {
width: 30px;
padding: 8px 8px 6px;
padding: var(--tpc-control-padding);
background: var(--tpc-elements-background-color);
border: 0;
border-bottom: 2px solid var(--tpc-elements-background-color);
Expand Down
2 changes: 2 additions & 0 deletions src/time-picker-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ export class TimePickerCard extends LitElement implements LovelaceCard {
var(--primary-color)
);
--tpc-control-padding: var(--time-picker-control-padding, 8px);
--tpc-icon-color: var(--time-picker-icon-color, var(--primary-text-color));
--tpc-text-color: var(--time-picker-text-color, #fff);
--tpc-accent-color: var(--time-picker-accent-color, var(--primary-color));
Expand Down

0 comments on commit c9705e2

Please sign in to comment.