-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
87 additions
and
25 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
packages/documentation/cypress/snapshots/utilities/display.snapshot.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
describe('Display', () => { | ||
it('display', () => { | ||
cy.visit('/iframe.html?id=snapshots--display'); | ||
cy.get('.display-example', { timeout: 30000 }).should('be.visible'); | ||
cy.percySnapshot('Display', { widths: [320, 1440] }); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
packages/documentation/src/stories/utilities/display/display.snapshot.stories.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import type { StoryObj } from '@storybook/web-components'; | ||
import { html } from 'lit'; | ||
import meta from './display.stories'; | ||
import { displayOptions } from './display.docs.mdx'; | ||
import './display.styles.scss'; | ||
|
||
const { id, ...metaWithoutId } = meta; | ||
|
||
export default { | ||
...metaWithoutId, | ||
title: 'Snapshots', | ||
}; | ||
|
||
type Story = StoryObj; | ||
|
||
export const Display: Story = { | ||
render: () => { | ||
return html` | ||
<div class="display-example"> | ||
${displayOptions.map( | ||
display => html` | ||
<div class="display-container p-8"> | ||
<div class="d-${display} p-8">${display}</div> | ||
<div class="d-${display} p-8">${display}</div> | ||
</div> | ||
`, | ||
)} | ||
</div> | ||
`; | ||
}, | ||
}; |
11 changes: 11 additions & 0 deletions
11
packages/documentation/src/stories/utilities/display/display.styles.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@use 'sass:color'; | ||
@use '@swisspost/design-system-styles/core' as post; | ||
|
||
.display-container { | ||
border: post.$border-width solid post.$border-color; | ||
|
||
> * { | ||
border: post.$border-width solid post.$border-color; | ||
background-color: color.adjust(post.$border-color, $lightness: 15%); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
$variables: ( | ||
post-utility-display-none: none, | ||
post-utility-display-inline: inline, | ||
post-utility-display-inline-block: inline-block, | ||
post-utility-display-block: block, | ||
post-utility-display-grid: grid, | ||
post-utility-display-inline-grid: inline-grid, | ||
post-utility-display-table: table, | ||
post-utility-display-table-cell: table-cell, | ||
post-utility-display-table-row: table-row, | ||
post-utility-display-flex: flex, | ||
post-utility-display-inline-flex: inline-flex, | ||
); |