Skip to content

Commit 00ee275

Browse files
- remove var usage;
1 parent b3fd9fb commit 00ee275

File tree

1 file changed

+29
-12
lines changed

1 file changed

+29
-12
lines changed

core/src/components/button/button.ionic.scss

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,53 +43,70 @@
4343
// --------------------------------------------------
4444

4545
:host(.button-solid) {
46-
--background-activated: var(--ion-color-shade, #{globals.ion-color(primary, shade)});
47-
--background-hover: var(--ion-color-shade, #{globals.ion-color(primary, shade)});
46+
--background-activated: #{globals.$ion-bg-primary-base-press};
47+
--background-hover: #{globals.$ion-bg-primary-base-press};
4848
--background-focused: transparent;
4949
--background-hover-opacity: 1;
50-
--background: var(--ion-color-base, #{globals.ion-color(primary, base)});
51-
--color: var(--ion-color-contrast, #{globals.ion-color(primary, contrast)});
50+
--background: #{globals.ion-color(primary, base)};
51+
--color: #{globals.ion-color(primary, contrast)};
5252
--ripple-opacity: var(--background-activated-opacity, 1);
5353
--ripple-color: var(--background-activated);
5454
}
5555

56+
:host(.button-solid.ion-color) {
57+
--background-activated: #{globals.current-color(shade)};
58+
--background-hover: #{globals.current-color(shade)};
59+
--background: #{globals.current-color(base)};
60+
--color: #{globals.current-color(contrast)};
61+
}
62+
5663
// Outline Button
5764
// --------------------------------------------------
5865

5966
:host(.button-outline) {
6067
--border-width: #{globals.$ion-border-size-025};
6168
--border-style: #{globals.$ion-border-style-solid};
62-
--background-activated: var(--ion-color-subtle-shade, #{globals.ion-color(primary, shade, $subtle: true)});
69+
--background-activated: #{globals.$ion-bg-primary-subtle-press};
6370
--background-focused: transparent;
64-
--background-hover: var(--ion-color-subtle-shade, #{globals.ion-color(primary, shade, $subtle: true)});
71+
--background-hover: #{globals.$ion-bg-primary-subtle-press};
6572
--background-hover-opacity: 1;
66-
--border-color: var(--ion-color-base, #{globals.ion-color(primary, base)});
67-
--color: var(--ion-color-base, #{globals.ion-color(primary, base)});
73+
--border-color: #{globals.ion-color(primary, base)};
74+
--color: #{globals.ion-color(primary, base)};
6875
--ripple-opacity: var(--background-activated-opacity, 1);
6976
--ripple-color: var(--background-activated);
7077
}
7178

79+
:host(.button-outline.ion-color) {
80+
--background-activated: #{globals.current-color(shade, $subtle: true)};
81+
--background-hover: #{globals.current-color(shade, $subtle: true)};
82+
--border-color: #{globals.current-color(base)};
83+
--color: #{globals.current-color(base)};
84+
}
85+
7286
// Warning Outline Button - use foreground color for text and border
7387
:host(.button-outline.ion-color-warning) .button-native {
74-
--ion-color-base: var(--ion-color-warning-foreground);
88+
--ion-color-base: #{globals.ion-color(warning, foreground)};
7589
}
7690

7791
// Clear Button
7892
// --------------------------------------------------
7993

8094
:host(.button-clear) {
81-
--background-activated: var(--ion-color-subtle-shade, #{globals.ion-color(primary, shade, $subtle: true)});
95+
--background-activated: #{globals.$ion-bg-primary-subtle-press};
8296
--background-focused: transparent;
83-
--background-hover: var(--ion-color-subtle-shade, #{globals.ion-color(primary, shade, $subtle: true)});
97+
--background-hover: #{globals.$ion-bg-primary-subtle-press};
8498
--background-hover-opacity: 1;
8599
--color: #{globals.ion-color(primary, foreground)};
86100
--ripple-opacity: var(--background-activated-opacity, 1);
87101
--ripple-color: var(--background-activated);
88102
}
89103

90104
:host(.button-clear.ion-color) {
105+
--background-activated: #{globals.current-color(shade, $subtle: true)};
106+
--background-hover: #{globals.current-color(shade, $subtle: true)};
107+
91108
.button-native {
92-
--ion-color-base: var(--ion-color-foreground, #{globals.current-color(foreground)});
109+
--ion-color-base: #{globals.current-color(foreground)};
93110
}
94111
}
95112

0 commit comments

Comments
 (0)