-
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.
feat(styles): implemented new ordered list (#3755)
- Loading branch information
1 parent
6aa530e
commit 40f58b7
Showing
7 changed files
with
101 additions
and
3 deletions.
There are no files selected for viewing
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,5 @@ | ||
--- | ||
'@swisspost/design-system-styles': minor | ||
--- | ||
|
||
Added custom styles for the ordered lists. |
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 @@ | ||
describe('List', () => { | ||
describe('Accessibility', () => { | ||
beforeEach(() => { | ||
cy.visit('/iframe.html?id=snapshots--list'); | ||
cy.get('ol', { timeout: 30000 }).should('be.visible'); | ||
cy.injectAxe(); | ||
}); | ||
|
||
it('Has no detectable a11y violations on load for all variants', () => { | ||
cy.checkA11y('#root-inner'); | ||
}); | ||
}); | ||
}); |
6 changes: 3 additions & 3 deletions
6
packages/documentation/cypress/snapshots/components/list.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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
describe('List', () => { | ||
it('default', () => { | ||
cy.visit('/iframe.html?id=snapshots--post-list'); | ||
cy.get('list-example', { timeout: 30000 }).should('be.visible'); | ||
cy.percySnapshot('List', { widths: [1440] }); | ||
cy.visit('/iframe.html?id=snapshots--list'); | ||
cy.get('ol', { timeout: 30000 }).should('be.visible'); | ||
cy.percySnapshot('Lists', { widths: [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
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 |
---|---|---|
|
@@ -5,4 +5,5 @@ | |
@use 'list-bullet'; | ||
@use 'paragraph'; | ||
@use 'fieldset-legend'; | ||
@use 'list'; | ||
@use 'heading'; |
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,28 @@ | ||
@use '../functions/tokens'; | ||
@use '../tokens/elements'; | ||
|
||
tokens.$default-map: elements.$post-listnumber; | ||
|
||
ol { | ||
display: grid; | ||
grid-template-columns: [marker] auto [item] 1fr; | ||
list-style: none; | ||
counter-reset: ol; | ||
padding: tokens.get('list-number-item-gap-block'); | ||
gap: tokens.get('list-number-margin-block'); | ||
|
||
> li { | ||
display: grid; | ||
grid-template-columns: subgrid; | ||
counter-increment: ol; | ||
column-gap: tokens.get('list-number-item-icon-gap-inline'); | ||
grid-column: span 2; | ||
|
||
&::before { | ||
text-align: right; | ||
content: counter(ol) '.'; | ||
grid-column: marker; | ||
grid-row: span 30000; | ||
} | ||
} | ||
} |