!Important and Wordpress

!Important → Although using this CSS is not a very great method, but at certain points it becomes inevitable.

established wordpress theme authors can you please guide me if at certain instances we are allowed to use this?

Well I would say almost never. On ThemeForest we selling Templates they are being used to make changes.

If a buyer want to use an important tag in his own stylesheet I think its ok. In my opinion that is why the tag is there, but if we as sellers are going to use it it could hinder the buyer so much if he trying to edit his template.

Most buyers have limited knowledge of Wordpress or dont have the time to search the whole template for the right css tag. “He just want a red button instead of a blue one”.

Can you give me a scenario where its inevitable to use !important? Its all about a organized code structure right?

I looked up the last time I used a !important tag and it was for my .clear-fix class. That is the only case where I can think about to do it

p.s. you can use maybe use it in the back-end, but even then you are limiting your buyer.

1 Like

this is the situation → https://www.screencast.com/t/FDv6PJI2yUw

we want to implement the blue one, but w/o !important that is not possible.

It is possible if your selector parent level is higher than current active selector. Something like that below

body .author-circle2 img { width: 40px; }

1 Like

this kind of css writing allowed in TF WP Theme.

I don’t see like that rule in themeforest. But, it is better than using “!important”.

1 Like