Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ ion-badge,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secon
ion-badge,prop,hue,"bold" | "subtle" | undefined,undefined,false,false
ion-badge,prop,mode,"ios" | "md",undefined,false,false
ion-badge,prop,shape,"round | rectangular" | "soft" | undefined,undefined,false,false
ion-badge,prop,size,"large" | "medium" | "small" | "xlarge" | "xsmall" | "xxsmall" | undefined,undefined,false,false
ion-badge,prop,size,"large" | "medium" | "small" | undefined,undefined,false,false
ion-badge,prop,theme,"ios" | "md" | "ionic",undefined,false,false
ion-badge,prop,vertical,"bottom" | "top" | undefined,undefined,false,false
ion-badge,css-prop,--background,ionic
Expand Down
8 changes: 4 additions & 4 deletions core/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,9 +442,9 @@ export namespace Components {
*/
"shape"?: 'soft' | 'round | rectangular';
/**
* Set to `"xxsmall"` for the smallest badge. Set to "xsmall" for a very small badge. Set to `"small"` for a small badge. Set to "medium" for a medium badge. Set to "large" for a large badge. Set to `"xlarge"` for the largest badge. Defaults to `"small"` for the `ionic` theme, undefined for all other themes.
* Set to `"small"` for a small badge. Set to `"medium"` for a medium badge. Set to `"large"` for a large badge, when it is empty (no text or icon). Defaults to `"small"` for the `ionic` theme, undefined for all other themes.
*/
"size"?: 'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
"size"?: 'small' | 'medium' | 'large';
/**
* The theme determines the visual appearance of the component.
*/
Expand Down Expand Up @@ -5899,9 +5899,9 @@ declare namespace LocalJSX {
*/
"shape"?: 'soft' | 'round | rectangular';
/**
* Set to `"xxsmall"` for the smallest badge. Set to "xsmall" for a very small badge. Set to `"small"` for a small badge. Set to "medium" for a medium badge. Set to "large" for a large badge. Set to `"xlarge"` for the largest badge. Defaults to `"small"` for the `ionic` theme, undefined for all other themes.
* Set to `"small"` for a small badge. Set to `"medium"` for a medium badge. Set to `"large"` for a large badge, when it is empty (no text or icon). Defaults to `"small"` for the `ionic` theme, undefined for all other themes.
*/
"size"?: 'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
"size"?: 'small' | 'medium' | 'large';
/**
* The theme determines the visual appearance of the component.
*/
Expand Down
82 changes: 12 additions & 70 deletions core/src/components/badge/badge.ionic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@
@include globals.border-radius(globals.$ion-border-radius-200);
}

:host(.badge-xxsmall.badge-soft),
:host(.badge-xsmall.badge-soft),
:host(.badge-small.badge-soft) {
@include globals.border-radius(globals.$ion-border-radius-100);
}
Expand All @@ -73,90 +71,37 @@
// Badge Sizes
// --------------------------------------------------

/* 2-Extra Small Badge */
:host(.badge-xxsmall) {
/* Small Badge */
:host(.badge-small) {
--padding-start: #{globals.$ion-space-050};
--padding-end: #{globals.$ion-space-050};

min-width: globals.$ion-scale-400;
height: globals.$ion-scale-400;

font-size: globals.$ion-font-size-300;

line-height: globals.$ion-font-line-height-400;
}

:host(.badge-xxsmall) ::slotted(ion-icon) {
:host(.badge-small) ::slotted(ion-icon) {
width: globals.$ion-scale-300;
height: globals.$ion-scale-300;
}

/* Extra Small Badge */
:host(.badge-xsmall) {
--padding-start: #{globals.$ion-space-100};
--padding-end: #{globals.$ion-space-100};

min-width: globals.$ion-scale-600;
height: globals.$ion-scale-600;

font-size: globals.$ion-font-size-350;

line-height: globals.$ion-font-line-height-600;
}

:host(.badge-xsmall) ::slotted(ion-icon) {
width: globals.$ion-scale-400;
height: globals.$ion-scale-400;
}

/* Small Badge */
:host(.badge-small) {
/* Medium Badge */
/* Large size defaults to the medium size to avoid styles breakage */
:host(.badge-medium),
:host(.badge-large) {
--padding-start: #{globals.$ion-space-100};
--padding-end: #{globals.$ion-space-100};

min-width: globals.$ion-scale-800;
height: globals.$ion-scale-800;
}

:host(.badge-small) ::slotted(ion-icon) {
width: globals.$ion-scale-500;
height: globals.$ion-scale-500;
}

/* Medium Badge */
:host(.badge-medium) {
@include globals.typography(globals.$ion-body-md-medium);
min-width: globals.$ion-scale-1000;
height: globals.$ion-scale-1000;
}

:host(.badge-medium) ::slotted(ion-icon) {
width: globals.$ion-scale-600;
min-width: globals.$ion-scale-600;
height: globals.$ion-scale-600;
}

/* Large Badge */
:host(.badge-large) {
@include globals.typography(globals.$ion-body-lg-medium);
min-width: globals.$ion-scale-1200;
height: globals.$ion-scale-1200;
}

:host(.badge-medium) ::slotted(ion-icon),
:host(.badge-large) ::slotted(ion-icon) {
width: globals.$ion-scale-800;
height: globals.$ion-scale-800;
}

/* Extra Large Badge */
:host(.badge-xlarge) {
@include globals.typography(globals.$ion-heading-h4-medium);
min-width: globals.$ion-scale-1400;
height: globals.$ion-scale-1400;
}

:host(.badge-xlarge) ::slotted(ion-icon) {
width: globals.$ion-scale-1000;
height: globals.$ion-scale-1000;
width: globals.$ion-scale-400;
height: globals.$ion-scale-400;
}

// Badge (hint)
Expand Down Expand Up @@ -215,15 +160,12 @@
// Badge in Button
// --------------------------------------------------

:host([vertical]:not(.in-tab-button).in-button.badge-xxsmall),
:host([vertical]:not(.in-tab-button).in-button.badge-xsmall),
:host([vertical]:not(.in-tab-button).in-button.badge-small) {
@include globals.position(null, calc(-1 * var(globals.$ion-space-050)));
}

:host([vertical]:not(.in-tab-button).in-button.badge-medium),
:host([vertical]:not(.in-tab-button).in-button.badge-large),
:host([vertical]:not(.in-tab-button).in-button.badge-xlarge) {
:host([vertical]:not(.in-tab-button).in-button.badge-large) {
@include globals.position(null, globals.$ion-space-050);
}

Expand Down
9 changes: 3 additions & 6 deletions core/src/components/badge/badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,13 @@ export class Badge implements ComponentInterface {
@Prop() shape?: 'soft' | 'round | rectangular';

/**
* Set to `"xxsmall"` for the smallest badge.
* Set to "xsmall" for a very small badge.
* Set to `"small"` for a small badge.
* Set to "medium" for a medium badge.
* Set to "large" for a large badge.
* Set to `"xlarge"` for the largest badge.
* Set to `"medium"` for a medium badge.
* Set to `"large"` for a large badge, when it is empty (no text or icon).
*
* Defaults to `"small"` for the `ionic` theme, undefined for all other themes.
*/
@Prop() size?: 'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
@Prop() size?: 'small' | 'medium' | 'large';

/**
* Set to `"top"` to position the badge on top right absolute position of the parent element.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading