Skip to content

Conversation

@OS-pedrolourenco
Copy link
Contributor

Issue number: internal


What is the current behavior?

The ion-badge is not currently supported when inside the ion-button.

What is the new behavior?

  • The experience of the ion-badge inside the ion-button has been implemented according to our designs.

Does this introduce a breaking change?

  • Yes
  • No

Other information

joselrio added 30 commits March 13, 2025 12:32
Comment on lines 314 to 327
.button-native {
overflow: visible;

ion-ripple-effect {
// stylelint-disable-next-line property-disallowed-list
border-radius: inherit;
}

&::after {
// stylelint-disable-next-line property-disallowed-list
border-radius: inherit;
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After thinking it more, it would be best to revert it to what you had but some changes. Make sure to revert the snapshots as well.

Suggested change
.button-native {
overflow: visible;
ion-ripple-effect {
// stylelint-disable-next-line property-disallowed-list
border-radius: inherit;
}
&::after {
// stylelint-disable-next-line property-disallowed-list
border-radius: inherit;
}
}
.button-native {
ion-ripple-effect {
// stylelint-disable-next-line property-disallowed-list
border-radius: inherit;
}
&::after {
// stylelint-disable-next-line property-disallowed-list
border-radius: inherit;
}
}
// This rule works for Chrome.
:has(ion-badge) .button-native,
// This rule works for the rest of the browsers.
:host(:has(ion-badge)) .button-native {
--overflow: visible;
}

# Conflicts:
#	core/src/components/badge/badge.common.scss
Comment on lines +319 to +325
// This rule works for Chrome.
:has(ion-badge) .button-native {
--overflow: visible;
}

// This rule works for the rest of the browsers.
:host(:has(ion-badge)) .button-native {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// This rule works for Chrome.
:has(ion-badge) .button-native {
--overflow: visible;
}
// This rule works for the rest of the browsers.
:host(:has(ion-badge)) .button-native {
// This rule works for Chrome.
:has(ion-badge) .button-native,
// This rule works for the rest of the browsers.
:host(:has(ion-badge)) .button-native {

Copy link
Contributor

@thetaPC thetaPC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gnbm gnbm requested a review from BenOsodrac March 28, 2025 21:54
// Badge in Button
// --------------------------------------------------

:host(:not(:empty).in-button) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This CSS should be moved to badge.native.scss, along with the vars to badge.native.vars.scss.
Then this css should be repeated on ionic.theme.scss but using the design tokens directly.

This way, wee keep the consistency with the scss architecture of other patterns, between design systems, and if in the future the tokens change values, we won't need to manually change this CSS for the Ionic Theme.

@OS-pedrolourenco OS-pedrolourenco merged commit 8c4bf8b into next Mar 31, 2025
48 checks passed
@OS-pedrolourenco OS-pedrolourenco deleted the ROU-11612 branch March 31, 2025 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants