| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 | <!DOCTYPE html><html><head>  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  <title>The source code</title>  <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />  <script type="text/javascript" src="../resources/prettify/prettify.js"></script>  <style type="text/css">    .highlight { display: block; background-color: #ddd; }  </style>  <script type="text/javascript">    function highlight() {      document.getElementById(location.hash.replace(/#/, "")).className = "highlight";    }  </script></head><body onload="prettyPrint(); highlight();">  <pre class="prettyprint lang-js"><span id='Global_CSS-css_mixin-background-gradient'>/**</span> * Creates a background gradient. * * @param {Color} $bg-color The background color of the gradient * @param {String/List} [$type] The type of gradient to be used. Can either * be a String which is a predefined gradient, or it can can be a list of * color_stops. If none is set, it will still set the `background-color` * to the $background-color. * @param {String} [$direction=top] The direction of the gradient. Can either be * `top` or `left`. * @member Global_CSS */@mixin background-gradient($bg-color, $type: $base-gradient, $direction: top) {    background-image: none;    background-color: $bg-color;    @if $base-gradient != null and $bg-color != transparent {        //color_stops        @if type-of($type) == "list" {            @include background-image(linear-gradient($direction, $type));        }        //default gradients        @else if $type == bevel {            @include background-image(linear-gradient($direction, color_stops(                lighten($bg-color, 15%),                lighten($bg-color, 8%) 30%,                $bg-color 65%,                darken($bg-color, 6%)            )));        } @else if $type == glossy {            @include background-image(linear-gradient($direction, color_stops(lighten($bg-color, 15%), lighten($bg-color, 5%) 50%, $bg-color 51%, darken($bg-color, 5%))));        } @else if $type == recessed {            @include background-image(linear-gradient($direction, color_stops(darken($bg-color, 10%), darken($bg-color, 5%) 10%, $bg-color 65%, lighten($bg-color, .5%))));        } @else if $type == matte {            @include background-image(linear-gradient($direction, color_stops(lighten($bg-color, 3%), darken($bg-color, 4%))));        } @else if $type == matte-reverse {            @include background-image(linear-gradient($direction, color_stops(darken($bg-color, 6%), lighten($bg-color, 4%))));        } @else if $type == glossy-toolbar {            @include background-image(linear-gradient($direction, color_stops(#F0F5FA, #DAE6F4 2%, #CEDDEF)));        }        //ext3.3 gradients        @else if $type == panel-header {            @include background-image(linear-gradient($direction, color_stops(                adjust-color($bg-color, $hue: -0.857deg, $saturation: -1.63%, $lightness: 3.529%),                adjust-color($bg-color, $hue: 0.158deg, $saturation: -1.21%, $lightness: 0.392%) 45%,                adjust-color($bg-color, $hue: 1.154deg, $saturation: 0.607%, $lightness: -7.647%) 46%,                adjust-color($bg-color, $hue: 1.154deg, $saturation: 0.607%, $lightness: -7.647%) 50%,                adjust-color($bg-color, $hue: 1.444deg, $saturation: -1.136%, $lightness: -4.706%) 51%,                $bg-color            )));        } @else if $type == tabbar {            @include background-image(linear-gradient($direction, color_stops(                adjust-color($bg-color, $hue: 0.0deg, $saturation: 1.604%, $lightness: 4.706%),                $bg-color            )));        } @else if $type == tab {            @include background-image(linear-gradient($direction, color_stops(                adjust-color($bg-color, $hue: 1.382deg, $saturation: -18.571%, $lightness: -4.902%),                adjust-color($bg-color, $hue: 0.43deg, $saturation: -10.311%, $lightness: -2.157%) 25%,                $bg-color 45%            )));        } @else if $type == tab-active {            @include background-image(linear-gradient($direction, color_stops(                adjust-color($bg-color, $hue: -212.903deg, $saturation: -88.571%, $lightness: 6.863%),                adjust-color($bg-color, $hue: 0.43deg, $saturation: -6.753%, $lightness: 4.706%) 25%,                $bg-color 45%            )));        } @else if $type == tab-over {            @include background-image(linear-gradient($direction, color_stops(                adjust-color($bg-color, $hue: 4.462deg, $saturation: -9.524%, $lightness: -3.725%),                adjust-color($bg-color, $hue: 2.272deg, $saturation: 0.0%, $lightness: -1.569%) 25%,                $bg-color 45%            )));        } @else if $type == tab-disabled {            @include background-image(linear-gradient($direction, color_stops(                $bg-color,                adjust-color($bg-color, $hue: -0.267deg, $saturation: 18.571%, $lightness: 2.941%)            )));        } @else if $type == grid-header {            @include background-image(linear-gradient($direction, color_stops(                adjust-color($bg-color, $hue: 0deg, $saturation: 0%, $lightness: 20.392%),                adjust-color($bg-color, $hue: 220.0deg, $saturation: 5.66%, $lightness: 12.353%)            )));        } @else if $type == grid-header-over {            @include background-image(linear-gradient($direction, color_stops(                adjust-color($bg-color, $hue: 0.175deg, $saturation: 0.967%, $lightness: 14.118%),                adjust-color($bg-color, $hue: 0.175deg, $saturation: 0.967%, $lightness: 14.118%) 39%,                adjust-color($bg-color, $hue: 0.372deg, $saturation: 0.101%, $lightness: 10.196%) 40%,                adjust-color($bg-color, $hue: 0.372deg, $saturation: 0.101%, $lightness: 10.196%)            )));        } @else if $type == grid-row-over {            @include background-image(linear-gradient($direction, color_stops(                adjust-color($bg-color, $hue: 0.175deg, $saturation: 0.967%, $lightness: 14.118%),                $bg-color            )));        } @else if $type == grid-cell-special {            @include background-image(linear-gradient(left, color_stops(                $bg-color,                darken($bg-color, 5)            )));        } @else if $type == glossy-button or $type == glossy-button-disabled {            @include background-image(linear-gradient($direction, color_stops(                $bg-color,                adjust-color($bg-color, $hue: 0deg, $saturation: 0%, $lightness: -2.353%) 48%,                adjust-color($bg-color, $hue: 0deg, $saturation: 0%, $lightness: -11.373%) 52%,                adjust-color($bg-color, $hue: 0deg, $saturation: 0%, $lightness: -9.412%)            )));        } @else if $type == glossy-button-over {            @include background-image(linear-gradient($direction, color_stops(                $bg-color,                adjust-color($bg-color, $hue: 1.754deg, $saturation: 0.0%, $lightness: -2.157%) 48%,                adjust-color($bg-color, $hue: 5.833deg, $saturation: -35.135%, $lightness: -9.216%) 52%,                adjust-color($bg-color, $hue: 5.833deg, $saturation: -27.273%, $lightness: -7.647%)            )));        } @else if $type == glossy-button-pressed {            @include background-image(linear-gradient($direction, color_stops(                $bg-color,                adjust-color($bg-color, $hue: -1.839deg, $saturation: -2.18%, $lightness: 2.157%) 48%,                adjust-color($bg-color, $hue: -2.032deg, $saturation: 37.871%, $lightness: -4.706%) 52%,                adjust-color($bg-color, $hue: -1.641deg, $saturation: 36.301%, $lightness: -2.549%)            )));        }    }}</pre></body></html>
 |