-
4 Oct 2012 2:08 PM #1
Abuse of !important in theme styles
Abuse of !important in theme styles
REQUIRED INFORMATIONExt version tested:
- Ext 4.1.0
- Chrome
- IE8/9
- irrelevant
- In styling framework code, !important flags used in places that don't seem necessary. e.g. See it used in grid icon styles:
toolbar bg styles:Code://grid icons .#{$prefix}tbar-page-first { background-image: theme-background-image($theme-name, 'grid/page-first.gif') !important; } .#{$prefix}tbar-loading { background-image: theme-background-image($theme-name, 'grid/refresh.gif') !important; }
Code:@if not $supports-gradients or $compile-all { @if $background-gradient != null { .#{$prefix}nlg { .#{$prefix}toolbar-#{$ui} { background-image: theme-background-image($theme-name, 'toolbar/toolbar-#{$ui}-bg.gif') !important; background-repeat: repeat-x; } } } } - This makes it harder for us to write rules to override those bg with our own, since we have to put !important to beat the specificity. Also it's impossible to use Compass spriting mixins to override those icons.
- Remove !important flags in framework code to make code more extensible and reduce specificity wars.
- Win 7
-
4 Oct 2012 3:56 PM #2
I doubt we'll be able to remove them all, but it's something worth looking into.
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
You found a bug! We've classified it as
EXTJSIV-7440
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.


Reply With Quote