Skip to content

Commit

Permalink
final touches to the layout.
Browse files Browse the repository at this point in the history
  • Loading branch information
MPopov committed Sep 17, 2021
1 parent 88875aa commit bc8daa2
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@
@extend %igx-stepper__step-content !optional;
}

@include e(step, $m: active) {
@extend %igx-stepper__step--active !optional;
@include e(step-content-wrapper) {
@extend %igx-stepper__step-content-wrapper !optional;
}

@include e(step, $m: current) {
@extend %igx-stepper__step--current !optional;
}

@include e(step, $m: skip) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@
$title-color: null,
$subtitle-color: null,
$incomplete-color: null,
//$complete-color: null,
//$error-color: null,
//$optional-color: null,
//$current-color: null,
//$disabled-color: null,
$current-color: null,
$step-line: null,
$complete-step-line: null,
) {
$name: 'igx-switch';
$name: 'igx-stepper';
$switch-schema: ();

@if map-has-key($schema, $name) {
Expand All @@ -43,10 +41,14 @@
@return extend($theme, (
name: $name,
palette: $palette,

step-hover-background: $step-hover-background,
title-color: $title-color,
subtitle-color: $subtitle-color,
incomplete-color: $incomplete-color,
current-color: $current-color,
step-line: $step-line,
complete-step-line: $complete-step-line,
));
}

Expand All @@ -59,6 +61,9 @@

$variant: map-get($theme, variant);

$dashed-border: #fff;
$dashed-border-size: rem(20px) rem(1px);

$left: if-ltr(left, right);
$right: if-ltr(right, left);

Expand All @@ -72,7 +77,6 @@
%stepper-display {
flex-direction: column;
width: 100%;
overflow: hidden;
}

%igx-stepper__header {
Expand All @@ -81,37 +85,55 @@
}

%igx-stepper__body {
overflow: hidden;
position: relative
}

%stepper-display,
%igx-stepper__body,
%igx-stepper__step-header,
%igx-stepper__title-wrapper {
overflow: hidden;
}

%igx-stepper__step {
position: relative;
flex-direction: column;
align-content: center;
justify-content: center;
align-self: flex-start;

&:last-of-type {
&::before {
display: none;
%igx-stepper__step-content-wrapper {
&::before {
display: none;
}
}
}
}

%igx-stepper__step-header {
padding: rem(24px);
display: flex;
align-content: center;
align-items: center;
padding: rem(24px);
position: relative;

igx-icon,
igx-avatar,
igx-badge,
igx-circular-bar,
[igxbutton] {
max-height: rem(24px);
max-width: rem(24px);
}

&:hover {
//background: --var($theme, 'title-color');
background: rgba(255, 255, 255, .1);
background: --var($theme, 'step-hover-background');
}
}

%igx-stepper__step--active {
%igx-stepper__step--current {
%igx-stepper__step-icon {
color: #4dff12;
color: --var($theme, 'current-color');
}
}

Expand All @@ -131,21 +153,6 @@
cursor: default;
}

%igx-stepper__step-content {
margin-#{$left}: rem(36px);
position: relative;

&::before {
content: '';
position: absolute;
top: rem(-16px);
bottom: rem(-16px);
#{$left}: rem(0);
width: rem(1px);
background: #999;
}
}

%igx-stepper__body-content {
display: block;
position: absolute;
Expand All @@ -160,7 +167,7 @@
z-index: -1;
}

%igx-stepper__step-content,
%igx-stepper__step-content-wrapper,
%igx-stepper__body-content {
padding: 0 rem(24px) rem(24px) rem(24px);
}
Expand All @@ -170,8 +177,23 @@
position: relative;
}

%igx-stepper__step-content-wrapper {
margin-#{$left}: rem(36px);
position: relative;

&::before {
content: '';
position: absolute;
top: rem(-16px);
bottom: rem(-16px);
#{$left}: rem(0);
width: rem(1px);
background: #999;
}
}

%igx-stepper__step-icon {
color: #09f;
color: --var($theme, 'incomplete-color');
margin-#{$right}: rem(12px);
}

Expand All @@ -185,16 +207,14 @@

%igx-stepper__title-wrapper {
width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
min-width: rem(50px);
}

%igx-stepper__title {
color: #fff;
color: --var($theme, 'title-color');
text-overflow: ellipsis;
overflow: hidden;
}

%igx-stepper__title--top {
Expand All @@ -211,31 +231,31 @@
}

%igx-stepper__step {
position: relative;
overflow: hidden;
flex-direction: row;
flex-grow: 1;

&::after {
&::after,
&::before {
content: '';
width: auto;
height: 1px;
flex: 1;
top: rem(-13px);
top: rem(36px);
position: relative;
align-self: center;
background: #999;
border-top: rem(1px) solid --var($theme, 'step-line');
}

&:last-of-type {
flex-basis: 0;

%igx-stepper__step-header::after,
&::after {
display: none;
}
}

&:first-of-type {
%igx-stepper__step-header::before {
%igx-stepper__step-header::before,
&::before {
display: none;
}
}
Expand All @@ -244,20 +264,17 @@
%igx-stepper__step-header {
display: flex;
flex-direction: column;
justify-content: center;
justify-content: flex-start;
align-items: center;
position: relative;
padding: rem(24px) rem(32px);
margin: 0 rem(8px);
cursor: pointer;

&::before,
&::after {
top: rem(36px);
content: '';
position: absolute;
height: rem(1px);
background: #999;
border-top: rem(1px) solid --var($theme, 'step-line');
width: calc(50% - 16px);
}

Expand All @@ -279,6 +296,10 @@
%igx-stepper__step-icon {
margin: 0;
}

%igx-stepper__step-content-wrapper {
text-align: center;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,19 @@ $_light-stepper: (

incomplete-color: (
igx-color: ('grays', 400)
)
),

current-color: (
igx-color: ('primary', 500)
),

step-line: (
igx-color: ('grays', 200)
),

complete-step-line: (
igx-color: ('grays', 900)
),
);

/// Generates a fluent stepper schema.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
@import '../components/slider/slider-theme';
@import '../components/snackbar/snackbar-theme';
@import '../components/switch/switch-theme';
@import '../components/stepper/stepper-theme';
@import '../components/tabs/tabs-theme';
@import '../components/time-picker/time-picker-theme';
@import '../components/toast/toast-theme';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
AfterViewInit, Component, HostBinding, OnDestroy, OnInit,
Input, Output, EventEmitter, ContentChildren, QueryList, ElementRef, NgModule
} from '@angular/core';
import { IgxCarouselComponentBase } from 'igniteui-angular';
import {IgxCarouselComponentBase, IgxRippleModule} from 'igniteui-angular';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { growVerIn, growVerOut } from '../animations/grow';
Expand Down Expand Up @@ -245,7 +245,8 @@ export class IgxStepperComponent extends IgxCarouselComponentBase implements OnI

@NgModule({
imports: [
CommonModule
CommonModule,
IgxRippleModule
],
declarations: [
IgxStepComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@
</div>
</ng-template>

<div class="igx-stepper__step-header" [ngClass]="stepHeaderClasses" (click)="onPointerDown($event)">
<div class="igx-stepper__step-header" igxRipple [ngClass]="stepHeaderClasses" (click)="onPointerDown($event)">
<ng-content select='[igxStepIcon]'></ng-content>
<div class="igx-stepper__title-wrapper">
<ng-container *ngTemplateOutlet="defaultLabel"></ng-container>
</div>
</div>

<ng-container *ngIf="!isHorizontal">
<ng-container *ngTemplateOutlet="contentTemplate"></ng-container>
<div class="igx-stepper__step-content-wrapper">
<ng-container *ngTemplateOutlet="contentTemplate"></ng-container>
</div>
</ng-container>

Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ export class IgxStepComponent extends ToggleAnimationPlayer implements OnInit, A

public get stepHeaderClasses() {
if (this.active) {
return 'igx-stepper__step--active';
return 'igx-stepper__step--current';
}
if (this.disabled) {
return 'igx-stepper__step--disabled';
Expand Down
Loading

0 comments on commit bc8daa2

Please sign in to comment.