2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6 * Copyright © 2017 Amdocs
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
21 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
27 $box-sizing-prefix: webkit moz spec;
28 $border-radius-prefix: webkit spec;
29 $box-shadow-radius-prefix: webkit moz spec;
30 $text-shadow-radius-prefix: spec;
31 $text-shadow-prefix: spec;
32 $box-shadow-prefix: all;
33 $linear-gradient-prefix: all;
34 $transition-prefix: webkit moz o spec;
35 $flex-prefix: webkit spec;
36 $browserPrefixes: webkit moz o ms;
38 @mixin prefix($property, $value, $prefixeslist: 'all') {
39 @if $prefixeslist == all {
40 -webkit-#{$property}: $value;
41 -moz-#{$property}: $value;
42 -ms-#{$property}: $value;
43 -o-#{$property}: $value;
46 @each $prefix in $prefixeslist {
47 @if $prefix == webkit {
48 -webkit-#{$property}: $value;
49 } @else if $prefix == moz {
50 -moz-#{$property}: $value;
51 } @else if $prefix == ms {
52 -ms-#{$property}: $value;
53 } @else if $prefix == o {
54 -o-#{$property}: $value;
55 } @else if $prefix == spec {
58 @warn "No such prefix: #{$prefix}";
65 @mixin value-suffix-with-range($property, $valuesuffix, $from, $to, $prefixeslist) {
67 @if $prefixeslist == all {
68 #{property} : -webkit-#{$valuesuffix}($from, $to);
69 #{property} : -moz-#{$valuesuffix}($from, $to);
70 #{property} : -o-#{$valuesuffix}($from, $to);
71 #{property} : -ms-#{$valuesuffix}($from, $to);
74 @each $prefix in $prefixeslist {
75 @if $prefix == webkit {
76 #{property} : -webkit-#{$valuesuffix}($from, $to);
77 } @else if $prefix == moz {
78 #{property} : -moz-#{$valuesuffix}($from, $to);
79 } @else if $prefix == ms {
80 #{property} : -ms-#{$valuesuffix}($from, $to);
81 } @else if $prefix == o {
82 #{property} : -o-#{$valuesuffix}($from, $to);
84 @warn "No such prefix: #{$prefix}";
91 @mixin box-sizing($value: border-box) {
92 @include prefix(box-sizing, $value, $box-sizing-prefix);
95 /* Borders & Shadows */
96 @mixin box-shadow($value) {
97 @include prefix(box-shadow, $value, $box-shadow-radius-prefix);
100 @mixin text-shadow($value) {
101 @include prefix(text-shadow, $value, $text-shadow-radius-prefix);
104 @mixin border-radius($value, $positions: all) {
105 @if ($positions == all) {
106 @include prefix(border-radius, $value, $border-radius-prefix);
108 @each $position in $positions {
109 @include prefix(border-#{$position}-radius, $value, $border-radius-prefix);
115 @mixin transition($value) {
116 @include prefix(transition, $value, $transition-prefix);
120 @mixin opacity($alpha) {
121 $ie-opacity: round($alpha * 100);
123 filter: unquote("alpha(opacity = #{$ie-opacity})");
129 text-overflow: ellipsis;
132 display: inline-block;
135 @mixin gradient($from, $to) {
136 /* fallback/image non-cover color */
137 background-color: $from;
138 background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from($from), to($to));
139 @include value-suffix-with-range(background-color, linear-gradient, $from, $to, $linear-gradient-prefix);
142 /* Vertical placement of multuple lines of text */
143 @mixin vertical-text($height) {
146 margin-top: -$height/2;
149 @mixin multiline-ellipsis($height, $lineheight, $ellipsiswidth: 3em) {
151 $ellipsiswidth: 3em !default;
156 line-height: $lineheight;
166 .ellipsis > *:first-child {
179 width: $ellipsiswidth;
180 margin-left: -$ellipsiswidth;
188 @mixin text-vertical-align($align: middle) {
193 vertical-align: $align;
198 @mixin center-element($width) {
204 @mixin center-content($width) {
206 @include center-element($width);
210 /* transform-rotate */
212 // Defines a 2D rotation, the angle is specified in the parameter
214 // $deg - angle in degrees
215 @mixin transform-rotate($deg) {
216 transform: rotate($deg + deg); /* IE10 and Mozilla */
217 -ms-transform: rotate($deg + deg); /* IE 9 */
218 -webkit-transform: rotate($deg + deg); /* Safari and Chrome */
221 /* transform-translate */
223 // Defines a 2D rotation, the angle is specified in the parameter
225 // $deg - angle in degrees
226 @mixin transform-translate($x, $y) {
227 transform: translate($x, $y); /* IE10 and Mozilla */
228 -ms-transform: translate($x, $y); /* IE 9 */
229 -webkit-transform: translate($x, $y); /* Safari and Chrome */
232 /* transform-scale */
234 // Defines a 2D scale transformation, changing the elements width and height
239 @mixin transform-scale($width, $height) {
240 transform: scale($width, $height); /* IE10 and Mozilla */
241 -ms-transform: scale($width, $height); /* IE 9 */
242 -webkit-transform: scale($width, $height); /* Safari and Chrome */
245 @mixin scrollable() {
246 ::-webkit-scrollbar {
252 @mixin keyframe-animation($animationType, $properties, $fromValue, $toValue) {
254 @keyframes #{$animationType} {
257 @each $property in $properties {
258 #{$property}: nth($fromValue, $startIndex);
259 $startIndex: $startIndex + 1;
264 @each $property in $properties {
265 #{$property}: nth($toValue, $startIndex);
266 $startIndex: $startIndex + 1;
270 @-moz-keyframes #{$animationType}{
274 @each $property in $properties {
275 #{$property}: nth($fromValue, $startIndex);
276 $startIndex: $startIndex + 1;
281 @each $property in $properties {
282 #{$property}: nth($toValue, $startIndex);
283 $startIndex: $startIndex + 1;
287 @-webkit-keyframes #{$animationType} {
288 /* Safari and Chrome */
291 @each $property in $properties {
292 #{$property}: nth($fromValue, $startIndex);
293 $startIndex: $startIndex + 1;
298 @each $property in $properties {
299 #{$property}: nth($toValue, $startIndex);
300 $startIndex: $startIndex + 1;
304 @-o-keyframes #{$animationType} {
308 @each $property in $properties {
309 #{$property}: nth($fromValue, $startIndex);
310 $startIndex: $startIndex + 1;
315 @each $property in $properties {
316 #{$property}: nth($toValue, $startIndex);
317 $startIndex: $startIndex + 1;