switch: style fix when padding==0

This commit is contained in:
bordun 2020-05-16 16:58:44 +02:00
parent 8a9433846f
commit dcfb6af1a9
2 changed files with 14 additions and 1 deletions

View file

@ -116,6 +116,14 @@ class Switch extends MenuBase {
}
}
setCssVariables() {
super.setCssVariables()
this.container.classList.toggle('padding-0', this.getProp('padding') === -1)
}
}
Switch.cssVariables = Switch.prototype.constructor.cssVariables.concat(

View file

@ -66,7 +66,6 @@
&:before {
margin: var(--widget-spacing);
}
padding:20rem;
inner {
position: relative;
@ -78,6 +77,12 @@
}
&.padding-0 inner {
// style fix for padding == 0
margin: 0;
}
&.layout-horizontal inner {
flex-direction: row;