123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303 |
- /**
- * generates base style rules for both tabs and buttons
- *
- * @param {string} [$base-cls='button']
- *
- * @param {string} [$btn-display=inline-block]
- *
- * @param {boolean} [$include-arrows=true]
- *
- * @param {boolean} [$flexbox=true]
- *
- * @member Ext.button.Button
- * @private
- */
- @mixin extjs-button-base(
- $base-cls: 'btn',
- $btn-display: inline-block,
- $include-arrows: true,
- $flexbox: true
- ) {
- .#{$prefix}#{$base-cls} {
- display: $btn-display;
- outline: 0;
- cursor: pointer;
- white-space: nowrap;
- text-decoration: none;
- vertical-align: top;
- overflow: hidden;
- // buttons are position:relative because they may contain an absolutely positioned
- // pseudo element for imitating box-shadow in IE8 when used in a segmented button
- // see extjs-button-ui
- position: relative;
- > .#{$prefix}frame {
- height: 100%;
- width: 100%;
- }
- }
- .#{$prefix}#{$base-cls}-wrap {
- height: 100%;
- width: 100%;
- @if $flexbox {
- @include ext-box;
- @include ext-box-align(stretch);
- &.#{$prefix}btn-arrow-bottom,
- &.#{$prefix}btn-split-bottom {
- @include ext-box-orient(vertical);
- }
- @if $include-ie {
- .#{$prefix}ie9m & {
- display: table;
- border-spacing: 0;
- }
- }
- } @else {
- display: table;
- border-spacing: 0;
- }
- }
- .#{$prefix}#{$base-cls}-button {
- white-space: nowrap;
- line-height: 0;
- // this element must be position:relative so that the split line can be absolutely
- // positioned inside of it
- position: relative;
- @if $flexbox {
- @include ext-box;
- @include ext-box-align(center);
- @include ext-box-flex;
- &.#{$prefix}#{$base-cls}-icon-top,
- &.#{$prefix}#{$base-cls}-icon-bottom {
- @include ext-box-orient(vertical);
- @include ext-box-align(stretch);
- @include ext-box-pack(center);
- @if $include-ie {
- // Button is not correctly sized horizontally in IE10 and 11
- // when icon is placed above/below
- .#{$prefix}ie10p & {
- overflow: hidden;
- }
- }
- }
- @if $include-ie {
- .#{$prefix}ie9m & {
- display: table-cell;
- vertical-align: middle;
- }
- }
- } @else {
- display: table-cell;
- vertical-align: middle;
- }
- }
- .#{$prefix}#{$base-cls}-inner {
- overflow: hidden;
- text-overflow: ellipsis;
- @if $flexbox {
- -ms-flex-negative: 1;
- display: block;
- @if $include-ie {
- .#{$prefix}ie9m & {
- display: inline-block;
- vertical-align: middle;
- }
- }
- } @else {
- display: inline-block;
- vertical-align: middle;
- }
- .#{$prefix}#{$base-cls}-icon.#{$prefix}#{$base-cls}-no-text > & {
- display: none;
- }
- }
- .#{$prefix}#{$base-cls}-icon-el {
- display: none;
- vertical-align: middle;
- text-align: center;
- background-position: center center;
- background-repeat: no-repeat;
- @if $flexbox {
- flex-shrink: 0;
- .#{$prefix}#{$base-cls}-icon > & {
- display: block;
- }
- @if $include-ie {
- .#{$prefix}ie9m .#{$prefix}#{$base-cls}-icon-left > &,
- .#{$prefix}ie9m .#{$prefix}#{$base-cls}-icon-right > & {
- display: inline-block;
- }
- }
- } @else {
- .#{$prefix}#{$base-cls}-icon > & {
- display: inline-block;
- }
- .#{$prefix}#{$base-cls}-icon-top > &,
- .#{$prefix}#{$base-cls}-icon-bottom > & {
- display: block;
- }
- }
- }
- .#{$prefix}#{$base-cls}-button-center {
- @if $include-ie {
- .#{$prefix}ie9m & {
- text-align: center;
- }
- }
- @if $flexbox {
- @include ext-box-pack(center);
- }
- &.#{$prefix}#{$base-cls}-icon-top,
- &.#{$prefix}#{$base-cls}-icon-bottom {
- text-align: center;
- }
- }
- .#{$prefix}#{$base-cls}-button-left {
- text-align: left;
- @if $flexbox {
- @include ext-box-pack(start);
- }
- }
- @if $include-rtl {
- .#{$prefix}rtl.#{$prefix}#{$base-cls}-button-left {
- text-align: right;
- }
- }
- .#{$prefix}#{$base-cls}-button-right {
- text-align: right;
- @if $flexbox {
- @include ext-box-pack(end);
- }
- }
- @if $include-rtl {
- .#{$prefix}rtl.#{$prefix}#{$base-cls}-button-right {
- text-align: left;
- }
- }
- @if $include-arrows {
- .#{$prefix}#{$base-cls}-arrow:after,
- .#{$prefix}#{$base-cls}-split:after {
- display: block;
- background-repeat: no-repeat;
- content: '';
- // pseudo elements don't match wildcard selectors, so ".x-border-box *" will not apply
- // to this element
- box-sizing: border-box;
- -moz-box-sizing: border-box;
- -ms-box-sizing: border-box;
- -webkit-box-sizing: border-box;
- text-align: center;
- }
- .#{$prefix}#{$base-cls}-arrow-right:after,
- .#{$prefix}#{$base-cls}-split-right:after {
- background-position: right center;
- @if $flexbox {
- @include ext-box;
- @include ext-box-align(center);
- @include ext-box-pack(center);
- @if $include-ie {
- .#{$prefix}ie9m & {
- display: table-cell;
- vertical-align: middle;
- }
- }
- } @else {
- display: table-cell;
- vertical-align: middle;
- }
- }
- @if $include-rtl {
- .#{$prefix}rtl {
- &.#{$prefix}#{$base-cls}-arrow-right:after,
- &.#{$prefix}#{$base-cls}-split-right:after {
- background-position: left center;
- }
- }
- }
- .#{$prefix}#{$base-cls}-arrow-bottom:after,
- .#{$prefix}#{$base-cls}-split-bottom:after {
- background-position: center bottom;
- // when this pseudo el is display:table-row (with no table-cell inside) in needs
- // content other than emtpy or space in order to render in some browsers (IE8-11),
- // so use non-breaking space
- content: '\00a0';
- // line-height:0 prevents the pseudo el from inheriting line-height and being
- // taller than specified by $icon-size.
- line-height: 0;
- @if $flexbox {
- @if $include-ie {
- .#{$prefix}ie9m & {
- display: table-row;
- }
- }
- } @else {
- display: table-row;
- }
- }
- // placeholder pseudo element for split line when line is not contained in arrow image
- .#{$prefix}#{$base-cls}-split-right > .#{$prefix}btn-button:after {
- position: absolute;
- display: block;
- top: -100%;
- right: 0;
- height: 300%;
- content: '';
- }
- @if $include-rtl {
- .#{$prefix}rtl.#{$prefix}#{$base-cls}-split-right > .#{$prefix}btn-button:after {
- left: 0;
- right: auto;
- }
- }
- // placeholder pseudo element for split line when line is not contained in arrow image
- .#{$prefix}#{$base-cls}-split-bottom > .#{$prefix}btn-button:after {
- position: absolute;
- display: block;
- bottom: 0;
- left: -100%;
- font-size: 0;
- width: 300%;
- content: '';
- }
- }
- .#{$prefix}#{$base-cls}-mc {
- // buttons and tabs can have a focus outline on the btnWrap element. The default
- // overflow:hidden styling of the frame body hides the outline, so override it to
- // overflow:visible.
- overflow: visible;
- }
- }
|