Skip to content

Commit

Permalink
fix: modal css vars (#784)
Browse files Browse the repository at this point in the history
* css vars for width, background and border radius

* more border radius

* remove max-width from dialog
  • Loading branch information
JesmoDev authored Apr 16, 2024
1 parent d37c2c4 commit 145dbf0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/uui-modal/lib/uui-modal-dialog.element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,21 @@ export class UUIModalDialogElement extends UUIModalElement {
static styles = [
...UUIModalElement.styles,
css`
:host {
--uui-modal-dialog-background: var(--uui-color-surface);
}
dialog {
margin: auto;
max-width: 100%;
max-height: 100%;
border-radius: 12px;
border-radius: var(
--uui-modal-dialog-border-radius,
calc(var(--uui-border-radius) * 4)
);
background: var(
--uui-modal-dialog-background,
var(--uui-color-surface)
);
}
:host([index='0']) dialog {
box-shadow: var(--uui-shadow-depth-5);
Expand Down
5 changes: 5 additions & 0 deletions packages/uui-modal/lib/uui-modal-sidebar.element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export class UUIModalSidebarElement extends UUIModalElement {
css`
:host {
--uui-modal-sidebar-left-gap: 24px;
--uui-modal-sidebar-background: var(--uui-color-surface);
}
@media (min-width: 600px) {
:host {
Expand All @@ -82,6 +83,10 @@ export class UUIModalSidebarElement extends UUIModalElement {
margin-left: auto;
right: var(--uui-modal-offset);
transition: right var(--uui-modal-transition-duration, 250ms);
background: var(
--uui-modal-sidebar-background,
var(--uui-color-surface)
);
}
:host([index='0']) dialog {
box-shadow: var(--uui-shadow-depth-5);
Expand Down

0 comments on commit 145dbf0

Please sign in to comment.