Skip to content

Commit f4f4ca9

Browse files
committed
refactor(input): move file related styles to file component
1 parent b58829e commit f4f4ca9

File tree

6 files changed

+24
-19
lines changed

6 files changed

+24
-19
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@use 'styles/utilities' as *;
2+
3+
[part='file-names'] {
4+
font-size: rem(14px);
5+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@use 'styles/utilities' as *;
2+
@use '../../../input/themes/light/themes' as *;
3+
4+
$theme: $indigo;
5+
6+
[part='file-names'] {
7+
@include type-style('body-2');
8+
9+
color: var-get($theme, 'idle-text-color');
10+
font-size: rem(12px);
11+
line-height: rem(16px);
12+
}

src/components/file-input/themes/themes.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { all as inputThemes } from '../../input/themes/themes.js';
55

66
// Shared Styles
77
import { styles as bootstrap } from './shared/bootstrap.css.js';
8+
import { styles as fluent } from './shared/fluent.css.js';
9+
import { styles as indigo } from './shared/indigo.css.js';
810
import { styles as material } from './shared/material.css.js';
911

1012
const light = {
@@ -20,9 +22,11 @@ const light = {
2022
${inputThemes.light.material!}
2123
`,
2224
indigo: css`
25+
${indigo}
2326
${inputThemes.light.indigo!}
2427
`,
2528
fluent: css`
29+
${fluent}
2630
${inputThemes.light.fluent!}
2731
`,
2832
};
@@ -40,9 +44,11 @@ const dark = {
4044
${inputThemes.dark.material!}
4145
`,
4246
indigo: css`
47+
${indigo}
4348
${inputThemes.dark.indigo!}
4449
`,
4550
fluent: css`
51+
${fluent}
4652
${inputThemes.dark.fluent!}
4753
`,
4854
};

src/components/input/input.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { property } from 'lit/decorators.js';
33
import { ifDefined } from 'lit/directives/if-defined.js';
44
import { live } from 'lit/directives/live.js';
55

6-
import IgcButtonComponent from '../button/button.js';
76
import { registerComponent } from '../common/definitions/register.js';
87
import {
98
type FormValue,
@@ -47,11 +46,7 @@ export default class IgcInputComponent extends IgcInputBaseComponent {
4746

4847
/* blazorSuppress */
4948
public static register() {
50-
registerComponent(
51-
IgcInputComponent,
52-
IgcValidationContainerComponent,
53-
IgcButtonComponent
54-
);
49+
registerComponent(IgcInputComponent, IgcValidationContainerComponent);
5550
}
5651

5752
protected override _formValue: FormValue<string>;
@@ -275,7 +270,6 @@ export default class IgcInputComponent extends IgcInputBaseComponent {
275270
<input
276271
id=${this.inputId}
277272
part=${partNameMap(this.resolvePartNames('input'))}
278-
class="native-input"
279273
name=${ifDefined(this.name)}
280274
type=${ifDefined(this.type)}
281275
pattern=${ifDefined(this.pattern)}

src/components/input/themes/shared/input.fluent.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@ $focused-height: calc(var-get($theme, 'size') - #{($focused-border-width * 2)});
7474
border: none;
7575
grid-area: 1 / 2;
7676
}
77-
78-
[part='file-names'] {
79-
font-size: rem(14px);
80-
}
8177
}
8278

8379
:host(:hover) {

src/components/input/themes/shared/input.indigo.scss

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,6 @@ $transition-duration: .25s;
117117
[part~='suffixed'] {
118118
padding-inline-end: 0;
119119
}
120-
121-
[part='file-names'] {
122-
@include type-style('body-2');
123-
124-
color: var-get($theme, 'idle-text-color');
125-
font-size: rem(12px);
126-
line-height: rem(16px);
127-
}
128120
}
129121

130122
:host(:focus-within),

0 commit comments

Comments
 (0)