fix(colors): change ionic colors scss imports for ionic dist (#29791)

Issue number: internal

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->
When consuming the Ionic Framework and using the Ionic Theme, the color
attribute was still not working as the color css was not present.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Now the ion-color maps are correctly imported on the Ionic `dist`
related folder and not the on the `md/ios` ones.
- Changed the usage of `map.get` to `map-get` to avoid issues with the
usage of `@use` and `@forward`. This seems to have no impact on the
compilation and I believe its a better code convention, as map-gets are
a native scss function that doesn't need to be imported.

## 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. -->

---------

Co-authored-by: ionitron <hi@ionicframework.com>
Co-authored-by: Maria Hutt <maria@ionic.io>
This commit is contained in:
Bernardo Cardoso
2024-08-27 08:42:46 +01:00
committed by GitHub
parent b9ef92ae7e
commit aded437923
133 changed files with 42 additions and 23 deletions

View File

@ -1,6 +1,5 @@
@use "sass:map";
@import "../themes/native/native.globals";
@import "../themes/ionic/ionic.theme.default";
@import "../components/menu/menu.ios.vars";
@import "../components/menu/menu.md.vars";
@ -22,21 +21,6 @@
}
}
:root.ionic {
/**
* Set the theme colors from the
* `ionic.theme.default.scss` file.
*/
@include set-theme-colors($ionic-colors);
@include generate-color-variables();
@each $color-name, $value in $ionic-colors {
.ion-color-#{$color-name} {
@include generate-color($color-name);
}
}
}
// Ionic Font Family
// --------------------------------------------------

View File

@ -1,11 +1,24 @@
@use "../../themes/ionic/ionic.globals.scss" as globals;
// Ionic Font
// Ionic Global Styles
// --------------------------------------------------
:root {
--ionic-global-background-color: #{globals.$ionic-color-neutral-100};
--ionic-global-text-color: #{globals.$ionic-color-neutral-900};
/**
* Set the theme colors from the
* `ionic.theme.default.scss` file.
*/
@include globals.set-theme-colors(globals.$ionic-colors);
@include globals.generate-color-variables();
@each $color-name, $value in globals.$ionic-colors {
.ion-color-#{$color-name} {
@include globals.generate-color($color-name);
}
}
}
html {