Jump to content

IPB4 CSS !important


We are Borg

Recommended Posts

Posted

Sorry i forgot to post it on this site.

I was viewing the css in IPB4 and what i noticed was the amount of use of the !important declaration. The first thing you need to know is why its bad.

Its bad because instead of working in an order you can now override that and if some one does the following it becomes clear.

 
 
#example {
font-size: 14px !important;
}

#container #example {
font-size: 10px;
}

In this example #container #example should be 10px but because of the !important in #example it will be 14px. So in stead of cascading down the line it goes up again. In this example it does not matter that much because you can see what happens. Now imaging a css like IPB4 can you see the nightmare you have to go trough if something is not working to get a fast result you need to either use !important again or you have to debug the the whole css to see why its gone wrong.I have viewed a few files but counted around 50 !important declarations in that time i haven't even gone trough all the css.

I have viewed a few files but counted around 50 !important declarations in that time i haven't even gone trough all the css. This website says it best

!important declarations after all other avenues have been exhausted. If you use !important out of laziness, to avoid proper debugging, or to rush a project to completion, then you’re abusing it, and you (or those that inherit your projects) will suffer the consequences.should not be used unless they are absolutely necessary

We the customer will suffer because you have no clue why !important is being used is it because it needed to be done or is it because no one was going to bother to debug it, you have no clue at all.I always learned only to use the !important declaration when i can explain why i need it and why i can't go without.This is going to make a alternate style based on this CSS very hard because you need to find out how and why or start from scratch. Also i do not see a CSS reset so that most browsers are being treated the same.

 

Since i posted this a few days ago on another site i have counted the amount used:

I have done a search and 62 files of the 128 has !important in it that is 48% of the files has the !important in it. In the 62 files !important is being used 212 times.

Will the CSS get an major update to get at least 95% of !important out of the CSS and document why its used and what happens if its not used at that declaration. Normal users that have normal understanding of CSS don't have a clue why something happens with all this !important use.

Also its called Cascading Style Sheets with so many !important it does not Cascade down as smooth.

Posted

Please outline specifically any bugs you believe exist - using the !important declaration in and of itself is not a bug (and frankly, it's used sparingly because we are aware of the trouble overwriting these values).

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...