fix: Fix curved corners (again) (#1595)

This commit is contained in:
Dermot Duffy
2024-09-29 13:37:39 -07:00
committed by GitHub
parent 6565584cf3
commit ff6dbba9f3
3 changed files with 25 additions and 13 deletions
+1 -1
View File
@@ -377,8 +377,8 @@ class FrigateCard extends LitElement {
</frigate-card-loading>` </frigate-card-loading>`
: ''} : ''}
${this._renderMenuStatusContainer('top')} ${this._renderMenuStatusContainer('top')}
<div ${ref(this._refMain)} class="${classMap(mainClasses)}">
${this._renderMenuStatusContainer('overlay')} ${this._renderMenuStatusContainer('overlay')}
<div ${ref(this._refMain)} class="${classMap(mainClasses)}">
<frigate-card-views <frigate-card-views
${ref(this._refViews)} ${ref(this._refViews)}
.hass=${this._hass} .hass=${this._hass}
+9 -4
View File
@@ -49,8 +49,9 @@ frigate-card-loading {
div.main { div.main {
position: relative; position: relative;
// Some elements (such as submenus) may need to extend beyond the card boundary. // Required to keep curved corners on the card.
overflow: visible; overflow: auto;
width: 100%; width: 100%;
height: 100%; height: 100%;
margin: auto; margin: auto;
@@ -173,12 +174,16 @@ web-dialog::part(dialog) {
* "Outside" style for menu/status bar * "Outside" style for menu/status bar
*************************************/ *************************************/
.outerlay[data-position='top'] { // Style is set on the children themselves, to avoid the need for the parent
// outlay to prevent overflow (which needs to be enabled to menu items to be
// visible). See similar approach in overlay.scss for overlay.
.outerlay[data-position='top'] > *:first-child {
border-top-left-radius: var(--ha-card-border-radius, 4px); border-top-left-radius: var(--ha-card-border-radius, 4px);
border-top-right-radius: var(--ha-card-border-radius, 4px); border-top-right-radius: var(--ha-card-border-radius, 4px);
} }
.outerlay[data-position='bottom'] { .outerlay[data-position='bottom'] > *:last-child {
border-bottom-left-radius: var(--ha-card-border-radius, 4px); border-bottom-left-radius: var(--ha-card-border-radius, 4px);
border-bottom-right-radius: var(--ha-card-border-radius, 4px); border-bottom-right-radius: var(--ha-card-border-radius, 4px);
} }
+15 -8
View File
@@ -60,19 +60,26 @@ slot[name='right'] {
* Match rounded corners to card * Match rounded corners to card
*******************************/ *******************************/
slot[name='top'], // Style is set on the children themselves, to avoid the need for the parent
slot[name='left'] { // outlay to prevent overflow (which needs to be enabled to menu items to be
// visible). See similar approach in card.scss for outerlay.
::slotted([slot='top']:first-child),
::slotted([slot='left']:first-child) {
border-top-left-radius: var(--ha-card-border-radius, 4px); border-top-left-radius: var(--ha-card-border-radius, 4px);
} }
slot[name='top'],
slot[name='right'] { ::slotted([slot='top']:first-child),
::slotted([slot='right']:first-child) {
border-top-right-radius: var(--ha-card-border-radius, 4px); border-top-right-radius: var(--ha-card-border-radius, 4px);
} }
slot[name='bottom'],
slot[name='left'] { ::slotted([slot='bottom']:last-child),
::slotted([slot='left']:last-child) {
border-bottom-left-radius: var(--ha-card-border-radius, 4px); border-bottom-left-radius: var(--ha-card-border-radius, 4px);
} }
slot[name='bottom'],
slot[name='right'] { ::slotted([slot='bottom']:last-child),
::slotted([slot='right']:last-child) {
border-bottom-right-radius: var(--ha-card-border-radius, 4px); border-bottom-right-radius: var(--ha-card-border-radius, 4px);
} }