File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -196,6 +196,7 @@ export class HaControlSwitch extends LitElement {
196196 - - control- switch- background- opacity: 0.2;
197197 - - control- switch- hover- background- opacity: 0.4;
198198 - - control- switch- thickness: 40px;
199+ - - control- switch- min- to uch- size: 40px;
199200 - - control- switch- bor der- radius: var(- - ha- bor der- radius- lg);
200201 - - control- switch- padding: 4px;
201202 - - mdc- icon- size: 20px;
@@ -219,21 +220,35 @@ export class HaControlSwitch extends LitElement {
219220 width: 100%;
220221 bor der- radius: var(- - control- switch- bor der- radius);
221222 outline: none;
222- overflow: hidden;
223223 padding: var(- - control- switch- padding);
224224 dis play: flex;
225225 cursor : pointer;
226226 }
227+ .switch::befor e {
228+ content: "";
229+ position: absolute;
230+ to p: 50%;
231+ left: 50%;
232+ transfor m: translate(-50%, -50%);
233+ width: 100%;
234+ height: 100%;
235+ min- width: var(- - control- switch- min- to uch- size);
236+ min- height: var(- - control- switch- min- to uch- size);
237+ }
227238 .switch[dis abled] {
228239 opacity: 0.5;
229240 cursor : not - allowed;
230241 }
242+ .switch[dis abled]::befor e {
243+ pointer- events: none;
244+ }
231245 .switch .background {
232246 position: absolute;
233247 to p: 0;
234248 left: 0;
235249 height: 100%;
236250 width: 100%;
251+ bor der- radius: inherit;
237252 background- color : var(- - control- switch- off- color );
238253 transition: background- color 180ms ease- in- out;
239254 opacity: var(- - control- switch- background- opacity);
You can’t perform that action at this time.
0 commit comments