-
Notifications
You must be signed in to change notification settings - Fork 6.8k
feat(stepper): Add initial styles to stepper based on Material guidelines #6242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ab28eb9
Add initial styles to stepper based on Material guidelines
jwshinjwshin 398123b
Fix flex-shrink and min-width
jwshinjwshin 95c81b0
Changes made based on review
jwshinjwshin 06762a9
Fix alignment
jwshinjwshin 7bb7a54
Margin modifications
jwshinjwshin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,43 @@ | ||
@import '../core/theming/palette'; | ||
@import '../core/theming/theming'; | ||
@import '../core/typography/_typography-utils.scss'; | ||
|
||
@mixin mat-stepper-theme($theme) { | ||
$foreground: map-get($theme, foreground); | ||
$background: map-get($theme, background); | ||
$primary: map-get($theme, primary); | ||
|
||
.mat-horizontal-stepper-header, .mat-vertical-stepper-header { | ||
|
||
.mat-stepper-label { | ||
color: mat-color($foreground, text); | ||
} | ||
|
||
.mat-stepper-index { | ||
background-color: mat-color($primary); | ||
color: mat-color($primary, default-contrast); | ||
} | ||
|
||
&[aria-selected='false'] { | ||
.mat-stepper-label { | ||
color: mat-color($foreground, disabled-text); | ||
} | ||
|
||
.mat-stepper-index { | ||
background-color: mat-color($foreground, disabled-text); | ||
} | ||
} | ||
} | ||
|
||
.mat-stepper-horizontal, .mat-stepper-vertical { | ||
background-color: mat-color($background, card); | ||
} | ||
|
||
.vertical-content-container { | ||
border-left-color: mat-color($foreground, divider); | ||
} | ||
|
||
.connector-line { | ||
border-top-color: mat-color($foreground, divider); | ||
} | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,109 @@ | ||
.mat-stepper-content[aria-expanded='false'] { | ||
display: none; | ||
$mat-horizontal-stepper-header-height: 72px; | ||
$mat-label-header-height: 24px; | ||
$mat-stepper-label-min-width: 50px; | ||
$mat-stepper-side-gap: 24px; | ||
$mat-vertical-stepper-content-margin-right: 12px; | ||
$mat-vertical-stepper-content-padding: 16px 0 32px 0; | ||
$mat-vertical-content-container-padding: 8px; | ||
$mat-connector-line-width: 1px; | ||
$mat-connector-line-gap: 8px; | ||
$mat-horizontal-connector-line-size: 5%; | ||
|
||
:host { | ||
display: block; | ||
padding-left: $mat-stepper-side-gap; | ||
} | ||
|
||
.mat-stepper-label { | ||
display: inline-flex; | ||
white-space: nowrap; | ||
overflow: hidden; | ||
// TODO(jwshin): text-overflow does not work as expected. | ||
text-overflow: ellipsis; | ||
min-width: $mat-stepper-label-min-width; | ||
} | ||
|
||
.mat-stepper-index { | ||
border-radius: 50%; | ||
height: $mat-label-header-height; | ||
width: $mat-label-header-height; | ||
text-align: center; | ||
line-height: $mat-label-header-height; | ||
} | ||
|
||
.mat-horizontal-stepper-header-container { | ||
white-space: nowrap; | ||
display: flex; | ||
padding-right: $mat-stepper-side-gap; | ||
align-items: center; | ||
} | ||
|
||
.mat-horizontal-stepper-header { | ||
display: inline-flex; | ||
line-height: $mat-horizontal-stepper-header-height; | ||
overflow: hidden; | ||
align-items: center; | ||
|
||
.mat-stepper-index { | ||
margin-right: $mat-connector-line-gap; | ||
display: inline-block; | ||
flex: none; | ||
} | ||
} | ||
|
||
.mat-vertical-stepper-header { | ||
display: inline-flex; | ||
align-items: center; | ||
|
||
.mat-stepper-index { | ||
margin-right: $mat-vertical-stepper-content-margin-right; | ||
} | ||
} | ||
|
||
.mat-stepper-index, .mat-stepper-label { | ||
display: inline-block; | ||
.connector-line { | ||
border-top-width: $mat-connector-line-width; | ||
border-top-style: solid; | ||
width: $mat-horizontal-connector-line-size; | ||
flex: auto; | ||
margin: 0 $mat-connector-line-gap; | ||
height: 0; | ||
} | ||
|
||
.mat-horizontal-stepper-content { | ||
padding-right: $mat-stepper-side-gap; | ||
|
||
&[aria-expanded='false'] { | ||
display: none; | ||
} | ||
} | ||
|
||
.vertical-content-container { | ||
border-left-width: $mat-connector-line-width; | ||
border-left-style: solid; | ||
margin: $mat-connector-line-gap 0 $mat-connector-line-gap $mat-vertical-stepper-content-margin-right; | ||
padding: $mat-vertical-content-container-padding 0; | ||
} | ||
|
||
.mat-vertical-stepper-content { | ||
padding-left: $mat-stepper-side-gap; | ||
|
||
&[aria-expanded='false'] { | ||
display: none; | ||
} | ||
|
||
&[aria-expanded='true'] { | ||
padding: $mat-vertical-stepper-content-padding; | ||
} | ||
} | ||
|
||
.mat-step { | ||
&:last-child { | ||
.vertical-content-container { | ||
border: none; | ||
} | ||
} | ||
|
||
&:first-child { | ||
padding-top: $mat-stepper-side-gap; | ||
} | ||
} |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this work now? if not leave a TODO to investigate