-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
feat(stepper): Add initial styles to stepper based on Material guidelines #6242
Changes from 3 commits
ab28eb9
398123b
95c81b0
06762a9
7bb7a54
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,118 @@ | ||
.mat-stepper-content[aria-expanded='false'] { | ||
display: none; | ||
$mat-horizontal-stepper-header-height: 72px; | ||
$mat-vertical-stepper-header-height: 24px; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are any of these values related to each other or conceptually the same thing? for example I see a lot of |
||
$mat-stepper-circle-size: 24px; | ||
$mat-stepper-label-min-width: 50px; | ||
$mat-stepper-container-padding: 24px; | ||
$mat-horizontal-stepper-index-margin-right: 8px; | ||
$mat-horizontal-stepper-index-martin-top: 24px; | ||
$mat-vertical-stepper-index-margin-right: 12px; | ||
$mat-vertical-stepper-content-padding-bottom: 48px; | ||
$mat-vertical-stepper-content-padding-top: 16px; | ||
$mat-vertical-content-container-padding: 8px; | ||
$mat-connector-line-width: 1px; | ||
$mat-connector-line-margin: 8px; | ||
$mat-connector-line-margin-top: 36px; | ||
|
||
:host { | ||
display: block; | ||
padding-left: $mat-stepper-container-padding; | ||
} | ||
|
||
.mat-stepper-label { | ||
display: inline-flex; | ||
white-space: nowrap; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does this work now? if not leave a TODO to investigate |
||
flex-shrink: 1; | ||
min-width: $mat-stepper-label-min-width; | ||
} | ||
|
||
.mat-stepper-index { | ||
border-radius: 50%; | ||
height: $mat-stepper-circle-size; | ||
width: $mat-stepper-circle-size; | ||
text-align: center; | ||
line-height: $mat-stepper-circle-size; | ||
} | ||
|
||
.mat-horizontal-stepper-header-container { | ||
white-space: nowrap; | ||
display: flex; | ||
padding-right: $mat-stepper-container-padding; | ||
} | ||
|
||
.mat-horizontal-stepper-header { | ||
display: inline-flex; | ||
line-height: $mat-horizontal-stepper-header-height; | ||
flex-grow: 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can use shorthand for |
||
flex-shrink: 1; | ||
overflow: hidden; | ||
|
||
.mat-stepper-index { | ||
margin-right: $mat-horizontal-stepper-index-margin-right; | ||
margin-top: $mat-horizontal-stepper-index-martin-top; | ||
display: inline-block; | ||
flex-shrink: 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
} | ||
|
||
.mat-vertical-stepper-header { | ||
display: inline-flex; | ||
line-height: $mat-vertical-stepper-header-height; | ||
|
||
.mat-stepper-index { | ||
margin-right: $mat-vertical-stepper-index-margin-right; | ||
} | ||
} | ||
|
||
.mat-stepper-index, .mat-stepper-label { | ||
display: inline-block; | ||
.connector-line { | ||
border-top-width: $mat-connector-line-width; | ||
border-top-style: solid; | ||
margin-top: $mat-connector-line-margin-top; | ||
width: 5%; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. scss var |
||
flex-grow: 1; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
flex-shrink: 1; | ||
margin-left: $mat-connector-line-margin; | ||
margin-right: $mat-connector-line-margin; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can use margin shorthand: |
||
} | ||
|
||
.mat-horizontal-stepper-content { | ||
padding-right: $mat-stepper-container-padding; | ||
|
||
&[aria-expanded='false'] { | ||
display: none; | ||
} | ||
} | ||
|
||
.vertical-content-container { | ||
content: ''; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ? |
||
border-left-width: $mat-connector-line-width; | ||
border-left-style: solid; | ||
margin: $mat-connector-line-margin 0 $mat-connector-line-margin 12px; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. scss var for |
||
padding: $mat-vertical-content-container-padding 0; | ||
} | ||
|
||
.mat-vertical-stepper-content { | ||
padding-left: $mat-stepper-container-padding; | ||
|
||
&[aria-expanded='false'] { | ||
display: none; | ||
} | ||
|
||
&[aria-expanded='true'] { | ||
padding-bottom: $mat-vertical-stepper-content-padding-bottom; | ||
padding-top: $mat-vertical-stepper-content-padding-top; | ||
} | ||
} | ||
|
||
.mat-step { | ||
&:last-child { | ||
.vertical-content-container { | ||
border: none; | ||
} | ||
} | ||
|
||
&:first-child { | ||
padding-top: $mat-stepper-container-padding; | ||
} | ||
} |
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.
remove