Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add ionic theme architecture #29132

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

Merged
sean-perkins merged 42 commits into next from sp/look-and-feel
Mar 18, 2024
Merged

feat: add ionic theme architecture #29132

sean-perkins merged 42 commits into next from sp/look-and-feel
Mar 18, 2024

Conversation

@sean-perkins
Copy link
Contributor

@sean-perkins sean-perkins commented Mar 9, 2024
edited
Loading

Issue number: Internal


What is the current behavior?

What is the new behavior?

Adds the base architecture to add a new theme configuration to Ionic Framework components.

  • Components can now specify an additional stylesheet for the ionic theme.
  • Developers can specify the theme and mode independently to control look and feel of a component.

Test infrastructure has been updated to add support for testing the theme configuration with Playwright.

  • Existing themes test configuration has been renamed to palettes

This PR is just the initial effort to decouple Ionic's architecture to separate look and feel and allow our dev team to start introducing the new component appearance to the UI. There will be additional changes required to completely add support for the Ionic theme. These changes are targeted against the next branch and are not expected to be used in a production environment at this time.

Does this introduce a breaking change?

  • Yes
  • No

Other information

While further evaluating this approach, Ionic already has a concept of "platforms" that refer to iOS, Android, iPhone, iPad, etc. This language is confusing with trying to use platform for just the specific iOS and Android behaviors we have baked into components.
@github-actions github-actions bot added package: core @ionic/core package package: angular @ionic/angular package labels Mar 9, 2024
@github-actions github-actions bot added the package: vue @ionic/vue package label Mar 9, 2024
Copy link
Contributor

@averyjohnston averyjohnston Mar 11, 2024

Choose a reason for hiding this comment

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

The following props mention being mode-dependent in their docs comments, but as far as I can tell are now theme dependent and thus need the comments updated:

  • translucent on action-sheet, alert, card-header, fab-button, footer, header, loading, popover, tab-bar, toast
  • collapse on footer, header
  • fill on input, textarea
  • detail on item
  • presentingElement on modal
  • The arrow shadow part and prop, plus alignment, on popover
  • cancelButtonIcon, cancelButtonText, and searchIcon on searchbar
  • fill, toggleIcon, and expandedIcon on select
  • primary and secondary shadow parts on toolbar

Copy link
Contributor Author

@sean-perkins sean-perkins Mar 12, 2024

Choose a reason for hiding this comment

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

Great list 👍

  • presentingElement is still based on mode detection currently. We may adjust when working on overlays as part of the new theme.

Copy link
Contributor

@averyjohnston averyjohnston Mar 14, 2024
edited
Loading

Choose a reason for hiding this comment

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

On closer inspection, presentingElement is dependent on both mode and theme currently. It is used to tell whether a card modal should be rendered here, which is then used to configure the classes modal-default and modal-card. The styling for these classes is theme-dependent.

}

if (getIonMode(this) === 'ios') {
if (getIonTheme(this) === 'ios') {
Copy link
Contributor

@averyjohnston averyjohnston Mar 11, 2024

Choose a reason for hiding this comment

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

If this hasn't been done already, could be worth adding a note to the ticket for writing docs about theme vs. mode to ensure the config option descriptions are updated to mention the right prop.

Copy link
Member

@brandyscarney brandyscarney left a comment

Choose a reason for hiding this comment

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

I need to take a closer look at the implementation in ionic-global.ts and test it out but I reviewed all of the other files.

Copy link
Contributor

@averyjohnston averyjohnston left a comment

Choose a reason for hiding this comment

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

Sorry about the multiple rounds of reviews, didn't know Github would submit some of my comments early 😅

I also have a couple earlier comments that haven't been fully addressed yet, re: presentingElement on modal and collapse on buttons.

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.

My comment is a suggestion. Regardless of what you decide, request me when it's ready.

Copy link
Contributor

@averyjohnston averyjohnston left a comment

Choose a reason for hiding this comment

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

Can we create another ticket to look into the presentingElement issue I mentioned in #29132 (comment), or update the existing one for collapse to cover it as well? Otherwise this LGTM.

Co-authored-by: Maria Hutt <thetaPC@users.noreply.github.com>
Copy link
Contributor Author

@amandaejohnston created FW-6049 to track. Feel free to create spikes for tasks like that as you think they make sense, especially if you have context from your comments.

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, woot!

Copy link
Contributor

@mapsandapps mapsandapps left a comment

Choose a reason for hiding this comment

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

As well as the inline comments, it looks like the following components are missing an ionic theme in the styleUrls:

  • Datetime Button
  • Picker Column Option

Copy link
Contributor

@mapsandapps mapsandapps left a comment

Choose a reason for hiding this comment

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

Looks good!

sean-perkins and others added 2 commits March 18, 2024 15:14
Co-authored-by: Brandy Carney <brandyscarney@users.noreply.github.com>
@sean-perkins sean-perkins deleted the sp/look-and-feel branch March 18, 2024 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@brandyscarney brandyscarney brandyscarney approved these changes

@thetaPC thetaPC thetaPC approved these changes

@liamdebeasi liamdebeasi Awaiting requested review from liamdebeasi

+3 more reviewers

@mapsandapps mapsandapps mapsandapps approved these changes

@bmarcelino-fe bmarcelino-fe bmarcelino-fe approved these changes

@averyjohnston averyjohnston averyjohnston approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

package: angular @ionic/angular package package: core @ionic/core package package: vue @ionic/vue package

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /