Skip to content

docs(popover): add customization playgrounds #2348

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
merged 2 commits into from
May 24, 2022

Conversation

averyjohnston
Copy link
Contributor

Adds the following playgrounds:

  • Positioning (Size and Alignment Demo)
  • Sizing
  • Styling

Also removes a dead link from the existing docs.

@vercel
Copy link

vercel bot commented May 19, 2022

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

Name Status Preview Updated
ionic-docs ✅ Ready (Inspect) Visit Preview May 23, 2022 at 6:44PM (UTC)

Copy link
Contributor

@liamdebeasi liamdebeasi left a comment

Choose a reason for hiding this comment

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

The Side and Alignment demos do not seem to render correctly in the framework integrations. Maybe a bug in Ionic?

Javascript:

image

Angular:
image

<style>
ion-popover {
--background: rgba(40, 173, 218, 0.6);
--backdrop-opacity: 0.6;
Copy link
Contributor

Choose a reason for hiding this comment

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

Any particular reason why you opted to use the backdrop opacity CSS variable instead of setting opacity on ::part(backdrop)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just to show that the variable exists, mostly 😆 I can change it if you like, although that makes me wonder why we have the variable in the first place 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

It's up to you. The variable was added before shadow parts were available in most browsers. Though with the shadow part it's redundant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So it turns out that ion-popover has a default value for --backdrop-opacity built-in: https://github.com/ionic-team/ionic-framework/blob/main/core/src/components/popover/popover.ios.scss#L11 This overwrites setting opacity on the ion-backdrop directly, so setting a custom --backdrop-opacity on the popover is the cleanest way of doing things.

@averyjohnston
Copy link
Contributor Author

averyjohnston commented May 23, 2022

That misalignment does look like an Ionic bug, yeah. Interestingly, React and Vue show slightly different behavior from Angular, though all three frameworks are misaligned in some capacity. I'll get some repro apps together and post an issue.

@averyjohnston averyjohnston requested a review from liamdebeasi May 23, 2022 18:40
@averyjohnston
Copy link
Contributor Author

Issue created: ionic-team/ionic-framework#25337

@averyjohnston averyjohnston merged commit 38d9510 into FW-1277-nested May 24, 2022
@averyjohnston averyjohnston deleted the FW-1277-customization branch May 24, 2022 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants