Skip to content

Commit ada9f29

Browse files
authored
Merge pull request #1172 from MrBearPresident/820-Number-of-rows-when-placed-in-a-section-view
820 number of rows when placed in a section view
2 parents 55b472f + 63191bf commit ada9f29

File tree

8 files changed

+91
-37
lines changed

8 files changed

+91
-37
lines changed

src/cards/button/styles.css

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ha-card {
2020
width: 100%;
2121
height: 50px;
2222
background-color: var(--bubble-button-main-background-color, var(--bubble-main-background-color, var(--background-color-2, var(--secondary-background-color))));
23-
border-radius: var(--bubble-button-border-radius, var(--bubble-border-radius, 32px));
23+
border-radius: var(--bubble-button-border-radius, var(--bubble-border-radius, calc(var(--row-height,56px)/2)));
2424
box-shadow: var(--bubble-button-box-shadow, var(--bubble-box-shadow, none));
2525
overflow: scroll;
2626
touch-action: pan-y;
@@ -41,7 +41,7 @@ ha-card {
4141
.bubble-button-background {
4242
background-color: var(--bubble-button-background-color);
4343
opacity: .5;
44-
border-radius: calc(var(--bubble-button-border-radius, var(--bubble-border-radius, 32px)) / 1.1);
44+
border-radius: calc(var(--bubble-button-border-radius, var(--bubble-border-radius, calc(var(--row-height,56px)/2))) / 1.1 );
4545
}
4646
.bubble-range-fill {
4747
position: absolute;
@@ -65,7 +65,7 @@ ha-card {
6565
}
6666
.bubble-range-slider {
6767
cursor: ew-resize;
68-
border-radius: calc(var(--bubble-button-border-radius, var(--bubble-border-radius, 32px)) / 1.1);
68+
border-radius: calc(var(--bubble-button-border-radius, var(--bubble-border-radius, calc(var(--row-height,56px)/2))) / 1.1);
6969
overflow: hidden;
7070
mask-image: radial-gradient(white, black);
7171
-webkit-mask-image: -webkit-radial-gradient(white, black);
@@ -151,8 +151,8 @@ ha-card {
151151
}
152152

153153
.large .bubble-button-card-container {
154-
height: 56px;
155-
border-radius: var(--bubble-button-border-radius, var(--bubble-border-radius, 32px));
154+
height: calc( var(--row-height,56px) * var(--row-size,1) + var(--row-gap,8px) * ( var(--row-size,1) - 1 ));
155+
border-radius: var(--bubble-button-border-radius, var(--bubble-border-radius, calc(var(--row-height,56px)/2)));
156156
}
157157

158158
.large .bubble-icon-container {
@@ -162,12 +162,16 @@ ha-card {
162162
margin-left: 8px;
163163
}
164164

165+
.large .bubble-sub-button-container:has(> :last-child:nth-child(2)) :nth-child(2) {
166+
grid-row: 1 / calc(var(--row-size,1) + 1);
167+
}
168+
165169
.rows-2 .bubble-sub-button-container {
166170
flex-direction: column;
167171
gap: 4px !important;
168172
display: grid !important;
169173
grid-template-columns: repeat(1, min-content);
170-
grid-template-rows: repeat(2, 1fr);
174+
grid-template-rows: repeat(calc(2*var(--row-size,1)), 1fr);
171175
grid-auto-flow: column;
172176
width: auto;
173177
padding-right: 4px;
@@ -176,3 +180,7 @@ ha-card {
176180
.rows-2 .bubble-sub-button {
177181
height: 20px !important;
178182
}
183+
184+
.large.rows-2 .bubble-sub-button-container:has(> :last-child:nth-child(2)) :nth-child(2) {
185+
grid-row: 1 / calc(2*var(--row-size,1) + 1);
186+
}

src/cards/climate/styles.css

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ha-card {
1616
width: 100%;
1717
height: 50px;
1818
background-color: var(--bubble-climate-main-background-color, var(--bubble-main-background-color, var(--background-color-2, var(--secondary-background-color))));
19-
border-radius: var(--bubble-climate-border-radius, var(--bubble-border-radius, 32px));
19+
border-radius: var(--bubble-climate-border-radius, var(--bubble-border-radius, calc(var(--row-height,56px)/2)));
2020
box-shadow: var(--bubble-climate-box-shadow, var(--bubble-box-shadow, none));
2121
overflow: visible;
2222
touch-action: pan-y;
@@ -52,7 +52,7 @@ ha-card {
5252
align-items: center;
5353
width: auto;
5454
height: 100%;
55-
border-radius: var(--bubble-sub-button-border-radius, var(--bubble-border-radius, 32px));
55+
border-radius: var(--bubble-sub-button-border-radius, var(--bubble-border-radius, calc(var(--row-height,56px)/2)));
5656
background-color: var(--bubble-climate-button-background-color, var(--bubble-secondary-background-color, var(--card-background-color, var(--ha-card-background))));
5757
}
5858

@@ -97,7 +97,7 @@ ha-card {
9797
width: 100%;
9898
height: 100%;
9999
position: absolute;
100-
border-radius: var(--bubble-sub-button-border-radius, var(--bubble-border-radius, 32px));
100+
border-radius: var(--bubble-sub-button-border-radius, var(--bubble-border-radius, calc(var(--row-height,56px)/2)));
101101
overflow: hidden;
102102
pointer-events: none;
103103
}
@@ -118,7 +118,7 @@ ha-card {
118118
width: 100%;
119119
height: 100%;
120120
position: absolute;
121-
border-radius: var(--bubble-climate-border-radius, var(--bubble-border-radius, 32px));
121+
border-radius: var(--bubble-climate-border-radius, var(--bubble-border-radius, calc(var(--row-height,56px)/2)));
122122
opacity: 0.7;
123123
transition: background-color 2s ease;
124124
}
@@ -220,8 +220,8 @@ ha-card {
220220
}
221221

222222
.large .bubble-climate-container {
223-
height: 56px;
224-
border-radius: var(--bubble-climate-border-radius, var(--bubble-border-radius, 32px));
223+
height: calc( var(--row-height,56px) * var(--row-size,1) + var(--row-gap,8px) * ( var(--row-size,1) - 1 ));
224+
border-radius: var(--bubble-climate-border-radius, var(--bubble-border-radius, calc(var(--row-height,56px)/2)));
225225
}
226226

227227
.large .bubble-icon-container {
@@ -231,16 +231,24 @@ ha-card {
231231
margin-left: 8px;
232232
}
233233

234+
.large .bubble-sub-button-container:has(> :last-child:nth-child(2)) :nth-child(2) {
235+
grid-row: 1 / calc(var(--row-size,1) + 1);
236+
}
237+
234238
.rows-2 .bubble-sub-button-container {
235239
flex-direction: column;
236240
gap: 4px !important;
237241
display: grid !important;
238242
grid-template-columns: repeat(1, min-content);
239-
grid-template-rows: repeat(2, 1fr);
243+
grid-template-rows: repeat(calc(2*var(--row-size,1)), 1fr);
240244
grid-auto-flow: column;
241245
width: auto;
242246
}
243247

244248
.rows-2 .bubble-sub-button {
245249
height: 20px !important;
246250
}
251+
252+
.large.rows-2 .bubble-sub-button-container:has(> :last-child:nth-child(2)) :nth-child(2) {
253+
grid-row: 1 / calc(2*var(--row-size,1) + 1);
254+
}

src/cards/cover/styles.css

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ ha-card {
101101
display: flex;
102102
background: var(--bubble-cover-main-background-color, var(--bubble-main-background-color, var(--background-color-2, var(--secondary-background-color))));
103103
height: 42px;
104-
border-radius: var(--bubble-cover-border-radius, var(--bubble-border-radius, 32px));
104+
border-radius: var(--bubble-cover-border-radius, var(--bubble-border-radius, calc(var(--row-height,56px)/2)));
105105
box-shadow: var(--bubble-cover-box-shadow, var(--bubble-button-box-shadow, var(--bubble-box-shadow, none)));
106106
align-items: center;
107107
justify-content: center;
@@ -110,10 +110,10 @@ ha-card {
110110
}
111111

112112
.large .bubble-cover-card-container {
113-
height: 56px;
113+
height: calc( var(--row-height,56px) * var(--row-size,1) + var(--row-gap,8px) * ( var(--row-size,1) - 1 ));
114114
display: flex;
115115
background: var(--bubble-cover-main-background-color, var(--bubble-main-background-color, var(--background-color-2, var(--secondary-background-color))));
116-
border-radius: var(--bubble-cover-border-radius, var(--bubble-border-radius, 32px));
116+
border-radius: var(--bubble-cover-border-radius, var(--bubble-border-radius, calc(var(--row-height,56px)/2)));
117117
box-shadow: var(--bubble-cover-box-shadow, var(--bubble-button-box-shadow, var(--bubble-box-shadow, none)));
118118
border: var(--bubble-cover-border, var(--bubble-border, none));
119119
}
@@ -124,7 +124,7 @@ ha-card {
124124
}
125125

126126
.large .bubble-header-container {
127-
height: 56px;
127+
height: calc( var(--row-height,56px) * var(--row-size,1) + var(--row-gap,8px) * ( var(--row-size,1) - 1 ));
128128
}
129129

130130
.large .bubble-header {
@@ -162,16 +162,24 @@ ha-card {
162162
margin-right: 14px;
163163
}
164164

165+
.large .bubble-sub-button-container:has(> :last-child:nth-child(2)) :nth-child(2) {
166+
grid-row: 1 / calc(var(--row-size,1) + 1);
167+
}
168+
165169
.rows-2 .bubble-sub-button-container {
166170
flex-direction: column;
167171
gap: 4px !important;
168172
display: grid !important;
169173
grid-template-columns: repeat(1, min-content);
170-
grid-template-rows: repeat(2, 1fr);
174+
grid-template-rows: repeat(calc(2*var(--row-size,1)), 1fr);
171175
grid-auto-flow: column;
172176
width: auto;
173177
}
174178

175179
.rows-2 .bubble-sub-button {
176180
height: 20px !important;
177181
}
182+
183+
.large.rows-2 .bubble-sub-button-container:has(> :last-child:nth-child(2)) :nth-child(2) {
184+
grid-row: 1 / calc(2*var(--row-size,1) + 1);
185+
}

src/cards/media-player/styles.css

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ha-card {
1818
height: 50px;
1919
background-color: var(--bubble-media-player-main-background-color, var(--bubble-main-background-color, var(--background-color-2, var(--secondary-background-color))));
2020
touch-action: pan-y;
21-
border-radius: var(--bubble-media-player-border-radius, var(--bubble-border-radius, 32px));
21+
border-radius: var(--bubble-media-player-border-radius, var(--bubble-border-radius, calc(var(--row-height,56px)/2)));
2222
box-shadow: var(--bubble-media-player-box-shadow, var(--bubble-box-shadow, none));
2323
border: var(--bubble-media-player-border, var(--bubble-border, none));
2424
}
@@ -31,7 +31,7 @@ ha-card {
3131
height: 100%;
3232
width: 100%;
3333
transition: background-color 1.5s;
34-
border-radius: var(--bubble-media-player-border-radius, var(--bubble-border-radius, 32px));
34+
border-radius: var(--bubble-media-player-border-radius, var(--bubble-border-radius, calc(var(--row-height,56px)/2)));
3535
background-color: rgba(0,0,0,0);
3636
}
3737

@@ -51,7 +51,7 @@ ha-card {
5151
background: none;
5252
border: none;
5353
cursor: pointer;
54-
border-radius: var(--bubble-media-player-buttons-border-radius, var(--bubble-border-radius, 32px));
54+
border-radius: var(--bubble-media-player-buttons-border-radius, var(--bubble-border-radius, calc(var(--row-height,56px)/2)));
5555
padding: 6px;
5656
height: 24px;
5757
width: 24px;
@@ -69,7 +69,7 @@ ha-card {
6969
height: 38px;
7070
left: 50px;
7171
overflow: hidden;
72-
border-radius: var(--bubble-media-player-border-radius, var(--bubble-border-radius, 32px));
72+
border-radius: var(--bubble-media-player-border-radius, var(--bubble-border-radius, calc(var(--row-height,56px)/2)));
7373
z-index: 1;
7474
background-color: var(--bubble-media-player-slider-background-color, var(--bubble-icon-background-color, var(--bubble-secondary-background-color, var(--card-background-color, var(--ha-card-background)))));
7575
opacity: 1;
@@ -276,8 +276,8 @@ ha-card {
276276
}
277277

278278
.large .bubble-media-player-container {
279-
height: 56px;
280-
border-radius: var(--bubble-media-player-border-radius, var(--bubble-border-radius, 32px));
279+
height: calc( var(--row-height,56px) * var(--row-size,1) + var(--row-gap,8px) * ( var(--row-size,1) - 1 ));
280+
border-radius: var(--bubble-media-player-border-radius, var(--bubble-border-radius, calc(var(--row-height,56px)/2)));
281281
}
282282

283283
.large .bubble-icon-container {
@@ -298,7 +298,7 @@ ha-card {
298298

299299
.large .bubble-volume-slider {
300300
height: 42px;
301-
border-radius: var(--bubble-media-player-border-radius, var(--bubble-border-radius, 32px));
301+
border-radius: var(--bubble-media-player-border-radius, var(--bubble-border-radius, calc(var(--row-height,56px)/2)));
302302
left: 60px;
303303
width: calc(100% - 168px);
304304
}
@@ -312,16 +312,24 @@ ha-card {
312312
align-items: center;
313313
}
314314

315+
.large .bubble-sub-button-container:has(> :last-child:nth-child(2)) :nth-child(2) {
316+
grid-row: 1 / calc(var(--row-size,1) + 1);
317+
}
318+
315319
.rows-2 .bubble-sub-button-container {
316320
flex-direction: column;
317321
gap: 4px !important;
318322
display: grid !important;
319323
grid-template-columns: repeat(1, 1fr);
320-
grid-template-rows: repeat(2, minmax(auto, max-content));
324+
grid-template-rows: repeat(calc(2*var(--row-size,1)), minmax(auto, max-content));
321325
grid-auto-flow: column;
322326
width: auto;
323327
}
324328

325329
.rows-2 .bubble-sub-button {
326330
height: 20px !important;
327331
}
332+
333+
.large.rows-2 .bubble-sub-button-container:has(> :last-child:nth-child(2)) :nth-child(2) {
334+
grid-row: 1 / calc(2*var(--row-size,1) + 1);
335+
}

src/cards/pop-up/styles.css

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167
}
168168

169169
.large .bubble-button-card-container {
170-
height: 56px;
170+
height: calc( var(--row-height,56px) * var(--row-size,1) + var(--row-gap,8px) * ( var(--row-size,1) - 1 ));
171171
border-radius: var(--bubble-button-border-radius, var(--bubble-border-radius, 36px));
172172
}
173173
.large .bubble-pop-up-container {
@@ -180,24 +180,32 @@
180180
margin-left: 8px;
181181
}
182182
.large .bubble-close-button {
183-
height: 56px;
184-
width: 56px;
183+
height: var(--row-height,56px);
184+
width: var(--row-height,56px);
185185
border: none;
186186
border-radius: var(--bubble-pop-up-border-radius, var(--bubble-border-radius, 42px));
187187
z-index: 1;
188188
--mdc-icon-size: 28px !important;
189189
}
190190

191+
.large .bubble-sub-button-container:has(> :last-child:nth-child(2)) :nth-child(2) {
192+
grid-row: 1 / calc(var(--row-size,1) + 1);
193+
}
194+
191195
.rows-2 .bubble-sub-button-container {
192196
flex-direction: column;
193197
gap: 4px !important;
194198
display: grid !important;
195199
grid-template-columns: repeat(1, min-content);
196-
grid-template-rows: repeat(2, 1fr);
200+
grid-template-rows: repeat(calc(2*var(--row-size,1)), 1fr);
197201
grid-auto-flow: column;
198202
width: auto;
199203
padding-right: 4px;
200204
}
201205
.rows-2 .bubble-sub-button {
202206
height: 20px !important;
203207
}
208+
209+
.large.rows-2 .bubble-sub-button-container:has(> :last-child:nth-child(2)) :nth-child(2) {
210+
grid-row: 1 / calc(2*var(--row-size,1) + 1);
211+
}

src/cards/select/styles.css

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ mwc-list-item[selected] {
1515
background-color: var(--bubble-select-list-item-accent-color, var(--bubble-list-item-accent-color, var(--bubble-accent-color, var(--accent-color)))); /* Added the missing 'select' in the first var without removing the previous one for compatibilty */
1616
}
1717
ha-select {
18-
--mdc-shape-medium: var(--bubble-select-list-border-radius, var(--bubble-border-radius, 32px));
18+
--mdc-shape-medium: var(--bubble-select-list-border-radius, var(--bubble-border-radius, calc(var(--row-height,56px)/2)));
1919
--mdc-theme-surface: var(--bubble-select-list-background-color, var(--bubble-select-main-background-color, var(--bubble-main-background-color, var(--card-background-color, var(--secondary-background-color)))));
2020
--mdc-shape-large: 32px;
2121
--mdc-shape-small: 64px;
@@ -80,7 +80,7 @@ ha-select {
8080
width: 100%;
8181
height: 50px;
8282
background-color: var(--bubble-select-main-background-color, var(--bubble-main-background-color, var(--background-color-2, var(--secondary-background-color))));
83-
border-radius: var(--bubble-select-border-radius, var(--bubble-border-radius, 32px));
83+
border-radius: var(--bubble-select-border-radius, var(--bubble-border-radius, calc(var(--row-height,56px)/2)));
8484
box-shadow: var(--bubble-select-box-shadow, var(--bubble-box-shadow, none));
8585
touch-action: pan-y;
8686
box-sizing: border-box;
@@ -103,7 +103,7 @@ ha-select {
103103
background-color: var(--bubble-select-background-color);
104104
opacity: .5;
105105
overflow: hidden !important;
106-
border-radius: var(--bubble-select-border-radius, var(--bubble-border-radius, 32px));
106+
border-radius: var(--bubble-select-border-radius, var(--bubble-border-radius, calc(var(--row-height,56px)/2)));
107107
}
108108
.is-unavailable .bubble-select-card {
109109
cursor: not-allowed;
@@ -196,8 +196,8 @@ ha-select {
196196
}
197197

198198
.large .bubble-select-card-container {
199-
height: 56px;
200-
border-radius: var(--bubble-select-border-radius, var(--bubble-border-radius, 32px));
199+
height: calc( var(--row-height,56px) * var(--row-size,1) + var(--row-gap,8px) * ( var(--row-size,1) - 1 ));
200+
border-radius: var(--bubble-select-border-radius, var(--bubble-border-radius, calc(var(--row-height,56px)/2)));
201201
}
202202

203203
.large .bubble-icon-container {
@@ -207,16 +207,24 @@ ha-select {
207207
margin-left: 6px;
208208
}
209209

210+
.large .bubble-sub-button-container:has(> :last-child:nth-child(2)) :nth-child(2) {
211+
grid-row: 1 / calc(var(--row-size,1) + 1);
212+
}
213+
210214
.rows-2 .bubble-sub-button-container {
211215
flex-direction: column;
212216
gap: 4px !important;
213217
display: grid !important;
214218
grid-template-columns: repeat(1, min-content);
215-
grid-template-rows: repeat(2, 1fr);
219+
grid-template-rows: repeat(calc(2*var(--row-size,1)), 1fr);
216220
grid-auto-flow: column;
217221
width: auto;
218222
}
219223

220224
.rows-2 .bubble-sub-button {
221225
height: 20px !important;
222226
}
227+
228+
.large.rows-2 .bubble-sub-button-container:has(> :last-child:nth-child(2)) :nth-child(2) {
229+
grid-row: 1 / calc(2*var(--row-size,1) + 1);
230+
}

src/cards/separator/styles.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
gap: 4px !important;
4444
display: grid !important;
4545
grid-template-columns: repeat(1, min-content);
46-
grid-template-rows: repeat(2, 1fr);
46+
grid-template-rows: repeat(calc(2*var(--row-size,1)), 1fr);
4747
grid-auto-flow: column;
4848
width: auto;
4949
}

0 commit comments

Comments
 (0)