-
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 2 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,35 @@ | ||
@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: 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: mat-color($background, 'card'); | ||
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.
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<div *ngFor="let step of _steps; let i = index; let isLast = last"> | ||
<div #stepHeader class="mat-stepper-header" role="tab" | ||
<div class="mat-step" *ngFor="let step of _steps; let i = index; let isLast = last"> | ||
<div #stepHeader class="mat-vertical-stepper-header" role="tab" | ||
[id]="_getStepLabelId(i)" | ||
[attr.aria-controls]="_getStepContentId(i)" | ||
[attr.aria-selected]="selectedIndex == i" | ||
|
@@ -19,11 +19,13 @@ | |
</div> | ||
|
||
</div> | ||
<div *ngIf="!isLast" class="connector-line"></div> | ||
<div class="mat-stepper-content" role="tabpanel" | ||
[id]="_getStepContentId(i)" | ||
[attr.aria-labelledby]="_getStepLabelId(i)" | ||
[attr.aria-expanded]="selectedIndex == i"> | ||
<ng-container [ngTemplateOutlet]="step.content"></ng-container> | ||
<div class="vertical-content-container"> | ||
<!--<div *ngIf="!isLast" class="vertical-connector-line"></div>--> | ||
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. remove |
||
<div class="mat-vertical-stepper-content" role="tabpanel" | ||
[id]="_getStepContentId(i)" | ||
[attr.aria-labelledby]="_getStepLabelId(i)" | ||
[attr.aria-expanded]="selectedIndex == i"> | ||
<ng-container [ngTemplateOutlet]="step.content"></ng-container> | ||
</div> | ||
</div> | ||
</div> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,108 @@ | ||
.mat-stepper-content[aria-expanded='false'] { | ||
display: none; | ||
$mat-stepper-header-height: 72px; | ||
$mat-stepper-circle-size: 24px; | ||
|
||
:host { | ||
display: block; | ||
padding-left: 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. create scss var for this |
||
} | ||
|
||
.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: 50px; | ||
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 |
||
} | ||
|
||
.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: 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. scss var |
||
} | ||
|
||
.mat-horizontal-stepper-header { | ||
display: inline-flex; | ||
line-height: $mat-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: 8px; | ||
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 both of these |
||
margin-top: 24px; | ||
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: 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. scss var |
||
|
||
.mat-stepper-index { | ||
margin-right: 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 |
||
} | ||
} | ||
|
||
.mat-stepper-index, .mat-stepper-label { | ||
display: inline-block; | ||
.connector-line { | ||
border: 0; | ||
height: 1px; | ||
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 vars |
||
border-top: 1px solid #bdbdbd; | ||
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.
|
||
margin-top: 36px; | ||
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: 8px; | ||
margin-right: 8px; | ||
} | ||
|
||
.mat-horizontal-stepper-content { | ||
padding-right: 24px; | ||
|
||
&[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: 1px solid #bdbdbd; | ||
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 vars, |
||
top: 0; | ||
bottom: 0; | ||
margin: 8px 0 8px 12px; | ||
padding: 8px 0; | ||
} | ||
|
||
.mat-vertical-stepper-content { | ||
margin-left: 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. scss var |
||
|
||
&[aria-expanded='false'] { | ||
display: none; | ||
} | ||
|
||
&[aria-expanded='true'] { | ||
padding-bottom: 48px; | ||
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 vars |
||
padding-top: 16px; | ||
} | ||
} | ||
|
||
.mat-step { | ||
&:last-child { | ||
.vertical-content-container { | ||
border: none; | ||
} | ||
} | ||
|
||
&:first-child { | ||
padding-top: 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. scss var |
||
} | ||
} |
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.
nit:
background-color