WordPress.org

Make WordPress Core

Opened 21 months ago

Last modified 10 days ago

#26350 new defect (bug)

!important audit

Reported by: azaozz Owned by:
Milestone: Future Release Priority: high
Severity: major Version: 3.8
Component: Administration Keywords:
Focuses: ui, performance Cc:

Description

After the MP6 merge many CSS rules became "very !important". Some are so !important that overwrite other !important...

Looking at wp-admin.css: in trunk there are 65 !important compared to 22 in 3.7.

Attachments (3)

26350.diff (61.7 KB) - added by adamsilverstein 9 months ago.
remove all !important statements from css
26350.2.diff (45.1 KB) - added by adamsilverstein 4 months ago.
refresh
26350.3.diff (47.9 KB) - added by MikeHansenMe 10 days ago.

Download all attachments as: .zip

Change History (11)

comment:1 follow-up: @Rhomanu21 months ago

66 in 3.8.

Agreed, it's not a good practice : Using these force the use of another !important to overwrite a rule, and then it's expanding... While it's just a simple problem of CSS declaration weight.

But it will be long to fix... I'll try a bit tonight (I must find how to contribute without blocking others' work), but there's many CSS files to check.

comment:2 in reply to: ↑ 1 @bassgang21 months ago

Hi Rhomanu,

I also want to look into this but do not want to make the work twice, any proposal how to divide it, any progress at your site so far?

comment:3 @azaozz21 months ago

  • Milestone changed from 3.8 to Future Release

Yeah, each use of !important spreads exponentially. Every time it needs to be overridden, new !important has to be used.

As much as I'd like to get rid of all !important for 3.8, there is simply not enough time to do it... Hoping we can do this in 3.9.

comment:4 @nacin20 months ago

  • Component changed from General to Performance

comment:5 @nacin20 months ago

  • Component changed from Performance to Administration
  • Focuses performance added

@adamsilverstein9 months ago

remove all !important statements from css

comment:6 @adamsilverstein9 months ago

26350.diff: Is anything really that !important? and if so, why? This patch removes all !important declaration, please restore where appropriate, with !justification.

@adamsilverstein4 months ago

refresh

comment:7 @adamsilverstein4 months ago

Refresh against trunk.

Left in one !important where the purpose was indicated in a doc block.

@MikeHansenMe10 days ago

comment:8 @MikeHansenMe10 days ago

26350.3.diff is a refresh of 26350.2.diff and includes the 17 new instances of !important that have been added in the last 4 months.

Note: See TracTickets for help on using tickets.