Skip to content
Open
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
e729dea
feat(chip): add recipe and variables
thetaPC Dec 15, 2025
0d6bd9d
Update core/src/components/chip/chip.tsx
thetaPC Dec 16, 2025
ade5c05
Update core/src/utils/theme.ts
thetaPC Dec 16, 2025
0349ff7
Update core/src/utils/theme.ts
thetaPC Dec 16, 2025
ee81a8a
fix(theme): remove extra curly bracket
thetaPC Dec 16, 2025
c6dfb10
refactor(theme): remove root
thetaPC Dec 16, 2025
e795c61
chore(components): run build
thetaPC Dec 16, 2025
39bfce5
chore(many): run lint
thetaPC Dec 16, 2025
b67f4f5
test(theme): add more generateComponentsThemeCSS tests
thetaPC Dec 16, 2025
9ecb103
Update core/src/themes/mixins.scss
thetaPC Dec 16, 2025
7040091
refactor(theme): seperate objects
thetaPC Dec 16, 2025
098cba4
feat(chip): adding ionic theme
thetaPC Dec 18, 2025
55b610a
feat(themes): add ionic
thetaPC Jan 9, 2026
918582b
refactor(themes): optimize chip recipe
thetaPC Jan 12, 2026
3e5236c
refactor(chip): remove majority usage of Sass vars
thetaPC Jan 12, 2026
b90fe18
feat(theme): add ios recipe
thetaPC Jan 12, 2026
2f71c0a
feat(themes): add styles
thetaPC Jan 13, 2026
32c7471
docs(chip): update prop comments
thetaPC Jan 13, 2026
da0a9a6
test(chip): update shape snapshots
thetaPC Jan 13, 2026
28d61aa
test(chip): update size snapshots
thetaPC Jan 13, 2026
d616dee
fix(chip): use correct variable
thetaPC Jan 13, 2026
2c9b1f1
test(chip): update hue snapshots
thetaPC Jan 13, 2026
d830d48
test(chip): update states snapshots
thetaPC Jan 13, 2026
68a19fd
feat(theme): add outline semantic for ios
thetaPC Jan 13, 2026
fdaafcd
test(chip): update basic snapshots
thetaPC Jan 13, 2026
c07ef36
test(chip): update a11y snapshots
thetaPC Jan 14, 2026
b419a9c
test(chip): update size snapshots
thetaPC Jan 14, 2026
3111d64
test(chip): update hue snapshots
thetaPC Jan 14, 2026
0db9f57
chore(chip): run lint
thetaPC Jan 14, 2026
ef79c8d
feat(themes): update subtle values for ios and md chip
thetaPC Jan 14, 2026
626bace
refactor(themes): update chip icon and avatar keys
thetaPC Jan 14, 2026
92edc69
chore(themes): improve chip styles
thetaPC Jan 15, 2026
beaf349
refactor(themes): use minHeight instead
thetaPC Jan 15, 2026
4dd7e23
refactor(chip): move typography to base
thetaPC Jan 15, 2026
61dce8e
docs(theme): add comments for utils
thetaPC Jan 15, 2026
e36b9bb
docs(themes): add comments for the avatar and icon
thetaPC Jan 15, 2026
94b9288
refactor(themes): round values
thetaPC Jan 15, 2026
98bf385
test(chip): update snapshots
thetaPC Jan 15, 2026
401ef1f
refactor(theme): use variables
thetaPC Jan 15, 2026
683093d
chore(core): run build
thetaPC Jan 15, 2026
ee18ef3
feat(themes): remove themes from chip logic
thetaPC Jan 15, 2026
cf6a2fd
Merge branch 'ionic-modular' of github.com:ionic-team/ionic-framework…
thetaPC Jan 15, 2026
c680ee2
feat(chip): add cursor
thetaPC Jan 15, 2026
95aeea4
test(avatar): update chip snapshots
thetaPC Jan 15, 2026
6ae28ab
feat(theme): use native colors for ionic
thetaPC Jan 16, 2026
fd0f67f
feat(themes): use native colors for ionic
thetaPC Jan 16, 2026
66fd3f3
refactor(themes): use variables for ionic
thetaPC Jan 16, 2026
ce86297
feat(themes): remove typography key
thetaPC Jan 17, 2026
85989fc
feat(themes): remove colors object
thetaPC Jan 17, 2026
f425a07
refactor(chip): move type to component dir
thetaPC Jan 17, 2026
d927c57
chore(chip): remove unused files
thetaPC Jan 17, 2026
a710962
chore(chip): remove theme test file
thetaPC Jan 17, 2026
83c948e
chore(chip): update interfaces
thetaPC Jan 19, 2026
81ec32f
chore(chip): cleanup
thetaPC Jan 20, 2026
36301c8
feat(ionic): update default chip colors
thetaPC Jan 24, 2026
67b6342
refactor(chip): change file name
thetaPC Jan 24, 2026
f2bf154
test(chip): update snapshots for default color
thetaPC Jan 24, 2026
7b37035
feat(chip): add component level config
thetaPC Jan 26, 2026
f462318
test(chip): update snapshots
thetaPC Jan 26, 2026
018b259
test(avatar): update chip snapshots
thetaPC Jan 26, 2026
04377ad
test(chip): update snapshots
thetaPC Jan 26, 2026
b1737f0
refactor(chip): remove initial value styles
thetaPC Jan 26, 2026
2529db8
refactor(chip): switch to bg
thetaPC Jan 26, 2026
07e1cf3
test(chip): update to use new bg variable
thetaPC Jan 27, 2026
efd95f0
refactor(chip): use bg instead
thetaPC Jan 27, 2026
9f6383c
test(scripts): update to use configs within Playwright
thetaPC Jan 28, 2026
369492e
refactor(chip): use getters
thetaPC Jan 28, 2026
294ab5b
feat(themes): add components key to custom config
thetaPC Jan 28, 2026
b5686f3
Merge branch 'ionic-modular' of github.com:ionic-team/ionic-framework…
thetaPC Jan 28, 2026
e1b12d1
refactor(themes, chip): cleanup
thetaPC Jan 28, 2026
e28b7a1
feat(chip): add fill prop
thetaPC Jan 28, 2026
2b93e77
feat(chip): add prop names to classes
thetaPC Jan 28, 2026
8524e2c
test(chip): update custom state
thetaPC Jan 29, 2026
5bb8352
feat(chip): increase alpha for subtle color
thetaPC Jan 29, 2026
ef4f820
refactor(theme): update method name
thetaPC Jan 29, 2026
41b1917
docs(theme): remove old version
thetaPC Jan 29, 2026
145fdb1
refactor(theme): convert all cases to kebab
thetaPC Jan 29, 2026
1e05746
feat(chip): update recipe name
thetaPC Jan 29, 2026
f8f0452
feat(theme): split margin and padding
thetaPC Jan 29, 2026
62cf46b
chore(mixins): remove unused mixin
thetaPC Jan 29, 2026
edb9556
refactor(chip): alphabetize props in render
thetaPC Jan 29, 2026
c84cc73
refactor(chip): split font weight
thetaPC Jan 29, 2026
f772f13
refactor(chip): remove media type
thetaPC Jan 29, 2026
b2e7e0c
feat(chip): make margin optional
thetaPC Jan 29, 2026
b76e23c
feat(chip): make disabled opacity optional
thetaPC Jan 29, 2026
fb7c836
feat(chip): make focus ring color optional
thetaPC Jan 29, 2026
01106c2
feat(chip): make hue optional
thetaPC Jan 29, 2026
056cd6c
feat(theme): add optional keys and update media keys
thetaPC Jan 29, 2026
cb9faaa
feat(chip): add border style and focus ring style
thetaPC Jan 29, 2026
4c21fca
feat(chip): update media leading and trailing
thetaPC Jan 29, 2026
c56f4f8
refactor(chip): use root token as base for font size
thetaPC Jan 29, 2026
861f400
refactor(chip): use one state type
thetaPC Jan 29, 2026
26bedc3
chore(chip): run build
thetaPC Jan 29, 2026
abcc55f
feat(chip): update token structure
thetaPC Jan 31, 2026
48f4e85
test(playwright): pass theme config
thetaPC Feb 3, 2026
c831aae
docs(set-content): add comment
thetaPC Feb 3, 2026
315198b
test(scripts): use existing theme set in page
thetaPC Feb 3, 2026
9a9e4b0
test(chip): update snapshots
thetaPC Feb 3, 2026
2268973
test(chip): update outline color snapshots
thetaPC Feb 3, 2026
df55483
test(chip): update states snapshots
thetaPC Feb 3, 2026
c2aa770
test(chip): revert snapshots
thetaPC Feb 3, 2026
ce80b86
test(avatar): update chip snapshots
thetaPC Feb 3, 2026
c02894e
fix(theme): check for undefined theme
thetaPC Feb 3, 2026
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
3 changes: 2 additions & 1 deletion core/scripts/testing/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,11 @@ const DEFAULT_THEME = 'md';
window.Ionic.config = window.Ionic.config || {};
window.Ionic.config.customTheme = theme;

// Re-apply the global theme
// Re-apply the global theme, needed for Playwright tests
if (window.Ionic.config.get && window.Ionic.config.set) {
const themeModule = await import('/themes/utils/theme.js');
themeModule.applyGlobalTheme(theme);
themeModule.applyComponentsTheme(theme);
}
} catch (error) {
console.error(`Failed to load theme tokens for ${themeName}:`, error);
Expand Down
16 changes: 10 additions & 6 deletions core/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ export namespace Components {
*/
"disabled": boolean;
/**
* Set to `"bold"` for a chip with vibrant, bold colors or to `"subtle"` for a chip with muted, subtle colors. Only applies to the `ionic` theme.
* Set to `"bold"` for a chip with vibrant, bold colors or to `"subtle"` for a chip with muted, subtle colors. Defaults to `"subtle"`.
* @default 'subtle'
*/
"hue"?: 'bold' | 'subtle';
Expand All @@ -886,11 +886,13 @@ export namespace Components {
*/
"outline": boolean;
/**
* Set to `"soft"` for a chip with slightly rounded corners, `"round"` for a chip with fully rounded corners, or `"rectangular"` for a chip without rounded corners. Defaults to `"round"` for the `"ionic"` theme and `"soft"` for all other themes.
* Set to `"soft"` for a chip with slightly rounded corners, `"round"` for a chip with fully rounded corners, or `"rectangular"` for a chip without rounded corners. Defaults to `"round"`.
* @default 'round'
*/
"shape"?: 'soft' | 'round' | 'rectangular';
/**
* Set to `"small"` for a chip with less height and padding. Defaults to `"large"` for the ionic theme, and undefined for all other themes.
* Set to `"small"` for a chip with less height and padding. Defaults to `"large"`.
* @default 'large'
*/
"size"?: 'small' | 'large';
/**
Expand Down Expand Up @@ -6842,7 +6844,7 @@ declare namespace LocalJSX {
*/
"disabled"?: boolean;
/**
* Set to `"bold"` for a chip with vibrant, bold colors or to `"subtle"` for a chip with muted, subtle colors. Only applies to the `ionic` theme.
* Set to `"bold"` for a chip with vibrant, bold colors or to `"subtle"` for a chip with muted, subtle colors. Defaults to `"subtle"`.
* @default 'subtle'
*/
"hue"?: 'bold' | 'subtle';
Expand All @@ -6856,11 +6858,13 @@ declare namespace LocalJSX {
*/
"outline"?: boolean;
/**
* Set to `"soft"` for a chip with slightly rounded corners, `"round"` for a chip with fully rounded corners, or `"rectangular"` for a chip without rounded corners. Defaults to `"round"` for the `"ionic"` theme and `"soft"` for all other themes.
* Set to `"soft"` for a chip with slightly rounded corners, `"round"` for a chip with fully rounded corners, or `"rectangular"` for a chip without rounded corners. Defaults to `"round"`.
* @default 'round'
*/
"shape"?: 'soft' | 'round' | 'rectangular';
/**
* Set to `"small"` for a chip with less height and padding. Defaults to `"large"` for the ionic theme, and undefined for all other themes.
* Set to `"small"` for a chip with less height and padding. Defaults to `"large"`.
* @default 'large'
*/
"size"?: 'small' | 'large';
/**
Expand Down
260 changes: 260 additions & 0 deletions core/src/components/chip/chip.base.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,260 @@
@use "../../themes/mixins" as mixins;
@use "../../themes/functions.color" as colors;
@use "./chip.base.vars.scss" as vars;
@use "sass:meta";

// Chip: Common Styles
// --------------------------------------------------

:host {
/**
* @prop --background: Background of the chip
* @prop --border-radius: Border radius of the chip
* @prop --color: Color of the chip
* @prop --focus-ring-color: Color of the focus ring
* @prop --focus-ring-width: Width of the focus ring
*/
--focus-ring-color: var(--ion-chip-state-focus-ring-color);
--focus-ring-width: var(--ion-chip-state-focus-ring-width);

@include mixins.font-smoothing();
@include mixins.border-radius(var(--border-radius));
@include mixins.margin(var(--ion-chip-margin));
@include mixins.padding(var(--ion-chip-padding-vertical), var(--ion-chip-padding-horizontal));
@include mixins.typography(vars.$chip-typography);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The font family for chip on ionic-modular and this branch do not match when it comes to the ionic theme. The ionic theme uses ion-body-sm-medium to set the typography for chip. This variable includes font family with the value of -apple-system, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol". This is exactly what is being rendered on this branch. However, the ionic-modular renders it with a value of var(--ion-font-family, inherit). Based on my investigation, ionic-modular and next are not loading the correct font family. This branch fixes it.


display: inline-flex;
position: relative;

align-items: center;
justify-content: center;

background: var(--background);
color: var(--color);

line-height: var(--ion-chip-line-height);

cursor: pointer;
overflow: hidden;
vertical-align: middle;
box-sizing: border-box;

gap: var(--ion-chip-gap);
}

// Chip Sizes
// ---------------------------------------------

:host(.chip-small) {
min-height: var(--ion-chip-size-small-height);

font-size: var(--ion-chip-size-small-font-size);
}

:host(.chip-large) {
min-height: var(--ion-chip-size-large-height);

font-size: var(--ion-chip-size-large-font-size);
}

// Chip Shapes
// ---------------------------------------------

:host(.chip-soft) {
--border-radius: var(--ion-chip-shape-soft-border-radius);
}

:host(.chip-round) {
--border-radius: var(--ion-chip-shape-round-border-radius);
}

:host(.chip-rectangular) {
--border-radius: var(--ion-chip-shape-rectangular-border-radius);
}

// Chip Hues
// ---------------------------------------------

// Bold
:host(.chip-bold) {
--background: var(--ion-chip-hue-bold-bg);
--color: var(--ion-chip-hue-bold-color);
}

:host(.chip-bold.chip-outline) {
border-color: var(--ion-chip-variant-outline-border-color-bold);
}

// Subtle
:host(.chip-subtle) {
--background: var(--ion-chip-hue-subtle-bg);
--color: var(--ion-chip-hue-subtle-color);
}

:host(.chip-subtle.chip-outline) {
border-color: var(--ion-chip-variant-outline-border-color-subtle);
}

// Chip Colors
// ---------------------------------------------

// Bold
:host(.ion-color.chip-bold) {
background: var(--ion-chip-hue-bold-semantic-bg);
color: var(--ion-chip-hue-bold-semantic-color);
}

:host(.ion-color.chip-bold.chip-outline) {
border-color: var(--ion-chip-variant-outline-semantic-border-color-bold);
}

// Subtle
:host(.ion-color.chip-subtle) {
background: colors.current-color(base, $subtle: true); // always the same regardless of theme
color: colors.current-color(contrast, $subtle: true); // always the same regardless of theme
}

:host(.ion-color.chip-subtle.chip-outline) {
border-color: var(--ion-chip-variant-outline-semantic-border-color-subtle);
}

// Outline Chip
// ---------------------------------------------

:host(.chip-outline) {
border-width: var(--ion-chip-variant-outline-border-width);
border-style: solid;

background: var(--ion-chip-variant-outline-bg, var(--background));
}

:host(.chip-outline.ion-color.chip-bold) {
background: var(--ion-chip-variant-outline-bg, var(--ion-chip-hue-bold-semantic-bg));
}

:host(.chip-outline.ion-color.chip-subtle) {
background: var(--ion-chip-variant-outline-bg, colors.current-color(base, $subtle: true));
}

// Chip States
// ---------------------------------------------

// Disabled
:host(.chip-disabled) {
cursor: default;
opacity: var(--ion-chip-state-disabled-opacity);
pointer-events: none;
}

// Focus
:host(.ion-focused) {
@include mixins.focused-state(var(--focus-ring-width), $color: var(--focus-ring-color));
}

:host(.ion-focused.chip-bold) {
--background: var(--ion-chip-state-focus-bg, var(--ion-chip-hue-bold-bg));
}

:host(.ion-focused.chip-subtle) {
--background: var(--ion-chip-state-focus-bg, var(--ion-chip-hue-subtle-bg));
}

:host(.ion-focused.ion-color.chip-bold) {
background: var(--ion-chip-hue-bold-semantic-state-focus-bg, var(--ion-chip-hue-bold-semantic-bg));
}

:host(.ion-focused.ion-color.chip-subtle) {
background: var(--ion-chip-hue-subtle-semantic-state-focus-bg, colors.current-color(base, $subtle: true));
}

:host(.ion-focused.chip-outline.chip-bold:not(.ion-color)) {
background: var(--ion-chip-variant-outline-state-focus-bg-bold, var(--ion-chip-hue-bold-bg));
}

:host(.ion-focused.chip-outline.chip-subtle:not(.ion-color)) {
background: var(--ion-chip-variant-outline-state-focus-bg-subtle, var(--ion-chip-hue-subtle-bg));
}

// Activated
:host(.ion-activated) {
--background: var(--ion-chip-state-activated-bg);
}

:host(.ion-activated.ion-color) {
background: var(--ion-chip-state-activated-semantic-bg);
}

// Hover
@media (any-hover: hover) {
:host(.chip-bold:hover) {
--background: var(--ion-chip-state-hover-bg, var(--ion-chip-hue-bold-bg));
}

:host(.chip-subtle:hover) {
--background: var(--ion-chip-state-hover-bg, var(--ion-chip-hue-subtle-bg));
}

:host(.chip-bold.ion-color:hover) {
background: var(--ion-chip-hue-bold-semantic-state-hover-bg, var(--ion-chip-hue-bold-semantic-bg));
}

:host(.chip-subtle.ion-color:hover) {
background: var(--ion-chip-hue-subtle-semantic-state-hover-bg, var(--ion-chip-hue-subtle-semantic-bg));
}

:host(.chip-outline.chip-bold:not(.ion-color):hover) {
background: var(--ion-chip-variant-outline-state-hover-bg-bold, var(--background));
}

:host(.chip-outline.chip-subtle:not(.ion-color):hover) {
background: var(--ion-chip-variant-outline-state-hover-bg-subtle, var(--background));
}
}

// Chip Slotted Elements
// ---------------------------------------------

// Icon
::slotted(ion-icon) {
font-size: var(--ion-chip-icon-size);
}

:host(:not(.ion-color)) ::slotted(ion-icon) {
color: var(--ion-chip-icon-color);
}

::slotted(ion-icon:first-child) {
@include mixins.margin(
var(--ion-chip-icon-first-child-margin),
var(--ion-chip-icon-first-child-margin-end),
$start: var(--ion-chip-icon-first-child-margin)
);
}

::slotted(ion-icon:last-child) {
@include mixins.margin(var(--ion-chip-icon-last-child-margin), $start: var(--ion-chip-icon-last-child-margin-start));
}

// Avatar
::slotted(ion-avatar) {
flex-shrink: 0;

width: var(--ion-chip-avatar-size, revert-layer);
height: var(--ion-chip-avatar-size, revert-layer);
}

::slotted(ion-avatar:first-child) {
@include mixins.margin(
var(--ion-chip-avatar-first-child-margin-vertical),
$end: var(--ion-chip-avatar-first-child-margin-end),
$start: var(--ion-chip-avatar-first-child-margin-start)
);
}

::slotted(ion-avatar:last-child) {
@include mixins.margin(
var(--ion-chip-avatar-last-child-margin-vertical),
$end: var(--ion-chip-avatar-last-child-margin-end),
$start: var(--ion-chip-avatar-last-child-margin-start)
);
}
15 changes: 15 additions & 0 deletions core/src/components/chip/chip.base.vars.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@use "../../themes/functions.color" as colors;

/// Chip Variables
/// ---------------------------------------------

/// @prop - Typography styles for the chip
$chip-typography: (
font-family: var(--ion-chip-typography-font-family),
font-size: var(--ion-chip-typography-font-size),
font-weight: var(--ion-chip-typography-font-weight),
letter-spacing: var(--ion-chip-typography-letter-spacing),
line-height: var(--ion-chip-typography-line-height),
text-decoration: var(--ion-chip-typography-text-decoration),
text-transform: var(--ion-chip-typography-text-transform),
);
Loading
Loading