]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Sass lint: use "stroustrup" as brace style convention
authorNicolas Coden <nicolas@ncoden.fr>
Tue, 15 Nov 2016 17:37:40 +0000 (18:37 +0100)
committerNicolas Coden <nicolas@ncoden.fr>
Tue, 15 Nov 2016 18:16:39 +0000 (19:16 +0100)
Sass lint: use "stroustrup" instead of "1TBS" as brace style convention.
See: https://en.wikipedia.org/wiki/Indent_style

Pros:
- Easily add or remove lines within a `@if`/`@else if`/`@else` block,
without having to rearrange the braces.
- Able to add comments that describe a condition (`@if (...)`, `@else
if (...)` or `@else`) or the whole conditional block.
- Clearly separate the different parts of the conditional block.

Cons:
- Not commonly used

.sass-lint.yml
scss/components/_dropdown-menu.scss
scss/grid/_gutter.scss
scss/util/_color.scss
scss/util/_value.scss

index 7a1ff5d5234cf12531978618b63c35b62a32c2d3..af8d97d34a5e171903cccc278c8e9cad6aec9730 100644 (file)
@@ -21,7 +21,8 @@ rules:
 
   brace-style:
     - 1
-    - allow-single-line: false
+    - style: stroustrup
+    - allow-single-line: true
 
   class-name-format:
     - 1
index 1961df7cb289326ebf17e705c4ce305347056e4b..a9b8242234110c4a22ad9711cc22b3722cfdef06 100644 (file)
@@ -169,7 +169,8 @@ $dropdownmenu-border-width: nth($dropdownmenu-border, 1);
       top: 100%;
       @if $global-text-direction == 'rtl' {
         right: auto;
-      } @else {
+      }
+      @else {
         left: auto;
       }
     }
index 5ddc6a405b8766de64507e0a157ead43f9b21ea1..8408b6109fe26d6de50b760c1963bdcfe5af0994 100644 (file)
@@ -42,7 +42,8 @@
         @include grid-column-gutter($value);
       }
     }
-  } @else {
+  }
+  @else {
     // breakpoint name
     @if type-of($gutter) == 'string' {
       $gutter: grid-column-gutter($gutter, $gutters);
index c9f2e4a82bbf44ae1593167eee35d3166b0a2ea3..ae23683b130244d490370a8a6be342882f3e2435 100644 (file)
@@ -48,7 +48,8 @@
 @function get-color($key) {
   @if map-has-key($foundation-palette, $key) {
     @return map-get($foundation-palette, $key);
-  } @else {
+  }
+  @else {
     @error 'given $key is not available in $foundation-palette';
   }
 }
index df0e9b1509184e1ce3790bcf614340982f1ba902..cec4408bee512ccfec55c727f491a2bb2fc1d652 100644 (file)
 
     @if $keep == 'keys' {
       @return $keys;
-    } @else if $keep == 'values' {
+    }
+    @else if $keep == 'values' {
       @return $values;
-    } @else {
+    }
+    @else {
       @return zip($keys, $values);
     }
   }