Skip to content

Commit 8f0a950

Browse files
elupanovyggg
authored andcommitted
refactor: material input new look
* fix(form-inputs): show material inputs * feat(material): change inputs style
1 parent c887318 commit 8f0a950

File tree

4 files changed

+32
-19
lines changed

4 files changed

+32
-19
lines changed

src/app/@theme/styles/material/_material-dark.scss

+9-4
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ $theme: (
396396
card-background-color: color-basic-800,
397397
card-divider-color: color-basic-700,
398398

399-
input-border-width: 0 0 1px 0,
399+
input-border-width: 1px,
400400
input-basic-border-color: rgba(255, 255, 255, 0.7),
401401
input-basic-focus-border-color: color-primary-focus,
402402
input-basic-disabled-border-color: input-basic-border-color,
@@ -405,9 +405,14 @@ $theme: (
405405
input-basic-focus-background-color: transparent,
406406
input-basic-disabled-background-color: transparent,
407407
input-basic-hover-background-color: transparent,
408-
input-rectangle-border-radius: 0,
409-
input-semi-round-border-radius: 0,
410-
input-round-border-radius: 0,
408+
input-rectangle-border-radius: 0.25rem,
409+
input-semi-round-border-radius: 0.25rem,
410+
input-round-border-radius: 0.25rem,
411+
input-medium-padding: 0.75rem 1rem,
412+
input-large-padding: 1rem 1rem,
413+
input-small-text-font-weight: text-paragraph-font-weight,
414+
input-medium-text-font-weight: text-paragraph-font-weight,
415+
input-large-text-font-weight: text-paragraph-font-weight,
411416
input-primary-background-color: input-basic-background-color,
412417
input-primary-focus-background-color: input-basic-focus-background-color,
413418
input-primary-disabled-background-color: input-basic-disabled-background-color,

src/app/@theme/styles/material/_material-light.scss

+9-4
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ $theme: (
392392
card-border-style: none,
393393
card-divider-color: color-basic-200,
394394

395-
input-border-width: 0 0 1px 0,
395+
input-border-width: 1px,
396396
input-basic-border-color: rgba(0, 0, 0, 0.42),
397397
input-basic-focus-border-color: color-primary-focus,
398398
input-basic-disabled-border-color: rgba(0, 0, 0, 0.42),
@@ -401,9 +401,14 @@ $theme: (
401401
input-basic-focus-background-color: transparent,
402402
input-basic-disabled-background-color: transparent,
403403
input-basic-hover-background-color: transparent,
404-
input-rectangle-border-radius: 0,
405-
input-semi-round-border-radius: 0,
406-
input-round-border-radius: 0,
404+
input-rectangle-border-radius: 0.25rem,
405+
input-semi-round-border-radius: 0.25rem,
406+
input-round-border-radius: 0.25rem,
407+
input-medium-padding: 0.75rem 1rem,
408+
input-large-padding: 1rem 1rem,
409+
input-small-text-font-weight: text-paragraph-font-weight,
410+
input-medium-text-font-weight: text-paragraph-font-weight,
411+
input-large-text-font-weight: text-paragraph-font-weight,
407412
input-primary-background-color: input-basic-background-color,
408413
input-primary-focus-background-color: input-basic-focus-background-color,
409414
input-primary-disabled-background-color: input-basic-disabled-background-color,

src/app/pages/forms/form-inputs/form-inputs.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
</nb-card>
8888
</div>
8989
</div>
90-
<div *ngIf="materialTheme$ | async" class="row">
90+
<div *ngIf="showMaterialInputs" class="row">
9191
<div class="col-lg-12">
9292
<ngx-material-inputs></ngx-material-inputs>
9393
</div>
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
1-
import { Component } from '@angular/core';
1+
import { Component, OnInit } from '@angular/core';
22
import { NbThemeService } from '@nebular/theme';
33
import { Observable } from 'rxjs';
4-
import { map } from 'rxjs/operators';
4+
import { tap } from 'rxjs/operators';
55

66
@Component({
77
selector: 'ngx-form-inputs',
88
styleUrls: ['./form-inputs.component.scss'],
99
templateUrl: './form-inputs.component.html',
1010
})
11-
export class FormInputsComponent {
11+
export class FormInputsComponent implements OnInit {
1212
public constructor(private readonly themeService: NbThemeService) {
13-
this.materialTheme$ = this.themeService.onThemeChange()
14-
.pipe(map(theme => {
15-
const themeName: string = theme?.name || '';
16-
return themeName.startsWith('material');
17-
}));
1813
}
1914

20-
public readonly materialTheme$: Observable<boolean>;
21-
15+
public materialTheme$: Observable<boolean>;
2216
public starRate: number = 2;
2317
public heartRate: number = 4;
2418
public radioGroupValue: string = 'This is value 2';
19+
public showMaterialInputs = false;
20+
21+
ngOnInit() {
22+
this.materialTheme$ = this.themeService.onThemeChange()
23+
.pipe(tap(theme => {
24+
const themeName: string = theme?.name || '';
25+
this.showMaterialInputs = themeName.startsWith('material');
26+
}));
27+
}
2528
}

0 commit comments

Comments
 (0)