Permalink
Browse files

Merge pull request #232 from inuitcss/tkt-0204

[tools.rem] Remove `rem`-function and -mixin
  • Loading branch information...
2 parents cb13aa5 + ca51f27 commit 04abcb2cb1285a3223b23f3ef28790222e9ef906 @csshugs csshugs committed on GitHub Nov 15, 2016
@@ -98,11 +98,11 @@
========================================================================== */
.c-btn--small {
- padding: inuit-rem($inuit-global-spacing-unit-tiny) inuit-rem($inuit-global-spacing-unit-small);
+ padding: $inuit-global-spacing-unit-tiny $inuit-global-spacing-unit-small;
}
.c-btn--large {
- padding: inuit-rem($inuit-global-spacing-unit) inuit-rem($inuit-global-spacing-unit-large);
+ padding: $inuit-global-spacing-unit $inuit-global-spacing-unit-large;
}
View
@@ -23,8 +23,6 @@
* Global...............Project-wide variables and settings.
*
* TOOLS
- * Rem..................Tools for converting pixel inputs into their rem
- * equivalents.
* Font-size............A mixin which guarantees baseline-friendly line-heights.
* Clearfix.............Micro clearfix mixin.
* Hidden...............Mixin for hiding elements.
@@ -84,7 +82,6 @@
// TOOLS
-@import "tools/tools.rem";
@import "tools/tools.font-size";
@import "tools/tools.clearfix";
@import "tools/tools.hidden";
@@ -21,7 +21,7 @@ figure,
hr,
table,
fieldset {
- @include inuit-rem(margin-bottom, $inuit-global-spacing-unit);
+ margin-bottom: $inuit-global-spacing-unit;
}
@@ -30,7 +30,7 @@ fieldset {
*/
dd, ol, ul {
- @include inuit-rem(margin-left, $inuit-global-spacing-unit);
+ margin-left: $inuit-global-spacing-unit;
}
/* stylelint-enable selector-list-comma-newline-after */
View
@@ -1,33 +0,0 @@
-@import "true";
-
-@import "../settings/settings.core";
-@import "../tools/tools.rem";
-
-
-@include test-module("[function] inuit-rem") {
-
- @include test("it should convert a pixel value to it's rem equivalent") {
-
- $test: inuit-rem(18px);
- $expect: 1.125rem;
- @include assert-equal($test, $expect, "Returns the rem equivalant for pixel value");
- }
-}
-
-@include test-module("[mixin] inuit-rem") {
-
- @include test("it should output a property with a rem value converted from a pixel value") {
-
- @include assert() {
-
- @include output {
- @include inuit-rem(padding, 10px);
- }
-
- @include expect {
- padding: 10px;
- padding: 0.625rem;
- }
- }
- }
-}
View
@@ -9,7 +9,6 @@
@import 'true';
@import '_tools.font-size.scss';
-@import '_tools.rem.scss';
@import '_utilities.widths.scss';
@include report();
View
@@ -1,48 +0,0 @@
-///* ========================================================================
-// #REM
-// ======================================================================== */
-
-// Convert any px value into its rem equivalent.
-
-@function inuit-rem($value) {
-
- @if (type-of($value) == number) {
-
- @if (unit($value) != "px") {
- @error "`#{$value}` needs to be a pixel value.";
- }
-
- } @else {
- @error "`#{$value}` needs to be a number.";
- }
-
- @return $value / $inuit-global-font-size * 1rem;
-
-}
-
-
-// Mixin to create a declaration whose value is a rem unit. Also provide pixel
-// fallback.
-//
-// .simple-usage {
-// @include inuit-rem(padding, 10px);
-// }
-
-@mixin inuit-rem($property, $value) {
-
- @if (type-of($value) == number) {
-
- @if (unit($value) != "px") {
- @error "`#{$value}` needs to be a pixel value.";
- }
-
- } @else {
- @error "`#{$value}` needs to be a number.";
- }
-
- // We provide a `px` fallback for old IEs not supporting `rem` values.
- #{$property}: $value;
-
- #{$property}: inuit-rem($value);
-
-}

0 comments on commit 04abcb2

Please sign in to comment.