Files
ionic-framework/src/themes/ionic.mixins.scss
Brandy Carney 6ceec7ad4d feat(grid): improve grid to a column layout with more flexibility (#10485)
The old grid is still supported but will be deprecated in the future.

closes #6050 closes #7508
2017-02-21 17:10:16 -05:00

70 lines
2.0 KiB
SCSS

// Appearance
// --------------------------------------------------
@mixin appearance($val) {
-moz-appearance: $val;
-ms-appearance: $val;
-webkit-appearance: $val;
appearance: $val;
}
// Input Placeholder
// --------------------------------------------------
@mixin placeholder($color: #999, $text-indent: 0) {
&::-moz-placeholder { // Firefox 19+
color: $color;
}
&:-ms-input-placeholder {
color: $color;
}
&::-webkit-input-placeholder {
// Safari placeholder margin issue
text-indent: $text-indent;
color: $color;
}
}
// SVG Background Image Mixin
// --------------------------------------------------
@mixin svg-background-image($svg) {
$url: url-encode($svg);
background-image: url("data:image/svg+xml;charset=utf-8,#{$url}");
}
// Check that the given map values are in ascending order
// ---------------------------------------------------------------------------------
@mixin assert-ascending($map, $map-name) {
$prev-key: null;
$prev-num: null;
@each $key, $num in $map {
@if $prev-num == null {
// Do nothing
} @else if not comparable($prev-num, $num) {
@warn "Potentially invalid value for #{$map-name}: This map must be in ascending order, but key '#{$key}' has value #{$num} whose unit makes it incomparable to #{$prev-num}, the value of the previous key '#{$prev-key}' !";
} @else if $prev-num >= $num {
@warn "Invalid value for #{$map-name}: This map must be in ascending order, but key '#{$key}' has value #{$num} which isn't greater than #{$prev-num}, the value of the previous key '#{$prev-key}' !";
}
$prev-key: $key;
$prev-num: $num;
}
}
// Check that the first value in the given map starts at 0
// ---------------------------------------------------------------------------------
@mixin assert-starts-at-zero($map, $map-name) {
$values: map-values($map);
$first-value: nth($values, 1);
@if $first-value != 0 {
@warn "First value in `#{$map-name}` must start at 0, but starts at #{$first-value}.";
}
}