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

CSS Specificity is preventing me from overriding content property #2003

Open
goldmont opened this issue Apr 22, 2024 · 2 comments
Open

CSS Specificity is preventing me from overriding content property #2003

goldmont opened this issue Apr 22, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@goldmont
Copy link

As appropriate, please include:

  • Operating system and version: Ubuntu 22.04
  • Browser and version: Chrome 124.0.6367.60
  • A reduced test case: Codepen

Hi,

As you can see from the test case hosted on Codepen, the class bi-file-earmark-zip is unable to override bi-file-earmark because the latter has higher specificity. I think that every icon class should mark the content property as !important.

@goldmont goldmont added the bug Something isn't working label Apr 22, 2024
@mdo
Copy link
Member

mdo commented Apr 26, 2024

What can't you override?

CleanShot 2024-04-26 at 07 52 04@2x

The selector we use applies to all ~2,000 generated classnames for each icon.

.bi::before, 
[class*=" bi-"]::before, 
[class^=bi-]::before {
  /* ... */
}

@goldmont
Copy link
Author

goldmont commented Apr 26, 2024

As you can see from your screenshoot too, I expect to see the bi-file-earmark-zip icon instead of bi-file-earmark.

bi-file-earmark (Bootstrap Icons):
image

bi-file-earmark-zip (Bootstrap Icons):
image

I'm using bi-file-earmark as a fallback for extensions that don't have an own icon. By the way, every bi-file-earmark-* placed after bi-file-earmark is unable to override the former's content property due to CSS specificity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants