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.
  1. #1
    Sencha Premium Member
    Join Date
    Jul 2011
    Location
    San Francisco, CA
    Posts
    101
    Vote Rating
    5
    alicexyl is on a distinguished road

      2  

    Default Abuse of !important in theme styles

    Abuse of !important in theme styles


    REQUIRED INFORMATIONExt version tested:
    • Ext 4.1.0
    Browser versions tested against:
    • Chrome
    • IE8/9
    DOCTYPE tested against:
    • irrelevant
    Description:
    • In styling framework code, !important flags used in places that don't seem necessary. e.g. See it used in grid icon 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;
          }
      toolbar bg styles:
      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.
    Possible fix:
    • Remove !important flags in framework code to make code more extensible and reduce specificity wars.
    Operating System:
    • Win 7

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    15,242
    Vote Rating
    106
    evant is a splendid one to behold evant is a splendid one to behold evant is a splendid one to behold evant is a splendid one to behold evant is a splendid one to behold evant is a splendid one to behold evant is a splendid one to behold

      0  

    Default


    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!

Tags for this Thread