Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(many): remove *.ionic.vars files #29983

Merged
merged 7 commits into from
Nov 1, 2024

Conversation

brandyscarney
Copy link
Member

Issue number: internal


What is the current behavior?

Some components have component.ionic.vars.scss files defined for the Ionic theme.

What is the new behavior?

  • Removes the *.ionic.vars.scss files for item, list and input and uses the design tokens directly
  • Removes the tab-bar.ionic.vars.scss file and moves the variables to the default ionic theme file since this uses global css variables

Does this introduce a breaking change?

  • Yes
  • No

Copy link

vercel bot commented Oct 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ionic-framework ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 2:45pm

@github-actions github-actions bot added the package: core @ionic/core package label Oct 30, 2024
@brandyscarney brandyscarney changed the title refactor(many) remove *.ionic.vars files refactor(many): remove *.ionic.vars files Oct 30, 2024
Copy link
Contributor

@BenOsodrac BenOsodrac left a comment

Choose a reason for hiding this comment

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

💙

Comment on lines +97 to +102
$tabbar-ionic-background: var(--ion-tab-bar-background, globals.$ion-primitives-base-white);
$tabbar-ionic-background-activated: var(--ion-tab-bar-background-activated, globals.$ion-primitives-neutral-100);
$tabbar-ionic-background-focused: var(--ion-tab-bar-background-focused, transparent);
$tabbar-ionic-color: var(--ion-tab-bar-color, globals.$ion-primitives-neutral-800);
$tabbar-ionic-color-selected: var(--ion-tab-bar-color-selected, globals.$ion-semantics-primary-base);
$tabbar-ionic-border-color: var(--ion-tab-bar-border-color, transparent);
Copy link
Member

Choose a reason for hiding this comment

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

Why are we creating special variables for these instead of just referencing the existing variables like we do for everything else?

Copy link
Member Author

Choose a reason for hiding this comment

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

These are created separately because they use the global application color variables defined here: https://ionicframework.com/docs/theming/themes#application-colors

This matches how ios and md define them:

$tabbar-md-background: var(--ion-tab-bar-background, $background-color);
$tabbar-md-background-focused: var(--ion-tab-bar-background-focused, get-color-shade(#fff));
$tabbar-md-border-color: var(
--ion-tab-bar-border-color,
var(--ion-border-color, var(--ion-color-step-150, var(--ion-background-color-step-150, rgba(0, 0, 0, 0.07))))
);
$tabbar-md-color: var(--ion-tab-bar-color, $text-color-step-350);
$tabbar-md-color-selected: var(--ion-tab-bar-color-selected, ion-color(primary, base));

Ideally we would want to add more of these to the ionic theme to match the available colors offered for toolbar, item, etc.

Copy link
Member

Choose a reason for hiding this comment

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

Gotcha. Thanks for clarifying!

@brandyscarney brandyscarney merged commit 0fbc2b2 into next Nov 1, 2024
46 checks passed
@brandyscarney brandyscarney deleted the refactor-remove-ionic-vars branch November 1, 2024 15:26
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.

4 participants