Skip to content

Commit fe18f99

Browse files
JoaoFerreira-FrontEndIonitronthetaPC
authored
fix(button): update colors for ionic theme (#30764)
Issue number: internal --------- ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - fix outline and clear colors and ripple-effect; ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change: 1. Describe the impact and migration path for existing applications below. 2. Update the BREAKING.md file with the breaking change. 3. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer for more information. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> [clear](https://ionic-framework-git-rou-12076-ionic1.vercel.app/src/components/button/test/clear?ionic:theme=ionic) [outline](https://ionic-framework-git-rou-12076-ionic1.vercel.app/src/components/button/test/outline?ionic:theme=ionic) [test theme](https://ionic-framework-git-rou-12076-ionic1.vercel.app/src/components/button/test/theme-ionic?ionic:theme=ionic) --------- Co-authored-by: ionitron <hi@ionicframework.com> Co-authored-by: Maria Hutt <thetaPC@users.noreply.github.com> Co-authored-by: Maria Hutt <maria.hutt@outsystems.com>
1 parent 0361bf0 commit fe18f99

20 files changed

+27
-7
lines changed

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

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,23 +59,30 @@
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: #{globals.ion-color(primary, shade, $subtle: true)};
6363
--background-focused: transparent;
64-
--background-hover: #{globals.$ion-bg-neutral-subtlest-press};
64+
--background-hover: #{globals.ion-color(primary, shade, $subtle: true)};
6565
--background-hover-opacity: 1;
6666
--border-color: #{globals.ion-color(primary, base)};
6767
--color: #{globals.ion-color(primary, base)};
6868
--ripple-opacity: var(--background-activated-opacity, 1);
6969
--ripple-color: var(--background-activated);
7070
}
7171

72+
// Warning Outline Button - use foreground color for text and border
73+
:host(.button-outline.ion-color-warning) .button-native {
74+
border-color: globals.ion-color(warning, foreground);
75+
76+
color: globals.ion-color(warning, foreground);
77+
}
78+
7279
// Clear Button
7380
// --------------------------------------------------
7481

7582
:host(.button-clear) {
76-
--background-activated: #{globals.$ion-bg-neutral-subtlest-press};
83+
--background-activated: #{globals.ion-color(primary, shade, $subtle: true)};
7784
--background-focused: transparent;
78-
--background-hover: #{globals.$ion-bg-neutral-subtlest-press};
85+
--background-hover: #{globals.ion-color(primary, shade, $subtle: true)};
7986
--background-hover-opacity: 1;
8087
--color: #{globals.ion-color(primary, foreground)};
8188
--ripple-opacity: var(--background-activated-opacity, 1);
@@ -91,7 +98,7 @@
9198

9299
:host(.button-outline.ion-color) ion-ripple-effect,
93100
:host(.button-clear.ion-color) ion-ripple-effect {
94-
color: globals.$ion-primitives-neutral-200;
101+
color: globals.current-color(shade, $subtle: true);
95102
}
96103

97104
// Button Sizes
@@ -211,8 +218,15 @@
211218
background: globals.current-color(shade);
212219
}
213220

221+
:host(.button-outline.ion-color.ion-activated) .button-native::after,
222+
:host(.button-clear.ion-color.ion-activated) .button-native::after {
223+
background: globals.current-color(shade, $subtle: true);
224+
}
225+
214226
:host(.ion-activated) .button-native:has(ion-ripple-effect)::after,
215-
:host(.button-solid.ion-color.ion-activated) .button-native:has(ion-ripple-effect)::after {
227+
:host(.button-solid.ion-color.ion-activated) .button-native:has(ion-ripple-effect)::after,
228+
:host(.button-outline.ion-color.ion-activated) .button-native:has(ion-ripple-effect)::after,
229+
:host(.button-clear.ion-color.ion-activated) .button-native:has(ion-ripple-effect)::after {
216230
background: transparent;
217231
}
218232

@@ -223,6 +237,11 @@
223237
:host(.button-solid.ion-color:hover) .button-native::after {
224238
background: globals.current-color(shade);
225239
}
240+
241+
:host(.button-outline.ion-color:hover) .button-native::after,
242+
:host(.button-clear.ion-color:hover) .button-native::after {
243+
background: globals.current-color(shade, $subtle: true);
244+
}
226245
}
227246

228247
// Button: Disabled
618 Bytes
Loading
3.79 KB
Loading
2.16 KB
Loading
-159 Bytes
Loading
2.15 KB
Loading
4.65 KB
Loading
30 Bytes
Loading
2.33 KB
Loading
4.77 KB
Loading

0 commit comments

Comments
 (0)