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

unnecessary css property in an interactive element #2760

Open
Denis-GH opened this issue Apr 13, 2024 · 3 comments
Open

unnecessary css property in an interactive element #2760

Denis-GH opened this issue Apr 13, 2024 · 3 comments
Labels
idle Issues and pull requests with no activity for three months.

Comments

@Denis-GH
Copy link

What information was incorrect, unhelpful, or incomplete?

https://developer.mozilla.org/en-US/docs/Web/CSS/background-clip

text-shadow on an interactive element prevents the "background-clip: text" property from being demonstrated
Screenshot_7

What did you expect to see?

You just need to remove the text-shadow from the text "This is the content of the element."

so that it would be like this:
Screenshot_8

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

@Denis-GH Denis-GH added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Apr 13, 2024
Copy link

It looks like this is your first issue. Welcome! 👋 One of the project maintainers will be with you as soon as possible. We appreciate your patience. To safeguard the health of the project, please take a moment to read our code of conduct.

@bsmth
Copy link
Member

bsmth commented Apr 16, 2024

Thanks for raising this one and for the great suggestion. Here's the source CSS https://github.com/mdn/interactive-examples/blob/main/live-examples/css-examples/backgrounds-and-borders/background-clip.css#L2

text-shadow on an interactive element prevents the "background-clip: text" property from being demonstrated

I understand what you mean, but I think the example is working as the author intended relative to the other values. We could add text-shadow: none; to the last display option:

background-clip: text;
-webkit-background-clip: text;
color: transparent;
text-shadow: none;

but it's starting to get a little crowded for information (and it shows there's an interaction with text-shadow with this property), so I'm leaning towards leaving as-is in this case. What do you think?

@bsmth bsmth removed the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Apr 16, 2024
@Denis-GH
Copy link
Author

Thanks for the reply!
I agree that we shouldn't add text-shadow: none; to the last display option. But I wouldn't want to leave it as-is, because the shadow is on top of the text and it looks like just black text, that's obviously not what the author wanted to show.
To move the shadow under the text we can do something like this:

<div class="text-container">
  <span class="text">Text</span>
  <span class="text-shadow">Text</span>
</div>

but that doesn't make sense in this interactive element, so I suggest just removing the text-shadow property from the source code.

@github-actions github-actions bot added the idle Issues and pull requests with no activity for three months. label May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idle Issues and pull requests with no activity for three months.
Projects
None yet
Development

No branches or pull requests

2 participants