]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Sass lint: Sort forms properties
authorNicolas Coden <nicolas@ncoden.fr>
Tue, 8 Nov 2016 01:35:34 +0000 (02:35 +0100)
committerNicolas Coden <nicolas@ncoden.fr>
Sat, 12 Nov 2016 14:54:41 +0000 (15:54 +0100)
Sort form properties following the Specific property sort order.

See : https://gist.github.com/ncoden/d42f55df7c7970f548a02cd3468f9c86

scss/forms/_checkbox.scss
scss/forms/_error.scss
scss/forms/_fieldset.scss
scss/forms/_input-group.scss
scss/forms/_label.scss
scss/forms/_meter.scss
scss/forms/_progress.scss
scss/forms/_range.scss
scss/forms/_select.scss
scss/forms/_text.scss

index 0c388cd3cf9e60b7804580e612fccb0f3fce7242..60e8bfc14a79ea9cdc1d96b88a2605b513a06337 100644 (file)
   [type='checkbox'] + label,
   [type='radio'] + label {
     display: inline-block;
+    vertical-align: baseline;
+
     margin-#{$global-left}: $form-spacing * 0.5;
     margin-#{$global-right}: $form-spacing;
     margin-bottom: 0;
-    vertical-align: baseline;
 
     &[for] {
       cursor: pointer;
index 792182d4aa7c24bcd51c70f040f3b1c504d11eff..84ba398ce8f1f32f9e4057dc3daf615067271c15 100644 (file)
@@ -43,8 +43,8 @@ $input-error-font-weight: $global-weight-bold !default;
   $background-alpha: 0.1
 ) {
   &:not(:focus) {
-    background-color: rgba($background, $background-alpha);
     border-color: $background;
+    background-color: rgba($background, $background-alpha);
   }
 }
 
@@ -53,6 +53,7 @@ $input-error-font-weight: $global-weight-bold !default;
   display: none;
   margin-top: $form-spacing * -0.5;
   margin-bottom: $form-spacing;
+
   font-size: $input-error-font-size;
   font-weight: $input-error-font-weight;
   color: $input-error-color;
index 875706d2c5480f88f4ed8ce00da59a60f3227456..8ba4c83dc26297d3822a04024d260b8dbb875ad7 100644 (file)
@@ -23,29 +23,29 @@ $fieldset-margin: rem-calc(18 0) !default;
 $legend-padding: rem-calc(0 3) !default;
 
 @mixin fieldset {
-  border: $fieldset-border;
-  padding: $fieldset-padding;
   margin: $fieldset-margin;
+  padding: $fieldset-padding;
+  border: $fieldset-border;
 
   legend {
     // Covers up the fieldset's border to create artificial padding
-    background: $body-background;
-    padding: $legend-padding;
     margin: 0;
     margin-#{$global-left}: rem-calc(-3);
+    padding: $legend-padding;
+    background: $body-background;
   }
 }
 
 @mixin foundation-form-fieldset {
   fieldset {
-    border: 0;
-    padding: 0;
     margin: 0;
+    padding: 0;
+    border: 0;
   }
 
   legend {
-    margin-bottom: $form-spacing * 0.5;
     max-width: 100%;
+    margin-bottom: $form-spacing * 0.5;
   }
 
   .fieldset {
index a7c7b1ad1a4cef8bde81284b1bae60adfb4ca463..1e32da5e9cfc112e14b486cc10f241ce95f680d7 100644 (file)
@@ -56,16 +56,17 @@ $input-prefix-padding: 1rem !default;
 
   .input-group-label {
     @extend %input-group-child;
-    text-align: center;
     padding: 0 $input-prefix-padding;
+    border: $input-prefix-border;
     background: $input-prefix-background;
+
     color: $input-prefix-color;
-    border: $input-prefix-border;
+    text-align: center;
     white-space: nowrap;
 
     @if $global-flexbox {
-      flex: 0 0 auto;
       display: flex;
+      flex: 0 0 auto;
       align-items: center;
     }
     @else {
@@ -108,8 +109,8 @@ $input-prefix-padding: 1rem !default;
       flex: 0 0 auto;
     }
     @else {
-      height: 100%;
       width: 1%;
+      height: 100%;
     }
 
     a,
@@ -117,10 +118,11 @@ $input-prefix-padding: 1rem !default;
     button,
     label {
       @extend %input-group-child;
-      font-size: $input-font-size;
       height: $height;
       padding-top: 0;
       padding-bottom: 0;
+
+      font-size: $input-font-size;
     }
   }
 
index ef44a52846ed8873379d4b636eddd763bfa6f502..1c388519d44b63b67410c7b9ae15dc65c4c2a18a 100644 (file)
@@ -25,6 +25,7 @@ $form-label-line-height: 1.8 !default;
 @mixin form-label {
   display: block;
   margin: 0;
+
   font-size: $form-label-font-size;
   font-weight: $form-label-font-weight;
   line-height: $form-label-line-height;
@@ -33,6 +34,7 @@ $form-label-line-height: 1.8 !default;
 
 @mixin form-label-middle {
   $input-border-width: get-border-value($input-border, width);
+
   margin: 0 0 $form-spacing;
   padding: ($form-spacing / 2 + rem-calc($input-border-width)) 0;
 }
index 10cf985fb2532c5f870674656090ea60e6a13a99..0969c91d32c022870255cced69f8d0f06746ab94 100644 (file)
@@ -32,30 +32,30 @@ $meter-fill-bad: $alert-color !default;
 
 @mixin foundation-meter-element {
   meter {
-    -webkit-appearance: none;
-    -moz-appearance: none;
     display: block;
     width: 100%;
     height: $meter-height;
     margin-bottom: 1rem;
 
+    -webkit-appearance: none;
+    -moz-appearance: none;
+
     @if has-value($meter-radius) {
       border-radius: $meter-radius;
     }
 
     // For Firefox
-    background: $meter-background;
     border: 0;
+    background: $meter-background;
 
     // Chrome/Safari/Edge
     &::-webkit-meter-bar {
-      background: $meter-background;
-
+      border: 0;
       @if has-value($meter-radius) {
         border-radius: $meter-radius;
       }
-      
-      border: 0;
+
+      background: $meter-background;
     }
 
     &::-webkit-meter-inner-element {
index d157a33aa491034fdab09ef8f56274ade7e14b81..b48b81e5e26867e9f72f0419d2f7ba9b73406884 100644 (file)
@@ -28,20 +28,21 @@ $progress-radius: $global-radius !default;
 
 @mixin foundation-progress-element {
   progress {
-    -webkit-appearance: none;
-    -moz-appearance: none;
     display: block;
     width: 100%;
     height: $progress-height;
     margin-bottom: $progress-margin-bottom;
 
+    -webkit-appearance: none;
+    -moz-appearance: none;
+
     @if hasvalue($progress-radius) {
       border-radius: $progress-radius;
     }
 
     // For Firefox
-    background: $progress-background;
     border: 0;
+    background: $progress-background;
 
     &::-webkit-progress-bar {
       background: $progress-background;
index 9524458bedeee9c38f1647dab81663a7ca4db293..14fc64997b34eaaffa5d4c533c4f160104d8b7c1 100644 (file)
@@ -43,16 +43,18 @@ $slider-radius: $global-radius !default;
   input[type="range"] {
     $margin: ($slider-handle-height - $slider-height) / 2;
 
-    -webkit-appearance: none;
-    -moz-appearance: none;
     display: block;
     width: 100%;
     height: auto;
-    cursor: pointer;
     margin-top: $margin;
     margin-bottom: $margin;
+
+    -webkit-appearance: none;
+    -moz-appearance: none;
+
     border: 0;
     line-height: 1;
+    cursor: pointer;
 
     @if has-value($slider-radius) {
       border-radius: $slider-radius;
@@ -73,12 +75,13 @@ $slider-radius: $global-radius !default;
     }
 
     &::-webkit-slider-handle {
-      -webkit-appearance: none;
-      background: $slider-handle-background;
       width: $slider-handle-width;
       height: $slider-handle-height;
       margin-top: -$margin;
 
+      -webkit-appearance: none;
+      background: $slider-handle-background;
+
       @if has-value($slider-radius) {
         border-radius: $slider-radius;
       }
@@ -86,18 +89,19 @@ $slider-radius: $global-radius !default;
 
     // Firefox
     &::-moz-range-track {
-      -moz-appearance: none;
       height: $slider-height;
+      -moz-appearance: none;
       background: $slider-background;
     }
 
     &::-moz-range-thumb {
-      -moz-appearance: none;
-      background: $slider-handle-background;
       width: $slider-handle-width;
       height: $slider-handle-height;
       margin-top: -$margin;
 
+      -moz-appearance: none;
+      background: $slider-handle-background;
+
       @if has-value($slider-radius) {
         border-radius: $slider-radius;
       }
@@ -106,19 +110,21 @@ $slider-radius: $global-radius !default;
     // Internet Explorer
     &::-ms-track {
       height: $slider-height;
-      background: $slider-background;
-      color: transparent;
+
       border: 0;
-      overflow: visible;
       border-top: $margin solid $body-background;
       border-bottom: $margin solid $body-background;
+      background: $slider-background;
+
+      overflow: visible;
+      color: transparent;
     }
 
     &::-ms-thumb {
-      background: $slider-handle-background;
       width: $slider-handle-width;
       height: $slider-handle-height;
       border: 0;
+      background: $slider-handle-background;
 
       @if has-value($slider-radius) {
         border-radius: $slider-radius;
@@ -135,9 +141,9 @@ $slider-radius: $global-radius !default;
 
     @at-root {
       output {
-        line-height: $slider-handle-height;
         vertical-align: middle;
         margin-left: 0.5em;
+        line-height: $slider-handle-height;
       }
     }
   }
index afb9bd18fba18d197ff77b40f7743d357cd3c8d8..985d7324d9d0b2f2cb74860536833450cbea7de2 100644 (file)
@@ -22,24 +22,27 @@ $select-radius: $global-radius !default;
   $height: ($input-font-size + ($form-spacing * 1.5) - rem-calc(1));
 
   height: $height;
+  margin: 0 0 $form-spacing;
   padding: ($form-spacing / 2);
+
+  -webkit-appearance: none;
+  -moz-appearance: none;
   border: $input-border;
-  margin: 0 0 $form-spacing;
-  font-size: $input-font-size;
+  border-radius: $select-radius;
+  background-color: $select-background;
+
   font-family: $input-font-family;
+  font-size: $input-font-size;
   line-height: normal;
   color: $input-color;
-  background-color: $select-background;
-  border-radius: $select-radius;
-  -webkit-appearance: none;
-  -moz-appearance: none;
 
   @if $select-triangle-color != transparent {
     @include background-triangle($select-triangle-color);
-    background-size: 9px 6px;
-    background-position: $global-right (-$form-spacing) center;
     background-origin: content-box;
+    background-position: $global-right (-$form-spacing) center;
     background-repeat: no-repeat;
+    background-size: 9px 6px;
+
     padding-#{$global-right}: ($form-spacing * 1.5);
   }
 
@@ -49,9 +52,9 @@ $select-radius: $global-radius !default;
 
   // Focus state
   &:focus {
+    outline: none;
     border: $input-border-focus;
     background-color: $input-background-focus;
-    outline: none;
     box-shadow: $input-shadow-focus;
 
     @if has-value($input-transition) {
index 93fd4fb68e01f7393b2d4862a8ce4f29cdde6558..56a04f2ee047b991d7d7c00cab72bc345d7311a6 100644 (file)
@@ -81,17 +81,18 @@ $form-button-radius: $global-radius !default;
   box-sizing: border-box;
   width: 100%;
   height: $height;
+  margin: 0 0 $form-spacing;
   padding: $form-spacing / 2;
+
   border: $input-border;
-  margin: 0 0 $form-spacing;
+  border-radius: $input-radius;
+  background-color: $input-background;
+  box-shadow: $input-shadow;
 
   font-family: $input-font-family;
   font-size: $input-font-size;
   font-weight: $input-font-weight;
   color: $input-color;
-  background-color: $input-background;
-  box-shadow: $input-shadow;
-  border-radius: $input-radius;
 
   @if has-value($input-transition) {
     transition: $input-transition;
@@ -99,9 +100,9 @@ $form-button-radius: $global-radius !default;
 
   // Focus state
   &:focus {
+    outline: none;
     border: $input-border-focus;
     background-color: $input-background-focus;
-    outline: none;
     box-shadow: $input-shadow-focus;
 
     @if has-value($input-transition) {
@@ -146,9 +147,9 @@ $form-button-radius: $global-radius !default;
   // Reset styles on button-like inputs
   [type='submit'],
   [type='button'] {
-    border-radius: $form-button-radius;
     -webkit-appearance: none;
     -moz-appearance: none;
+    border-radius: $form-button-radius;
   }
 
   // Reset Normalize setting content-box to search elements