Comments (8)
If the structure of your CSS is correct, this should not be a problem or causing side-effects.
When someone want to override the buttons without having to change the source of this script, it is not possible anymore with these '!important'.
In my vision; '!important' is never a good idea if the structure of the overall website is correct.
from sharingbuttons.io.
I agree with @xoniq , using "!important" should try to be avoided in most cases.
from sharingbuttons.io.
Sure, you don't want to do anything that'll get in the way of your cascade, but there are definitely legitimate uses for !important
. For context, this note was because of changes made to a.resp-sharing-button__link
s. I agree it probably the !important
isn't necessary - the reason for it here would be to protect against something like a {color: #000 !important}
but in my opinion anyone who wants to do that should have to figure out their own workaround ;)
from sharingbuttons.io.
@olets if you have an '!important' like that there is already something wrong with the CSS structure itself. Of something is overriding the global 'a' there is the error. Extensions should only have CSS concerning it's container. And if you want an extension to honor your global style, this should be overridden on a proper way.
from sharingbuttons.io.
just gonna give my 2cents...
i agree there are time when !important
are valid, but these are only from things like .hidden
.hidden--mobile` etc
other than that, things like BEM and SMACCS also agree that, if possible, it is preferable to not have nested classes or !important
; both of these things make customising the css harder.
from sharingbuttons.io.
Ha I mean yes, it's true that !important
can be a sign of beginner css coding. In a case like this, where people are including an outside module and counting on the buttons to look a certain, its purpose would be to make it really hard for the site styles to interfere with the sharingbuttons styles. For example,
a.resp-sharing-button__link,
a.resp-sharing-button__link:hover,
a.resp-sharing-button__link:focus {
... !important
}
(with a
s and !important
s) would make it really impossible for the site styles to accidentally mess up the buttons.
As you've all said, the usual goal is to be just as specific as necessary, and no more. mxstbr originally had
.resp-sharing-button__link,
.resp-sharing-button__link:hover,
.resp-sharing-button__link:focus {
...
}
and I just wanted to make sure he saw that when I changed it to .resp-sharing-button__link {...}
(in #48) we lost some of the specificity he'd had before. I think we all agree that !important
s aren't needed here :D
from sharingbuttons.io.
(I've wanted to use the bitmoji github plugin for so long!!:)
from sharingbuttons.io.
Thanks for the discussion everybody!
from sharingbuttons.io.
Related Issues (20)
- Not Sharing the Correct Page HOT 2
- Twitter share not working HOT 1
- Wrong Xing sharing URL
- Add Messenger button?
- Not working on WordPress
- Change 'Twitter' to 'X'
- Add Mastodon button using toot.kytta.dev
- sharingbuttons.io down HOT 9
- Have the logos be a sprite or font-based HOT 3
- Idea: Medium should be added HOT 1
- React dev tool reports development build is used on the site HOT 1
- Facebook Link is 301 re-directing HOT 1
- Force HTTPS on the website HOT 3
- Add Instagram button? HOT 2
- Sharing count? HOT 1
- massive icons on screen <2000px width HOT 1
- Bootstrap support (or provide a parent tag that resets styles)
- Add Houzz?
- Add Dev.to HOT 1
- Include Mastodon HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sharingbuttons.io.