forked from nielsfaber/scheduler-card
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyles.ts
executable file
·208 lines (204 loc) · 5.62 KB
/
styles.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
import { css } from 'lit';
export const commonStyle = css`
.card-header {
display: flex;
justify-content: space-between;
}
.card-header .name {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: flex;
}
.card-header ha-switch {
padding: 5px;
}
.card-header ha-icon-button {
position: absolute;
right: 6px;
top: 6px;
}
.card-content {
flex: 1;
}
.card-content > *:first-child {
margin-top: 0;
}
.card-content > *:last-child {
margin-bottom: 0;
}
div.text-field, div.secondary {
color: var(--secondary-text-color);
}
.disabled {
color: var(--disabled-text-color);
}
div.header {
color: var(--secondary-text-color);
text-transform: uppercase;
font-weight: 500;
font-size: 12px;
margin: 20px 0px 0px 0px;
display: flex;
flex-direction: row;
}
div.header .switch {
text-transform: none;
font-weight: normal;
font-size: 14px;
display: flex;
flex-grow: 1;
justify-content: flex-end;
}
div.header ha-switch {
display: flex;
align-self: center;
margin: 0px 8px;
line-height: 24px;
}
mwc-button.active {
background: var(--primary-color);
--mdc-theme-primary: var(--text-primary-color);
border-radius: 4px;
}
mwc-button ha-icon {
margin-right: 11px;
}
mwc-button.warning {
--mdc-theme-primary: var(--error-color);
}
div.checkbox-container {
display: grid;
grid-template-columns: max-content 1fr max-content;
grid-template-rows: min-content;
grid-template-areas: "checkbox slider value";
grid-gap: 0px 10px;
}
div.checkbox-container div.checkbox {
grid-area: checkbox;
display: flex;
align-items: center;x
}
div.checkbox-container div.slider {
grid-area: slider;
display: flex;
align-items: center;
}
div.checkbox-container div.value {
grid-area: value;
min-width: 40px;
display: flex;
align-items: center;
}
a {
color: var(--primary-color);
}
a:visited {
color: var(--accent-color);
}
.content {
padding: 0px 24px 16px 24px;
}
.buttons {
box-sizing: border-box;
display: flex;
padding: 24px;
padding-top: 16px;
justify-content: space-between;
padding-bottom: max(env(safe-area-inset-bottom), 24px);
background-color: var(--mdc-theme-surface, #fff);
border-top: 1px solid var(--divider-color);
position: sticky;
bottom: 0px;
}
.buttons.centered {
flex-wrap: wrap;
justify-content: center;
}
`;
export const dialogStyle = css`
ha-dialog {
--mdc-dialog-min-width: 400px;
--mdc-dialog-max-width: 600px;
--mdc-dialog-heading-ink-color: var(--primary-text-color);
--mdc-dialog-content-ink-color: var(--primary-text-color);
--justify-action-buttons: space-between;
--dialog-content-padding: 0px;
}
ha-dialog .form {
color: var(--primary-text-color);
}
a {
color: var(--primary-color);
}
/* make dialog fullscreen on small screens */
@media all and (max-width: 450px), all and (max-height: 500px) {
ha-dialog {
--mdc-dialog-min-width: calc(100vw - env(safe-area-inset-right) - env(safe-area-inset-left));
--mdc-dialog-max-width: calc(100vw - env(safe-area-inset-right) - env(safe-area-inset-left));
--mdc-dialog-min-height: 100%;
--mdc-dialog-max-height: 100%;
--vertical-align-dialog: flex-end;
--ha-dialog-border-radius: 0px;
}
}
mwc-button.warning {
--mdc-theme-primary: var(--error-color);
}
.error {
color: var(--error-color);
}
ha-dialog {
--dialog-surface-position: static;
--dialog-content-position: static;
--vertical-align-dialog: flex-start;
}
ha-header-bar {
--mdc-theme-on-primary: var(--primary-text-color);
--mdc-theme-primary: var(--mdc-theme-surface);
flex-shrink: 0;
display: block;
}
.content {
outline: none;
}
@media all and (max-width: 450px), all and (max-height: 500px) {
ha-header-bar {
--mdc-theme-primary: var(--app-header-background-color);
--mdc-theme-on-primary: var(--app-header-text-color, white);
border-bottom: none;
}
}
.heading {
border-bottom: 1px solid var(--mdc-dialog-scroll-divider-color, rgba(0, 0, 0, 0.12));
}
:host([tab='time']) ha-dialog {
--dialog-content-padding: 0px;
}
@media all and (min-width: 600px) and (min-height: 501px) {
ha-dialog {
--mdc-dialog-min-width: 560px;
--mdc-dialog-max-width: 580px;
--dialog-surface-margin-top: 40px;
--mdc-dialog-max-height: calc(100% - 72px);
}
.main-title {
overflow: hidden;
text-overflow: ellipsis;
cursor: default;
}
:host([large]) ha-dialog {
--mdc-dialog-min-width: 90vw;
--mdc-dialog-max-width: 90vw;
}
}
:host([tab='info']) ha-dialog[data-domain='camera'] {
--dialog-content-padding: 0;
/* max height of the video is full screen, minus the height of the header of the dialog and the padding of the dialog (mdc-dialog-max-height: calc(100% - 72px)) */
--video-max-height: calc(100vh - 113px - 72px);
}
mwc-tab[disabled] {
--mdc-tab-text-label-color-default: var(--material-disabled-text-color);
pointer-events: none;
}
`;