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

Using "Look and feel > Theme color" triggers .h5p-invert-shades class, obscuring card content. #62

Open
patrickgrey opened this issue Sep 8, 2020 · 5 comments

Comments

@patrickgrey
Copy link

Hi, I tried to change the "Theme color" in "Look and feel". This resulted in “.h5p-memory-game.h5p-invert-shades .h5p-memory-card .h5p-back:before” being added to the before pseudo element of the .h5p-back div. This covers the card content img with a #000 opacity 0.5 overlay which makes it hard to read the img. I also noticed that the selected theme color is added inline to the .h5p-back div but only on the "color" property. This won't therefore affect the cards (maybe it is for the description, I don't know). There is no way I can see of resetting the theme selection to prevent .h5p-invert-shades being added. So, if I want to fix the issue, I'd have to recreate the game again. Hope that helps. Cheers.

@icc
Copy link
Member

icc commented Sep 8, 2020

Hi!
Currently, the invert-shades class is triggered by the contrast ratio between the theme color and white to ensure readability.
Would you be able to share a screenshot of the issue you're experiencing?

@patrickgrey
Copy link
Author

Thanks for the quick response. Sure, here are some screenshots of the output and the setting. Note, the issue existed before I added a new background image to the card. Let me know if you need anything else.
h5p-memory-game-overlay
h5p-memory-game-setting

@patrickgrey
Copy link
Author

I should add that the content images on the card are text with transparent background. I could use an opaque image but I think the overlay would still go over that?

@patrickgrey
Copy link
Author

OK, I'm starting to understand it better now. Sorry, I should have read your reply better. I was wrong, the pseudo element is not covering the img, it just appeared that way as the img is transparent. I can fix this by changing the theme colour to a much darker one or use an opaque image. This is probably an edge case but might be worth mentioning in the instructions? I'm happy to add a pull request for that if you want. I'm guessing https://github.com/h5p/h5p-memory-game/blob/master/semantics.json should be edited?

@icc
Copy link
Member

icc commented Sep 8, 2020

Ah, yes, I'm glad you figured it out.
That is correct, feel free to add a PR with a better description as I think that can be helpful for others.

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

No branches or pull requests

2 participants