Skip to content
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

The popover show should not be light in Dark Mode #36

Open
MainasuK opened this issue May 27, 2022 · 6 comments
Open

The popover show should not be light in Dark Mode #36

MainasuK opened this issue May 27, 2022 · 6 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@MainasuK
Copy link

public static let system = Self(
color: Color(.label.withAlphaComponent(0.25)),
radius: 40,
x: 0,
y: 4
)

Hello. I'm try to intergrade a popover for custom SwiftUI control. I notice the shadow template is implement with .label color. This color works well in Light Mode. But for the Dark Mode the shadow color should still be black and we needs elevate the modal background color (from black to gray) to make popover looks like floating.

For example the iPad slide over window:

@aheze
Copy link
Owner

aheze commented May 27, 2022

Hmm, good point. Should it be .black instead? I can also make it a static var so you can change it

@aheze aheze added enhancement New feature or request good first issue Good for newcomers labels May 27, 2022
@MainasuK
Copy link
Author

Yes. Black is the correct choice. And that's enough for most of the usages.

That's could be modified now by:

.popoverShadow(shadow: {
    var shadow = Templates.Shadow.system
    shadow.color = Color(.black.withAlphaComponent(0.3))
    return shadow
}())

And opening the modifier is also a good idea.

@JohnKuan
Copy link

JohnKuan commented Dec 2, 2022

Hi @aheze, I also would like to ask if it is possible to customize the Template.Container logic for applying shadow as well.

By default it applies Color(.label.withAlphaComponent(0.25)). Could it be done such that if shadow was not provided, we do not automatically pass the shadow?

Otherwise, I could extend Template with another container to modify my own version of container, but I also require the BackgroundWithArrow to be public.

@JohnKuan
Copy link

JohnKuan commented Dec 2, 2022

@aheze I have created a PR to have some modification to the Container's shadow. https://github.com/aheze/Popovers/pull/62
Let me know if you have any concerns or additional area you would like to replicate this behavior on other areas.

kheravarun08 added a commit to kheravarun08/Popovers that referenced this issue Feb 6, 2023
The popover show should not be light in Dark Mode
@kheravarun08
Copy link
Contributor

@aheze I have created PR for the changes.....Kindly review

@aheze
Copy link
Owner

aheze commented Feb 7, 2023

Thanks!

aheze added a commit that referenced this issue Feb 7, 2023
Resolved issue #36 : Updated let to var as suggested
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants