From 841b493df66bf03921efd1b05c147863c513bb50 Mon Sep 17 00:00:00 2001 From: squidfunk Date: Thu, 8 Sep 2016 22:29:26 +0200 Subject: [PATCH] Adjusted error handling in px2em --- src/assets/stylesheets/helpers/_px2em.scss | 16 ++++++++++++---- src/assets/stylesheets/themes/_default.scss | 12 ------------ 2 files changed, 12 insertions(+), 16 deletions(-) delete mode 100644 src/assets/stylesheets/themes/_default.scss diff --git a/src/assets/stylesheets/helpers/_px2em.scss b/src/assets/stylesheets/helpers/_px2em.scss index da40340cc..0756797c4 100644 --- a/src/assets/stylesheets/helpers/_px2em.scss +++ b/src/assets/stylesheets/helpers/_px2em.scss @@ -35,9 +35,13 @@ /// @function px2em($size, $base: 16px) { @if unit($size) == px { - @return ($size / $base) * 1.0em; + @if unit($base) == px { + @return ($size / $base) * 1.0em; + } @else { + @error "Invalid base: #{$base} - unit must be 'px'"; + } } @else { - @error "Invalid unit: #{$size} - must be px"; + @error "Invalid size: #{$size} - unit must be 'px'"; } } @@ -52,8 +56,12 @@ /// @function px2rem($size, $base: 10px) { @if unit($size) == px { - @return ($size / $base) * 1.0rem; + @if unit($base) == px { + @return ($size / $base) * 1.0rem; + } @else { + @error "Invalid base: #{$base} - unit must be 'px'"; + } } @else { - @error "Invalid unit: #{$size} - must be px"; + @error "Invalid size: #{$size} - unit must be 'px'"; } } diff --git a/src/assets/stylesheets/themes/_default.scss b/src/assets/stylesheets/themes/_default.scss deleted file mode 100644 index a64631714..000000000 --- a/src/assets/stylesheets/themes/_default.scss +++ /dev/null @@ -1,12 +0,0 @@ -// ---------------------------------------------------------------------------- -// Theme colors -// ---------------------------------------------------------------------------- - -// Headlines -// $md-theme-h1-color: $md-color-black--light; -// $md-theme-h2-color: $md-color-black; -// $md-theme-h3-color: $md-color-black; -// $md-theme-h4-color: $md-color-black; -// $md-theme-h5-6-color: $md-color-black--light; -// -// $md-theme-hr-color: $md-color-black--lighter;