-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pie-divider): DSW-2286 add label to pie-divider (#1746)
* feat(pie-divider): DSW-2286 add label to pie-divider * Update changeset file * feat(pie-divider): DSW-2286 rewrite label logic from slot to prop * fix(pie-divider): DSW-2286 adress review comments * feat(pie-divider): DSW-2286 add props for screen readers * fix(pie-divider): DSW-2286 fix comments after review * fix(pie-divider): DSW-2286 fix styles * fix(pie-divider): DSW-2286 update visual tests and styles
- Loading branch information
1 parent
1108446
commit 8566e90
Showing
9 changed files
with
151 additions
and
28 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 @@ | ||
--- | ||
"pie-storybook": minor | ||
--- | ||
|
||
[Added] - `Labelled` story and a storybook control for the `label` property |
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 @@ | ||
--- | ||
"@justeattakeaway/pie-divider": minor | ||
--- | ||
|
||
[Added] - `label` property to `pie-divider` |
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
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 |
---|---|---|
@@ -1,22 +1,54 @@ | ||
@use '@justeattakeaway/pie-css/scss' as p; | ||
|
||
.c-divider { | ||
--divider-bg-color: var(--dt-color-divider-default); | ||
--divider-width: 100%; | ||
--divider-height: 1px; | ||
--divider-bg-color: var(--dt-color-divider-default); | ||
--divider-width: 100%; | ||
--divider-min-width: 16px; | ||
--divider-height: 1px; | ||
--divider-label-max-width: 90%; | ||
|
||
width: var(--divider-width); | ||
|
||
&, | ||
hr { | ||
margin: 0; | ||
border: 0; | ||
width: var(--divider-width); | ||
height: var(--divider-height); | ||
background-color: var(--divider-bg-color); | ||
} | ||
|
||
&.c-divider--inverse { | ||
--divider-bg-color: var(--dt-color-divider-inverse); | ||
&:not(.c-divider--labelled) { | ||
height: var(--divider-height); | ||
} | ||
|
||
&.c-divider--labelled { | ||
display: flex; | ||
align-items: center; | ||
text-align: center; | ||
gap: var(--dt-spacing-b); | ||
background-color: transparent; | ||
|
||
.c-divider-label { | ||
max-width: var(--divider-label-max-width); | ||
word-wrap: break-word; | ||
} | ||
|
||
&.c-divider--vertical { | ||
--divider-width: 1px; | ||
--divider-height: 100%; | ||
hr { | ||
flex-grow: 1; | ||
height: var(--divider-height); | ||
min-width: var(--divider-min-width); | ||
} | ||
|
||
&.c-divider--inverse { | ||
color: var(--dt-color-content-inverse); | ||
} | ||
} | ||
|
||
&.c-divider--inverse { | ||
--divider-bg-color: var(--dt-color-divider-inverse); | ||
} | ||
|
||
&.c-divider--vertical { | ||
--divider-width: 1px; | ||
--divider-height: 100%; | ||
} | ||
} |
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
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