summaryrefslogtreecommitdiffstats
path: root/debian/missing-sources/bourbon/app/assets/stylesheets/helpers/_convert-units.scss
diff options
context:
space:
mode:
Diffstat (limited to 'debian/missing-sources/bourbon/app/assets/stylesheets/helpers/_convert-units.scss')
-rw-r--r--debian/missing-sources/bourbon/app/assets/stylesheets/helpers/_convert-units.scss26
1 files changed, 26 insertions, 0 deletions
diff --git a/debian/missing-sources/bourbon/app/assets/stylesheets/helpers/_convert-units.scss b/debian/missing-sources/bourbon/app/assets/stylesheets/helpers/_convert-units.scss
new file mode 100644
index 0000000..8b11f71
--- /dev/null
+++ b/debian/missing-sources/bourbon/app/assets/stylesheets/helpers/_convert-units.scss
@@ -0,0 +1,26 @@
+//************************************************************************//
+// Helper function for str-to-num fn.
+// Source: http://sassmeister.com/gist/9647408
+//************************************************************************//
+@function _convert-units($number, $unit) {
+ @if $output-bourbon-deprecation-warnings == true {
+ @warn "[Bourbon] [Deprecation] `_convert-units` is deprecated and will " +
+ "be removed in 5.0.0.";
+ }
+
+ $strings: "px", "cm", "mm", "%", "ch", "pica", "in", "em", "rem", "pt", "pc", "ex", "vw", "vh", "vmin", "vmax", "deg", "rad", "grad", "turn";
+ $units: 1px, 1cm, 1mm, 1%, 1ch, 1pica, 1in, 1em, 1rem, 1pt, 1pc, 1ex, 1vw, 1vh, 1vmin, 1vmax, 1deg, 1rad, 1grad, 1turn;
+ $index: index($strings, $unit);
+
+ @if not $index {
+ @warn "Unknown unit `#{$unit}`.";
+ @return false;
+ }
+
+ @if type-of($number) != "number" {
+ @warn "`#{$number} is not a number`";
+ @return false;
+ }
+
+ @return $number * nth($units, $index);
+}