Skip to content

Conversation

@tanner-reits
Copy link
Contributor

@tanner-reits tanner-reits commented Sep 16, 2024

Issue number: resolves internal


What is the current behavior?

No default modal styles for the Ionic theme

What is the new behavior?

  • Splits common and native styles into separate stylesheets
  • Adds default styles to modals for Ionic theme

Does this introduce a breaking change?

  • Yes
  • No

Other information

I only applied some of the global styles to the sheet modal vairation since it is unclear whether the card variation will be used in the widgets

@vercel
Copy link

vercel bot commented Sep 16, 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 Sep 20, 2024 7:18pm

@tanner-reits tanner-reits marked this pull request as ready for review September 19, 2024 19:32
@tanner-reits tanner-reits requested a review from a team as a code owner September 19, 2024 19:32
Comment on lines +80 to +90
html.ionic ion-modal ion-header ion-toolbar ion-title {
@include globals.position(0, null, null, 0);

position: absolute;

width: 100%;
height: 100%;

transform: translateZ(0);

text-align: center;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had to override the styles for ion-title because the ionic theme styles for that component use :host-context() which is supported in Safari and Firefox. I can make this change in the title styles themselves, but it does result in some screenshots changing and I wasn't exactly sure what the correct styles were for that component

Copy link
Contributor

@thetaPC thetaPC left a comment

Choose a reason for hiding this comment

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

LGTM, just minor requests

@@ -1,6 +1,6 @@
@import "./modal.vars";
@import "../../themes/native/native.globals";
Copy link
Contributor

Choose a reason for hiding this comment

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

Common files do not use any files that are theme associated. I assume that this import was added in order to use mixins like position. If that's the case then import the correct file like how buttons does it:

@use "../../themes/mixins" as mixins;

@@ -1,11 +1,15 @@
@use "../../themes/ionic/ionic.globals.scss" as globals;
@import "./modal";
@import "./modal.common";
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
@import "./modal.common";
@use "./modal.common";

@@ -0,0 +1,49 @@
@use "./modal.common";
@import "./modal.vars";
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
@import "./modal.vars";
@use "./modal.vars" as vars

Let's start to convert over to @use. @import is deprecated so it'll make it easier on us to get in the habit to use @use so we have less areas to convert.

Note: item.ionic.scss has an example of how the vars variable is being used.

@tanner-reits tanner-reits merged commit bde1d09 into next Sep 20, 2024
46 checks passed
@tanner-reits tanner-reits deleted the tr/ROU-11153-modal-ionic-theme-styles branch September 20, 2024 19: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