Skip to content

Commit 6e690c2

Browse files
atlwendybenjamincharity
authored andcommitted
fix(Icon): icon should have a fixed height
1 parent 91e588d commit 6e690c2

File tree

9 files changed

+102
-1
lines changed

9 files changed

+102
-1
lines changed

.percy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version: 1
2+
snapshot:
3+
widths: [1280]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
describe(`Icon Component`, () => {
2+
it(`should load the icon page`, () => {
3+
cy.visit('http://localhost:4200/components/button');
4+
cy.percySnapshot('Icon: all icons');
5+
});
6+
});

projects/library/icon/src/icon.component.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
//
1313
.ts-icon {
1414
@include reset;
15+
$icon-height: 24px;
16+
1517
display: inline-block;
18+
height: $icon-height;
1619

1720
&.ts-icon--inline {
1821
$margin: spacing(small, 2);

projects/visual-regression/src/app/components/chip/chip.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { FlexLayoutModule } from '@angular/flex-layout';
44
import { FormsModule } from '@angular/forms';
55
import { TsButtonModule } from '@terminus/ui/button';
66
import { TsCardModule } from '@terminus/ui/card';
7-
import { TsChipModule } from "@terminus/ui/chip";
7+
import { TsChipModule } from '@terminus/ui/chip';
88
import { TsIconModule } from '@terminus/ui/icon';
99
import { TsSpacingModule } from '@terminus/ui/spacing';
1010

projects/visual-regression/src/app/components/components.constant.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ export const componentsList: Routes = [
1515
path: 'chip',
1616
loadChildren: () => import('./chip/chip.module').then(m => m.ChipModule),
1717
},
18+
{
19+
path: 'icon',
20+
loadChildren: () => import('./icon/icon.module').then(m => m.IconModule),
21+
},
1822
{
1923
path: 'input',
2024
loadChildren: () => import('./input/input.module').then(m => m.InputModule),
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { NgModule } from '@angular/core';
2+
import {
3+
RouterModule,
4+
Routes,
5+
} from '@angular/router';
6+
7+
import { IconComponent } from './icon.component';
8+
9+
10+
const routes: Routes = [
11+
{
12+
path: '',
13+
component: IconComponent,
14+
},
15+
];
16+
17+
@NgModule({
18+
imports: [RouterModule.forChild(routes)],
19+
exports: [RouterModule],
20+
})
21+
export class IconRoutingModule { }
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<div style="margin: 20px">
2+
<ts-icon>home</ts-icon>
3+
<ts-icon>wallpaper</ts-icon>
4+
<ts-icon theme="accent">storage</ts-icon>
5+
<ts-icon theme="warn">open_in_new</ts-icon>
6+
<ts-icon svgIcon="csv"></ts-icon>
7+
<ts-icon svgIcon="engage" theme="primary"></ts-icon>
8+
<ts-icon svgIcon="lightbulb" theme="accent"></ts-icon>
9+
<ts-icon svgIcon="logo" theme="warn"></ts-icon>
10+
<ts-icon svgIcon="logo_color"></ts-icon>
11+
<br>
12+
<br>
13+
14+
<ts-icon theme="primary" [background]="true">brightness_medium</ts-icon>
15+
<ts-icon theme="accent" [background]="true">storage</ts-icon>
16+
<ts-icon theme="warn" [background]="true">hourglass_empty</ts-icon>
17+
<ts-icon svgIcon="logo" theme="primary" [background]="true"></ts-icon>
18+
<ts-icon svgIcon="csv" theme="accent" [background]="true"></ts-icon>
19+
<ts-icon [background]="true">brightness_medium</ts-icon>
20+
<br>
21+
<br>
22+
23+
<div>
24+
Test me out
25+
<ts-icon [inline]="true">home</ts-icon>
26+
for horizontal rhythm
27+
<ts-icon [inline]="true">queue</ts-icon>
28+
to make sure
29+
<ts-icon [inline]="true">add_alarm</ts-icon>
30+
everything looks fine.
31+
<ts-icon [inline]="true">open_in_new</ts-icon>
32+
</div>
33+
</div>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-icon',
5+
templateUrl: './icon.component.html',
6+
})
7+
export class IconComponent {
8+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { CommonModule } from '@angular/common';
2+
import { NgModule } from '@angular/core';
3+
import { TsCardModule } from '@terminus/ui/card';
4+
import { TsIconModule } from '@terminus/ui/icon';
5+
import { TsSpacingModule } from '@terminus/ui/spacing';
6+
7+
import { IconRoutingModule } from './icon-routing.module';
8+
import { IconComponent } from './icon.component';
9+
10+
11+
@NgModule({
12+
imports: [
13+
CommonModule,
14+
IconRoutingModule,
15+
TsCardModule,
16+
TsIconModule,
17+
TsSpacingModule,
18+
],
19+
declarations: [
20+
IconComponent,
21+
],
22+
})
23+
export class IconModule {}

0 commit comments

Comments
 (0)