Skip to content

Commit

Permalink
fix(core/empty-state): center header texts for large layouts (#985)
Browse files Browse the repository at this point in the history
  • Loading branch information
nuke-ellington committed Dec 12, 2023
1 parent 326e5f8 commit 150f58b
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/core/src/components/empty-state/empty-state.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@
gap: $small-space;
}
}

.label__subHeader,
ix-typography {
text-align: center;
}
}

:host(.emptyState.emptyState--compact) {
Expand Down
6 changes: 6 additions & 0 deletions packages/core/src/tests/empty-state/empty-state.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ regressionTest.describe('empty state', () => {
expect(await emptyState.screenshot()).toMatchSnapshot();
});

regressionTest('overflow', async ({ page }) => {
await page.goto('empty-state/overflow');
const emptyState = await page.waitForSelector('ix-empty-state');
expect(await emptyState.screenshot()).toMatchSnapshot();
});

regressionTest('compact', async ({ page }) => {
await page.goto('empty-state/compact');
const emptyState = await page.waitForSelector('ix-empty-state');
Expand Down
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.
26 changes: 26 additions & 0 deletions packages/core/src/tests/empty-state/overflow/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!--
SPDX-FileCopyrightText: 2023 Siemens AG
SPDX-License-Identifier: MIT
-->

<html>
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0"
/>
<title>Stencil Component Starter</title>
</head>
<body>
<ix-empty-state
header="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua."
sub-header="At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua."
icon="add"
action="Create element"
></ix-empty-state>

<script src="http://127.0.0.1:8080/scripts/e2e/load-e2e-runtime.js"></script>
</body>
</html>

0 comments on commit 150f58b

Please sign in to comment.