]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Rename hasvalue function to has-value, closes #7132
authorGeoff Kimball <geoff@zurb.com>
Mon, 23 Nov 2015 22:16:17 +0000 (14:16 -0800)
committerGeoff Kimball <geoff@zurb.com>
Mon, 23 Nov 2015 22:16:17 +0000 (14:16 -0800)
docs/pages/sass-functions.md
scss/components/_off-canvas.scss
scss/forms/_input-group.scss
scss/forms/_text.scss
scss/util/_selector.scss
scss/util/_value.scss
test/sass/_value.scss

index 298899a8c2ded8fbfcedb06464093cea0ceda9e0..e1d8f2de06e024339a012313339eab5d4c487eaf 100644 (file)
@@ -8,7 +8,7 @@ sass:
 ---
 
 ## Importing
-
 All of Foundation's Sass utilities are in the folder `scss/util`, and broken up into multiple files by category. You can import every utility file at once using this line of code:
 
 ```scss
index 7288c7f7b9a499be8e22b950271dce26c57d6274..2dd05b9ac361708aa7591d1788462e034ea88864 100644 (file)
@@ -68,7 +68,7 @@ $maincontent-shadow: 0 0 10px rgba($black, 0.5);
     backface-visibility: hidden;
     z-index: 1;
 
-    @if hasvalue($maincontent-shadow) {
+    @if has-value($maincontent-shadow) {
       box-shadow: $maincontent-shadow;
     }
   }
index 73b68e4acc8313aeff2a555f1d80ff713d20ad85..4ba26c76355e51f91c0c24e2b3ec4893f1a2d0fd 100644 (file)
@@ -44,7 +44,7 @@ $input-prefix-padding: 1rem !default;
     color: $input-prefix-color;
     border: $input-prefix-border;
 
-    @if hasvalue($input-prefix-border) {
+    @if has-value($input-prefix-border) {
       &:first-child {
         border-#{$global-right}: 0;
       }
index db475993c9eff6b18f4d93da4b83d2fa403b5aea..8a2a1da9a610a619205d175a10b3ad54677b756e 100644 (file)
@@ -80,7 +80,7 @@ $input-radius: $global-radius !default;
   box-shadow: $input-shadow;
   border-radius: $input-radius;
 
-  @if hasvalue($input-transition) {
+  @if has-value($input-transition) {
     transition: $input-transition;
   }
 
@@ -91,7 +91,7 @@ $input-radius: $global-radius !default;
     outline: none;
     box-shadow: $input-shadow-focus;
 
-    @if hasvalue($input-transition) {
+    @if has-value($input-transition) {
       transition: $input-transition;
     }
   }
index ce0e61fbed6cc79e9be229ebbfa81bc51b998865..65b00b4fa1fa0038700f5332f3259cc8a41cd113 100644 (file)
@@ -28,7 +28,7 @@
     url
     color;
 
-  @if not hasvalue($types) {
+  @if not has-value($types) {
     $types: $all-types;
   }
 
index 7d4b0f0d3dac68dbff1834668555f34857da8cdd..54c5443b86c5edbcc18eea352cf2a8f4a78f91e4 100644 (file)
@@ -6,12 +6,12 @@
 /// @group functions
 ////
 
-/// Determine if a value is not falsey, in CSS terms. Falsey values are `null`, `none`, `0` with any unit, or an empty list.
+/// Determine if a value is not falsey, in CSS terms. Falsey values are `null`, `none`, `0` with any unit, or an empty list. **This function was originally named `hasvalue()`. The old name for the function will be removed in Foundation 6.1.**
 ///
 /// @param {Mixed} $val - Value to check.
 ///
 /// @returns {Boolean} `true` if `$val` is not falsey.
-@function hasvalue($val) {
+@function has-value($val) {
   @if $val == null or $val == none {
     @return false;
   }
   @return true;
 }
 
+// Remove this in 6.1.
+@function hasvalue($val) {
+  @warn 'The function hasvalue() was renamed to has-value(). The old function name will be removed in Foundation 6.1.';
+  @return has-value($val);
+}
+
 /// Determine a top/right/bottom/right value on a padding, margin, etc. property, no matter how many values were passed in. Use this function if you need to know the specific side of a value, but don't know if the value is using a shorthand format.
 ///
 /// @param {List|Number} $val - Value to analyze. Should be a shorthand sizing property, e.g. "1em 2em 1em"
index d7a7e68897c6caa647a29c6168ad3786426d87a4..cd69a608eed518dac32cc79d52a5173584253805 100755 (executable)
@@ -2,10 +2,10 @@
 
 @include describe('Has Value') {
   @include it('returns false if the value is not falsey') {
-    $boolean: hasvalue(true);
-    $number:  hasvalue(1px);
-    $color:   hasvalue(#000);
-    $list:    hasvalue(1px solid black);
+    $boolean: has-value(true);
+    $number:  has-value(1px);
+    $color:   has-value(#000);
+    $list:    has-value(1px solid black);
     
     @include should(expect($boolean), to(be(true)));
     @include should(expect($number),  to(be(true)));
     @include should(expect($list),    to(be(true)));
   }
   @include it('returns false if the value is falsey') {
-    $zero:   hasvalue(0px);
-    $null:   hasvalue(null);
-    $none:   hasvalue(none);
-    $empty:  hasvalue(());
+    $zero:   has-value(0px);
+    $null:   has-value(null);
+    $none:   has-value(none);
+    $empty:  has-value(());
 
     @include should(expect($zero),  to(be(false)));
     @include should(expect($null),  to(be(false)));