Skip to content

Commit

Permalink
fix(core): Dialog remove paddings in page mode on mobile (#7563)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirpotekhin authored May 28, 2024
1 parent 72e839b commit 1dcc15e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 15 deletions.
31 changes: 18 additions & 13 deletions projects/core/components/dialog/dialog.style.less
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,6 @@
}
}

&[data-size='page'] {
.t-content {
padding: 0;
}
}

&._centered {
text-align: center;
}
Expand All @@ -103,6 +97,13 @@
}
}
}

&[data-size='page'],
:host-context(tui-root._mobile) &[data-size='page'] {
.t-content {
padding: 0;
}
}
}

.t-heading {
Expand Down Expand Up @@ -157,7 +158,6 @@
top: 1.5rem;
right: 1.5rem;
display: none;
color: var(--tui-base-01);

:host-context(.t-dialog:last-of-type) & {
display: inline-flex;
Expand All @@ -166,6 +166,7 @@
:host:not([data-size='fullscreen']):not([data-size='page']) & {
animation: tuiFadeIn var(--tui-duration);
background: rgba(104, 104, 104, 0.96);
color: var(--tui-base-01);

&:hover {
background: rgba(159, 159, 159, 0.86);
Expand All @@ -177,12 +178,16 @@
}

:host-context(tui-root._mobile) & {
position: absolute;
top: 0;
right: 0;
background: transparent !important;
color: var(--tui-text-01);
opacity: 0.5;
&[data-size] {
--tui-fade-end: 0.5;

position: absolute;
top: 0;
right: 0;
background: transparent !important;
color: var(--tui-text-01);
opacity: 0.5;
}
}
}

Expand Down
12 changes: 12 additions & 0 deletions projects/demo-playwright/tests/core/dialogs/dialogs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,5 +182,17 @@ test.describe('Dialogs', () => {

await expect(page).toHaveScreenshot('09-dialog.png');
});

test('dismissible = true, fullscreen, desktop', async ({page}) => {
await page.setViewportSize({width: 1024, height: 900});
await tuiGoto(page, 'components/dialog/API?size=fullscreen&dismissible=true');

await page.locator('tui-doc-page button[data-appearance="primary"]').click();
await page.mouse.click(100, 100);

await expect(page.locator('tui-dialog')).toHaveCount(1);

await expect(page).toHaveScreenshot('10-dialog.png');
});
});
});
4 changes: 2 additions & 2 deletions projects/styles/basic/keyframes.less
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

@keyframes tuiFadeIn {
from {
opacity: 0;
opacity: var(--tui-fade-start, 0);
}

to {
opacity: 1;
opacity: var(--tui-fade-end, 1);
}
}

0 comments on commit 1dcc15e

Please sign in to comment.