Skip to content

Commit ae67b29

Browse files
committed
feat(file-input): fix bootstrap invalid state box-shadow + add file-input CSS vars for elements
1 parent c01572b commit ae67b29

17 files changed

+201
-20
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@use 'sass:map';
2+
@use 'styles/utilities' as *;
3+
@use 'igniteui-theming/sass/themes/schemas/components/dark/file-input' as *;
4+
5+
$material: digest-schema($dark-material-file-input);
6+
$bootstrap: digest-schema($dark-bootstrap-file-input);
7+
$fluent: digest-schema($dark-fluent-file-input);
8+
$indigo: digest-schema($dark-indigo-file-input);
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@use 'styles/utilities' as *;
2+
@use 'themes' as *;
3+
@use '../light/themes' as light;
4+
5+
$theme: $bootstrap;
6+
7+
:host {
8+
@include css-vars-from-theme(diff(light.$base, $theme), 'ig');
9+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@use 'styles/utilities' as *;
2+
@use 'themes' as *;
3+
@use '../light/themes' as light;
4+
5+
$theme: $fluent;
6+
7+
:host {
8+
@include css-vars-from-theme(diff(light.$base, $theme), 'ig');
9+
}
10+
11+
:host(:is(igc-file-input)) {
12+
[part~='file-names'] {
13+
color: var(--ig-input-idle-text-color, #fff)
14+
}
15+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@use 'styles/utilities' as *;
2+
@use 'themes' as *;
3+
@use '../light/themes' as light;
4+
5+
$theme: $indigo;
6+
7+
:host {
8+
@include css-vars-from-theme(diff(light.$base, $theme), 'ig');
9+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@use 'styles/utilities' as *;
2+
@use 'themes' as *;
3+
@use '../light/themes' as light;
4+
5+
$theme: $material;
6+
7+
:host {
8+
@include css-vars-from-theme(diff(light.$base, $theme), 'ig');
9+
}
10+
11+
:host(:is(igc-file-input)) {
12+
[part~='file-names'] {
13+
color: var(--ig-input-idle-text-color, #fff)
14+
}
15+
}

src/components/file-input/themes/file-input.base.scss

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
@use 'styles/utilities' as *;
22
@use '../../input/themes/light/themes' as *;
3+
@use 'light/themes' as file-input;
34

45
$theme: $base;
6+
$theme-file-input: file-input.$base;
57

68
:host(:is(igc-file-input)) {
79
[part~='file-parts'] {
@@ -22,6 +24,7 @@ $theme: $base;
2224

2325
align-content: center;
2426
grid-area: 1 / 3;
27+
background: var-get($theme-file-input, 'file-names-background')
2528
}
2629

2730
[part~='container'] {
@@ -47,6 +50,42 @@ $theme: $base;
4750
[part~='suffix'] {
4851
grid-area: 1 / 4;
4952
}
53+
54+
[part~='filled']
55+
[part~='file-names'] {
56+
color: var-get($theme, 'filled-text-color');
57+
background: var-get($theme-file-input, 'file-names-background--fill')
58+
}
59+
60+
[part~='container']:focus-within {
61+
[part~='file-names'] {
62+
color: var-get($theme, 'focused-text-color');
63+
background: var-get($theme-file-input, 'file-names-background--focus')
64+
}
65+
}
66+
67+
[part~='file-selector-button'] igc-button {
68+
--foreground: #{var-get($theme-file-input, 'file-selector-button-foreground')};
69+
--disabled-foreground: #{var-get($theme-file-input, 'file-selector-button-foreground--disable')};
70+
--background: #{var-get($theme-file-input, 'file-selector-button-background')};
71+
--disabled-background: #{var-get($theme-file-input, 'file-selector-button-background--disable')};
72+
--hover-foreground: var(--foreground);
73+
--active-foreground: var(--foreground);
74+
--hover-background: var(--background);
75+
--active-background: var(--background);
76+
}
77+
78+
[part~='filled']
79+
[part~='file-selector-button'] igc-button {
80+
--foreground: #{var-get($theme-file-input, 'file-selector-button-foreground--fill')};
81+
--background: #{var-get($theme-file-input, 'file-selector-button-background--fill')};
82+
}
83+
84+
[part~='container']:focus-within
85+
[part~='file-selector-button'] igc-button {
86+
--foreground: #{var-get($theme-file-input, 'file-selector-button-foreground--focus')};
87+
--background: #{var-get($theme-file-input, 'file-selector-button-background--focus')};
88+
}
5089
}
5190

5291
:host(:not(:disabled)) {
@@ -60,5 +99,6 @@ $theme: $base;
6099
:host(:is(igc-file-input)[disabled]) {
61100
[part~='file-names'] {
62101
color: var-get($theme, 'disabled-text-color');
102+
background: var-get($theme-file-input, 'file-names-background--disable')
63103
}
64104
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@use 'sass:map';
2+
@use 'styles/utilities' as *;
3+
@use 'igniteui-theming/sass/themes/schemas/components/light/file-input' as *;
4+
5+
$base: digest-schema($light-file-input);
6+
$material: digest-schema($material-file-input);
7+
$bootstrap: digest-schema($bootstrap-file-input);
8+
$fluent: digest-schema($fluent-file-input);
9+
$indigo: digest-schema($indigo-file-input);
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@use 'styles/utilities' as *;
2+
@use 'themes' as *;
3+
4+
$theme: $bootstrap;
5+
6+
:host {
7+
@include css-vars-from-theme(diff($base, $theme), 'ig');
8+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@use 'styles/utilities' as *;
2+
@use 'themes' as *;
3+
4+
$theme: $fluent;
5+
6+
:host {
7+
@include css-vars-from-theme(diff($base, $theme), 'ig');
8+
}
9+
10+
:host(:is(igc-file-input)) {
11+
[part~='file-names'] {
12+
color: var(--ig-input-idle-text-color, #000)
13+
}
14+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@use 'styles/utilities' as *;
2+
@use 'themes' as *;
3+
4+
$theme: $indigo;
5+
6+
:host {
7+
@include css-vars-from-theme(diff($base, $theme), 'ig');
8+
}

0 commit comments

Comments
 (0)