Skip to content

Commit aded437

Browse files
BenOsodracIonitronthetaPC
authored
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 <[email protected]> Co-authored-by: Maria Hutt <[email protected]>
1 parent b9ef92a commit aded437

File tree

133 files changed

+42
-23
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+42
-23
lines changed

core/scripts/testing/scripts.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,27 @@
2828
document.head.appendChild(linkTag);
2929
}
3030

31+
/**
32+
* The `ionic` theme uses a different stylesheet than the `iOS` and `md` themes.
33+
* This is to ensure that the `ionic` theme is loaded when the `ionic:theme=ionic`
34+
* or when the HTML tag has the `theme="ionic"` attribute. This is useful for
35+
* the snapshot tests, where the `ionic` theme is not loaded by default.
36+
*/
37+
const themeQuery = window.location.search.match(/ionic:theme=([a-z]+)/);
38+
const themeAttr = document.documentElement.getAttribute('theme');
39+
40+
if ((themeQuery && themeQuery[1] === 'ionic') || themeAttr === 'ionic') {
41+
const ionicThemeLinkTag = document.querySelector('link[href*="css/ionic/bundle.ionic.css"]');
42+
43+
if (!ionicThemeLinkTag) {
44+
const linkTag = document.createElement('link');
45+
linkTag.setAttribute('rel', 'stylesheet');
46+
linkTag.setAttribute('type', 'text/css');
47+
linkTag.setAttribute('href', '/css/ionic/bundle.ionic.css');
48+
document.head.appendChild(linkTag);
49+
}
50+
}
51+
3152
window.Ionic = window.Ionic || {};
3253
window.Ionic.config = window.Ionic.config || {};
3354

-6.12 KB
-5.47 KB
-4.54 KB
-6.19 KB
-5.49 KB
-4.63 KB
-1.05 KB
-1.31 KB
-1.39 KB

0 commit comments

Comments
 (0)