Skip to content

Commit 427dce0

Browse files
- fix outline and clear colors and ripple-effect;
1 parent 183a90a commit 427dce0

File tree

2 files changed

+27
-9
lines changed

2 files changed

+27
-9
lines changed

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

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,39 +59,56 @@
5959
:host(.button-outline) {
6060
--border-width: #{globals.$ion-border-size-025};
6161
--border-style: #{globals.$ion-border-style-solid};
62-
--background-activated: #{globals.$ion-bg-neutral-subtlest-press};
62+
--background-activated: var(--ion-color-subtle-shade, #{globals.current-color(shade, $subtle: true)});
6363
--background-focused: transparent;
64-
--background-hover: #{globals.$ion-bg-neutral-subtlest-press};
64+
--background-hover: var(--ion-color-subtle-shade, #{globals.current-color(shade, $subtle: true)});
6565
--background-hover-opacity: 1;
66-
--border-color: #{globals.ion-color(primary, base)};
67-
--color: #{globals.ion-color(primary, base)};
66+
--border-color: var(--ion-color-base, #{globals.ion-color(primary, base)});
67+
--color: var(--ion-color-base, #{globals.ion-color(primary, base)});
6868
--ripple-opacity: var(--background-activated-opacity, 1);
6969
--ripple-color: var(--background-activated);
7070
}
7171

72+
// Provide fallbacks for ion-color-base for all colors
73+
:host(.button-outline.ion-color.ion-color-warning){
74+
.button-native {
75+
--ion-color-base: #{globals.$ion-text-warning};
76+
}
77+
ion-ripple-effect {
78+
--ion-color-base: var(--ion-color-base, #{globals.current-color(shade, $subtle: true)});
79+
}
80+
}
81+
82+
7283
// Clear Button
7384
// --------------------------------------------------
7485

7586
:host(.button-clear) {
76-
--background-activated: #{globals.$ion-bg-neutral-subtlest-press};
87+
--background-activated: var(--ion-color-subtle-shade, #{globals.current-color( shade, $subtle: true)});
7788
--background-focused: transparent;
78-
--background-hover: #{globals.$ion-bg-neutral-subtlest-press};
89+
--background-hover: var(--ion-color-subtle-shade, #{globals.current-color( shade, $subtle: true)});
7990
--background-hover-opacity: 1;
8091
--color: #{globals.ion-color(primary, foreground)};
8192
--ripple-opacity: var(--background-activated-opacity, 1);
8293
--ripple-color: var(--background-activated);
8394
}
8495

96+
:host(.button-clear.ion-color) {
97+
.button-native {
98+
--ion-color-base: var(--ion-color-foreground, #{globals.current-color(foreground)});
99+
}
100+
}
101+
85102
// Ripple Effect
86103
// -------------------------------------------------------------------------------
87104

88105
:host(.button-solid.ion-color) ion-ripple-effect {
89-
color: globals.current-color(shade);
106+
color: var(--ion-color-shade, #{globals.ion-color(primary, shade)});
90107
}
91108

92109
:host(.button-outline.ion-color) ion-ripple-effect,
93110
:host(.button-clear.ion-color) ion-ripple-effect {
94-
color: globals.$ion-primitives-neutral-200;
111+
color: var(--ion-color-subtle-shade, #{globals.current-color(shade, $subtle: true)});
95112
}
96113

97114
// Button Sizes

core/src/components/button/test/theme-ionic/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ <h4>Preview options</h4>
5656
<ion-select-option value="primary">Primary</ion-select-option>
5757
<ion-select-option value="success">Success</ion-select-option>
5858
<ion-select-option value="warning">Warning</ion-select-option>
59-
<ion-select-option value="neutral">Neutral</ion-select-option>
59+
<ion-select-option value="medium">Medium</ion-select-option>
60+
<ion-select-option value="danger">Danger</ion-select-option>
6061
</ion-select>
6162
</p>
6263

0 commit comments

Comments
 (0)