Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion core/src/components/list-header/list-header.ios.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,17 @@
--color: #{$list-header-ios-color};
--border-color: #{$item-ios-border-bottom-color};

@include padding-horizontal(calc(var(--ion-safe-area-left, 0px) + #{$list-header-ios-padding-start}), null);
/* stylelint-disable */
@include ltr() {
padding-right: var(--ion-safe-area-right);
padding-left: calc(var(--ion-safe-area-left, 0px) + #{$list-header-ios-padding-start});
}

@include rtl() {
padding-right: calc(var(--ion-safe-area-right, 0px) + #{$list-header-ios-padding-start});
padding-left: var(--ion-safe-area-left);
}
/* stylelint-enable */

position: relative;

Expand Down
12 changes: 11 additions & 1 deletion core/src/components/list-header/list-header.md.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,17 @@
--color: #{$list-header-md-color};
--border-color: #{$item-md-border-bottom-color};

@include padding-horizontal(calc(var(--ion-safe-area-left, 0) + #{$list-header-md-padding-start}), null);
/* stylelint-disable */
@include ltr() {
padding-right: var(--ion-safe-area-right);
padding-left: calc(var(--ion-safe-area-left, 0px) + #{$list-header-md-padding-start});
}

@include rtl() {
padding-right: calc(var(--ion-safe-area-right, 0px) + #{$list-header-md-padding-start});
padding-left: var(--ion-safe-area-left);
}
/* stylelint-enable */

min-height: $list-header-md-min-height;

Expand Down
34 changes: 34 additions & 0 deletions core/src/components/list-header/test/basic/list-header.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,37 @@ configs().forEach(({ title, screenshot, config }) => {
});
});
});

/**
* This behavior needs to be tested in both modes and directions to
* make sure the safe area padding is applied only to that side
* regardless of direction
*/
configs().forEach(({ title, screenshot, config }) => {
Comment thread
liamdebeasi marked this conversation as resolved.
test.describe(title('list-header: basic'), () => {
test.describe('safe area', () => {
test('should have padding added by the safe area', async ({ page }) => {
await page.setContent(
`
<style>
:root {
--ion-safe-area-left: 40px;
--ion-safe-area-right: 20px;
}
</style>

<ion-list-header>
<ion-label>List Header</ion-label>
<ion-button>Button</ion-button>
</ion-list-header>
`,
config
);

const listHeader = page.locator('ion-list-header');

await expect(listHeader).toHaveScreenshot(screenshot(`list-header-safe-area`));
});
});
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.