X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/3789b528d8dd8aad4558e38e22d775bcab1cbd36..refs/heads/master:/resources/themes/stylesheets/ext4/default/widgets/_button.scss diff --git a/resources/themes/stylesheets/ext4/default/widgets/_button.scss b/resources/themes/stylesheets/ext4/default/widgets/_button.scss index ac138fc9..6524599e 100644 --- a/resources/themes/stylesheets/ext4/default/widgets/_button.scss +++ b/resources/themes/stylesheets/ext4/default/widgets/_button.scss @@ -54,11 +54,22 @@ .#{$prefix}btn-inner { display: block; white-space: nowrap; - text-align: center; background-color: transparent; background-repeat: no-repeat; background-position: left center; } + + .#{$prefix}btn-left .#{$prefix}btn-inner { + text-align: left; + } + + .#{$prefix}btn-center .#{$prefix}btn-inner { + text-align: center; + } + + .#{$prefix}btn-right .#{$prefix}btn-inner { + text-align: right; + } } .#{$prefix}btn-disabled { @@ -67,14 +78,26 @@ .#{$prefix}btn-disabled span { @include opacity(.5); + + .#{$prefix}ie6 &, + .#{$prefix}ie7 & { + filter:none; + } } - //remove the opacity rule of IE6. - .#{$prefix}ie6 .#{$prefix}btn-disabled, - .#{$prefix}ie6 .#{$prefix}btn-disabled span, - .#{$prefix}ie7 .#{$prefix}btn-disabled span { + //remove the opacity rule of IE8 + .#{$prefix}ie7 .#{$prefix}btn-disabled, + .#{$prefix}ie8 .#{$prefix}btn-disabled { filter:none; } + + .#{$prefix}ie6 .#{$prefix}btn-disabled, + .#{$prefix}ie7 .#{$prefix}btn-disabled, + .#{$prefix}ie8 .#{$prefix}btn-disabled { + .#{$prefix}btn-icon { + @include opacity(.6); + } + } @if $include-ie { * html .#{$prefix}ie { @@ -109,17 +132,32 @@ } } - .#{$prefix}btn-icon-text-right .#{$prefix}btn-inner { + .#{$prefix}btn-icon-text-left .#{$prefix}btn-icon { + background-position: left center; + } + + .#{$prefix}btn-icon-text-right .#{$prefix}btn-icon { background-position: right center; } - .#{$prefix}btn-icon-text-top .#{$prefix}btn-inner { + .#{$prefix}btn-icon-text-top .#{$prefix}btn-icon { background-position: center top; } - .#{$prefix}btn-icon-text-bottom .#{$prefix}btn-inner { + .#{$prefix}btn-icon-text-bottom .#{$prefix}btn-icon { background-position: center bottom; } + + .#{$prefix}btn { + button, a { + position: relative; + + .#{$prefix}btn-icon { + position: absolute; + background-repeat: no-repeat; + } + } + } .#{$prefix}btn-arrow-right { background: transparent no-repeat right center; @@ -140,7 +178,7 @@ } .#{$prefix}btn-arrow { - background-image: theme-image($theme-name, 'button/arrow.gif'); + background-image: theme-background-image($theme-name, 'button/arrow.gif'); display: block; } @@ -148,23 +186,25 @@ //split buttons .#{$prefix}btn-split-right, .#{$prefix}btn-over .#{$prefix}btn-split-right { - background: transparent theme-image($theme-name, 'button/s-arrow.gif') no-repeat right center; + background: transparent no-repeat right center; + background-image: theme-background-image($theme-name, 'button/s-arrow.gif'); padding-right: $button-split-size !important; } .#{$prefix}btn-split-bottom, .#{$prefix}btn-over .#{$prefix}btn-split-bottom { - background: transparent theme-image($theme-name, 'button/s-arrow-b.gif') no-repeat center bottom; + background: transparent no-repeat center bottom; + background-image: theme-background-image($theme-name, 'button/s-arrow-b.gif'); padding-bottom: $button-split-size; } .#{$prefix}toolbar .#{$prefix}btn-split-right { - background-image: theme-image($theme-name, 'button/s-arrow-noline.gif'); + background-image: theme-background-image($theme-name, 'button/s-arrow-noline.gif'); padding-right: $button-toolbar-split-size !important; } .#{$prefix}toolbar .#{$prefix}btn-split-bottom { - background-image: theme-image($theme-name, 'button/s-arrow-b-noline.gif'); + background-image: theme-background-image($theme-name, 'button/s-arrow-b-noline.gif'); } .#{$prefix}btn-split { @@ -180,8 +220,8 @@ text-align: inherit; } - .#{$prefix}btn-over .#{$prefix}btn-split-right { background-image: theme-image($theme-name, 'button/s-arrow-o.gif'); } - .#{$prefix}btn-over .#{$prefix}btn-split-bottom { background-image: theme-image($theme-name, 'button/s-arrow-bo.gif'); } + .#{$prefix}btn-over .#{$prefix}btn-split-right { background-image: theme-background-image($theme-name, 'button/s-arrow-o.gif'); } + .#{$prefix}btn-over .#{$prefix}btn-split-bottom { background-image: theme-background-image($theme-name, 'button/s-arrow-bo.gif'); } @include extjs-button-ui( /* UI + Scale */ @@ -598,9 +638,19 @@ //icons .#{$prefix}btn-#{$ui}-icon { - .#{$prefix}btn-inner { + button { padding: 0; width: $icon-size !important; + height: $icon-size; + } + + .#{$prefix}btn-icon { + width: $icon-size; + height: $icon-size; + top: 0; + left: 0; + bottom: 0; + right: 0; } } @@ -613,6 +663,20 @@ line-height: $icon-size; padding-left: $icon-size + 4px; } + + .#{$prefix}btn-icon { + width: $icon-size; + height: auto; + top: 0; + left: 0; + bottom: 0; + right: auto; + + .#{$prefix}ie6 &, + .#{$prefix}quirks & { + height: $icon-size; + } + } } .#{$prefix}btn-#{$ui}-icon-text-right { @@ -624,18 +688,60 @@ line-height: $icon-size; padding-right: $icon-size + 4px !important; } + + .#{$prefix}btn-icon { + width: $icon-size; + height: auto; + top: 0; + left: auto; + bottom: 0; + right: 0; + + .#{$prefix}ie6 &, + .#{$prefix}quirks & { + height: $icon-size; + } + } } .#{$prefix}btn-#{$ui}-icon-text-top { .#{$prefix}btn-inner { padding-top: $icon-size + 4px; } + + .#{$prefix}btn-icon { + width: auto; + height: $icon-size; + top: 0; + left: 0; + bottom: auto; + right: 0; + + .#{$prefix}ie6 &, + .#{$prefix}quirks .#{$prefix}ie & { + width: $icon-size; + } + } } .#{$prefix}btn-#{$ui}-icon-text-bottom { .#{$prefix}btn-inner { padding-bottom: $icon-size + 4px; } + + .#{$prefix}btn-icon { + width: auto; + height: $icon-size; + top: auto; + left: 0; + bottom: 0; + right: 0; + + .#{$prefix}ie6 &, + .#{$prefix}quirks .#{$prefix}ie & { + width: $icon-size; + } + } } .#{$prefix}btn-#{$ui}-over { @@ -643,12 +749,7 @@ border-color: $border-color-over; } @if $background-color-over != null { - @if $background-gradient-over != $background-gradient { - @include background-gradient($background-color-over, $background-gradient-over); - } - @else if $background-color-over != $background-color { - background-color: $background-color-over; - } + @include background-gradient($background-color-over, $background-gradient-over); } .#{$prefix}btn-inner { @@ -672,12 +773,7 @@ border-color: $border-color-focus; } @if $background-color-focus != null { - @if $background-gradient-focus != $background-gradient { - @include background-gradient($background-color-focus, $background-gradient-focus); - } - @else if $background-color-focus != $background-color { - background-color: $background-color-focus; - } + @include background-gradient($background-color-focus, $background-gradient-focus); } .#{$prefix}btn-inner { @@ -702,12 +798,7 @@ border-color: $border-color-pressed; } @if $background-color-pressed != null { - @if $background-gradient-pressed != $background-gradient { - @include background-gradient($background-color-pressed, $background-gradient-pressed); - } - @else if $background-color-pressed != $background-color { - background-color: $background-color-pressed; - } + @include background-gradient($background-color-pressed, $background-gradient-pressed); } .#{$prefix}btn-inner { @@ -731,12 +822,7 @@ border-color: $border-color-disabled; } @if $background-color-disabled != null { - @if $background-gradient-disabled != $background-gradient { - @include background-gradient($background-color-disabled, $background-gradient-disabled); - } - @else if $background-color-disabled != $background-color { - background-color: $background-color-disabled; - } + @include background-gradient($background-color-disabled, $background-gradient-disabled); } .#{$prefix}btn-inner { @@ -780,16 +866,16 @@ .#{$prefix}frame-br, .#{$prefix}frame-tc, .#{$prefix}frame-bc { - background-image: theme-image($theme-name, 'btn/btn-#{$ui}-over-corners.gif'); + background-image: theme-background-image($theme-name, 'btn/btn-#{$ui}-over-corners.gif'); } .#{$prefix}frame-ml, .#{$prefix}frame-mr { - background-image: theme-image($theme-name, 'btn/btn-#{$ui}-over-sides.gif'); + background-image: theme-background-image($theme-name, 'btn/btn-#{$ui}-over-sides.gif'); } .#{$prefix}frame-mc { background-color: $background-color-over; - @if $background-gradient-over { - background-image: theme-image($theme-name, 'btn/btn-#{$ui}-over-bg.gif'); + @if $background-gradient-over != null { + background-image: theme-background-image($theme-name, 'btn/btn-#{$ui}-over-bg.gif'); } } } @@ -801,16 +887,16 @@ .#{$prefix}frame-br, .#{$prefix}frame-tc, .#{$prefix}frame-bc { - background-image: theme-image($theme-name, 'btn/btn-#{$ui}-focus-corners.gif'); + background-image: theme-background-image($theme-name, 'btn/btn-#{$ui}-focus-corners.gif'); } .#{$prefix}frame-ml, .#{$prefix}frame-mr { - background-image: theme-image($theme-name, 'btn/btn-#{$ui}-focus-sides.gif'); + background-image: theme-background-image($theme-name, 'btn/btn-#{$ui}-focus-sides.gif'); } .#{$prefix}frame-mc { background-color: $background-color-focus; - @if $background-gradient-focus { - background-image: theme-image($theme-name, 'btn/btn-#{$ui}-focus-bg.gif'); + @if $background-gradient-focus != null { + background-image: theme-background-image($theme-name, 'btn/btn-#{$ui}-focus-bg.gif'); } } } @@ -823,16 +909,16 @@ .#{$prefix}frame-br, .#{$prefix}frame-tc, .#{$prefix}frame-bc { - background-image: theme-image($theme-name, 'btn/btn-#{$ui}-pressed-corners.gif'); + background-image: theme-background-image($theme-name, 'btn/btn-#{$ui}-pressed-corners.gif'); } .#{$prefix}frame-ml, .#{$prefix}frame-mr { - background-image: theme-image($theme-name, 'btn/btn-#{$ui}-pressed-sides.gif'); + background-image: theme-background-image($theme-name, 'btn/btn-#{$ui}-pressed-sides.gif'); } .#{$prefix}frame-mc { background-color: $background-color-pressed; - @if $background-gradient-pressed { - background-image: theme-image($theme-name, 'btn/btn-#{$ui}-pressed-bg.gif'); + @if $background-gradient-pressed != null { + background-image: theme-background-image($theme-name, 'btn/btn-#{$ui}-pressed-bg.gif'); } } } @@ -844,16 +930,16 @@ .#{$prefix}frame-br, .#{$prefix}frame-tc, .#{$prefix}frame-bc { - background-image: theme-image($theme-name, 'btn/btn-#{$ui}-disabled-corners.gif'); + background-image: theme-background-image($theme-name, 'btn/btn-#{$ui}-disabled-corners.gif'); } .#{$prefix}frame-ml, .#{$prefix}frame-mr { - background-image: theme-image($theme-name, 'btn/btn-#{$ui}-disabled-sides.gif'); + background-image: theme-background-image($theme-name, 'btn/btn-#{$ui}-disabled-sides.gif'); } .#{$prefix}frame-mc { background-color: $background-color-disabled; - @if $background-gradient-disabled { - background-image: theme-image($theme-name, 'btn/btn-#{$ui}-disabled-bg.gif'); + @if $background-gradient-disabled != null { + background-image: theme-background-image($theme-name, 'btn/btn-#{$ui}-disabled-bg.gif'); } } } @@ -865,7 +951,7 @@ .#{$prefix}nlg { .#{$prefix}btn-#{$ui} { background-repeat: repeat-x; - background-image: theme-image($theme-name, 'btn/btn-#{$ui}-bg.gif'); + background-image: theme-background-image($theme-name, 'btn/btn-#{$ui}-bg.gif'); } } } @@ -874,7 +960,7 @@ .#{$prefix}nlg { .#{$prefix}btn-#{$ui}-over { background-repeat: repeat-x; - background-image: theme-image($theme-name, 'btn/btn-#{$ui}-over-bg.gif'); + background-image: theme-background-image($theme-name, 'btn/btn-#{$ui}-over-bg.gif'); } } } @@ -883,7 +969,7 @@ .#{$prefix}nlg { .#{$prefix}btn-#{$ui}-focus { background-repeat: repeat-x; - background-image: theme-image($theme-name, 'btn/btn-#{$ui}-focus-bg.gif'); + background-image: theme-background-image($theme-name, 'btn/btn-#{$ui}-focus-bg.gif'); } } } @@ -893,7 +979,7 @@ .#{$prefix}btn-#{$ui}-menu-active, .#{$prefix}btn-#{$ui}-pressed { background-repeat: repeat-x; - background-image: theme-image($theme-name, 'btn/btn-#{$ui}-pressed-bg.gif'); + background-image: theme-background-image($theme-name, 'btn/btn-#{$ui}-pressed-bg.gif'); } } } @@ -902,7 +988,7 @@ .#{$prefix}nlg { .#{$prefix}btn-#{$ui}-disabled { background-repeat: repeat-x; - background-image: theme-image($theme-name, 'btn/btn-#{$ui}-disabled-bg.gif'); + background-image: theme-background-image($theme-name, 'btn/btn-#{$ui}-disabled-bg.gif'); } } }