@mixin extjs-box-scroller-ui(
$ui: null,
$type: null,
$horizontal-width: 16px,
$horizontal-height: 16px,
$vertical-width: 16px,
$vertical-height: 16px,
$top-margin: 0,
$right-margin: 0,
$bottom-margin: 0,
$left-margin: 0,
$top-background-image: null,
$right-background-image: null,
$bottom-background-image: null,
$left-background-image: null,
$glyph-color: null,
$top-glyph: null,
$right-glyph: null,
$bottom-glyph: null,
$left-glyph: null,
$horizontal-border-color: $base-color,
$horizontal-border-width: 0,
$vertical-border-color: $base-color,
$vertical-border-width: 0,
$container-padding: 0,
$cursor: pointer,
$cursor-disabled: default,
$align: middle,
$align-offset: 0,
$opacity: 0.5,
$opacity-over: 0.8,
$opacity-pressed: 1,
$opacity-disabled: 0.25,
$classic: false,
$include-horizontal: true,
$include-vertical: true,
$include-background-images: true
) {
@if is-null($top-background-image) {
$top-background-image: #{$type}/#{$ui}-scroll-top;
}
@if is-null($right-background-image) {
$right-background-image: #{$type}/#{$ui}-scroll-right;
}
@if is-null($bottom-background-image) {
$bottom-background-image: #{$type}/#{$ui}-scroll-bottom;
}
@if is-null($left-background-image) {
$left-background-image: #{$type}/#{$ui}-scroll-left;
}
.#{$prefix}#{$type}-#{$ui}-scroller {
.#{$prefix}box-scroller-body-horizontal {
margin-left: max($horizontal-width + horizontal($left-margin) - left($container-padding), 0);
}
@if $include-rtl {
&.#{$prefix}rtl .#{$prefix}box-scroller-body-horizontal {
margin-left: 0;
margin-right: max($horizontal-width + horizontal($left-margin) - left($container-padding), 0);
}
}
}
.#{$prefix}#{$type}-#{$ui}-vertical-scroller {
.#{$prefix}box-scroller-body-vertical {
margin-top: max($vertical-height + vertical($top-margin) - top($container-padding), 0);
}
}
.#{$prefix}box-scroller-#{$type}-#{$ui} {
cursor: $cursor;
color: $glyph-color;
@if not $classic {
@if $opacity != 1 {
@include opacity($opacity);
}
@if $opacity != 1 or $opacity-over != 1 {
&.#{$prefix}box-scroller-hover {
@include opacity($opacity-over);
}
}
@if $opacity != 1 or $opacity-pressed != 1 {
&.#{$prefix}box-scroller-pressed {
@include opacity($opacity-pressed);
}
}
}
&.#{$prefix}box-scroller-disabled {
@if $opacity-disabled != 1 {
@include opacity($opacity-disabled);
}
@if not is-null($cursor-disabled) {
cursor: $cursor-disabled;
}
}
@if $include-horizontal {
&.#{$prefix}box-scroller-left,
&.#{$prefix}box-scroller-right {
width: $horizontal-width;
@if $align != stretch {
height: $horizontal-height;
}
@if $horizontal-border-width != 0 {
border-style: solid;
border-color: $horizontal-border-color;
border-width: $horizontal-border-width;
}
@if $align == begin {
top: 0;
} @else if $align == middle {
top: 50%;
margin-top: -(floor($horizontal-height / 2)) + $align-offset;
} @else if $align == end {
bottom: 0;
} @else if $align == stretch {
top: 0;
bottom: 0;
}
}
&.#{$prefix}box-scroller-left {
@if $align == middle {
margin-left: left($left-margin);
margin-right: right($left-margin);
margin-bottom: bottom($left-margin);
} @else {
margin: $left-margin;
}
@if $enable-font-icons and ($left-glyph != null) {
@include font-icon($left-glyph, $line-height: $horizontal-height);
} @else if $include-background-images {
background-image: theme-background-image($left-background-image);
}
@if $classic {
background-position: -$horizontal-width 0;
&.#{$prefix}box-scroller-hover {
background-position: 0 0;
}
}
}
&.#{$prefix}box-scroller-right {
@if $align == middle {
margin-left: left($right-margin);
margin-right: right($right-margin);
margin-bottom: bottom($right-margin);
} @else {
margin: $right-margin;
}
@if $enable-font-icons and ($right-glyph != null) {
@include font-icon($right-glyph, $line-height: $horizontal-height);
} @else if $include-background-images {
background-image: theme-background-image($right-background-image);
}
@if $classic {
background-position: 0 0;
&.#{$prefix}box-scroller-hover {
background-position: -$horizontal-width 0;
}
}
}
}
@if $include-vertical {
&.#{$prefix}box-scroller-top,
&.#{$prefix}box-scroller-bottom {
height: $vertical-height;
@if $align != stretch {
width: $vertical-width;
}
@if $vertical-border-width != 0 {
border-style: solid;
border-color: $vertical-border-color;
border-width: $vertical-border-width;
}
@if $align == begin {
left: 0;
} @else if $align == middle {
left: 50%;
margin-left: -(floor($vertical-width / 2)) + $align-offset;
} @else if $align == end {
right: 0;
} @else if $align == stretch {
left: 0;
right: 0;
}
}
&.#{$prefix}box-scroller-top {
@if $align == middle {
margin-top: top($top-margin);
margin-right: right($top-margin);
margin-bottom: bottom($top-margin);
} @else {
margin: $top-margin;
}
@if $enable-font-icons and ($top-glyph != null) {
@include font-icon($top-glyph, $line-height: $vertical-height);
} @else if $include-background-images {
background-image: theme-background-image($top-background-image);
}
@if $classic {
background-position: 0 (-$vertical-height);
&.#{$prefix}box-scroller-hover {
background-position: 0 0;
}
}
}
&.#{$prefix}box-scroller-bottom {
@if $align == middle {
margin-top: top($bottom-margin);
margin-right: right($bottom-margin);
margin-bottom: bottom($bottom-margin);
} @else {
margin: $bottom-margin;
}
@if $enable-font-icons and ($bottom-glyph != null) {
@include font-icon($bottom-glyph, $line-height: $vertical-height);
} @else if $include-background-images {
background-image: theme-background-image($bottom-background-image);
}
@if $classic {
background-position: 0 0;
&.#{$prefix}box-scroller-hover {
background-position: 0 (-$vertical-height);
}
}
}
}
}
}