From: Tim Hartwick Date: Mon, 24 Aug 2015 21:28:48 +0000 (-0700) Subject: added that yaml brah, linted some of that scss dude X-Git-Tag: v2.0.0-rc.1~113 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4763ee7fd9f8f6f2dda9e980c4bb4f2543ff39b6;p=thirdparty%2Ffoundation%2Ffoundation-emails.git added that yaml brah, linted some of that scss dude --- diff --git a/config/scss-lint.yml b/config/scss-lint.yml new file mode 100644 index 00000000..2e4056b6 --- /dev/null +++ b/config/scss-lint.yml @@ -0,0 +1,189 @@ +# Default application configuration that all configurations inherit from. + +scss_files: "scss/**/*.scss" + +linters: + BangFormat: + enabled: true + space_before_bang: true + space_after_bang: false + + BorderZero: + enabled: true + convention: zero # or `none` + + ColorKeyword: + enabled: true + + ColorVariable: + enabled: true + + Comment: + enabled: false + + DebugStatement: + enabled: true + + DeclarationOrder: + enabled: true + + DuplicateProperty: + enabled: true + + ElsePlacement: + enabled: true + style: new_line # or 'same_line' + + EmptyLineBetweenBlocks: + enabled: true + ignore_single_line_blocks: true + + EmptyRule: + enabled: true + + FinalNewline: + enabled: true + present: true + + HexLength: + enabled: true + style: short # or 'long' + + HexNotation: + enabled: true + style: lowercase # or 'uppercase' + + HexValidation: + enabled: true + + IdSelector: + enabled: true + + ImportantRule: + enabled: false + + ImportPath: + enabled: true + leading_underscore: false + filename_extension: false + + Indentation: + enabled: true + allow_non_nested_indentation: false + character: space # or 'tab' + width: 2 + + LeadingZero: + enabled: true + style: include_zero # or 'include_zero' + + MergeableSelector: + enabled: true + force_nesting: true + + NameFormat: + enabled: true + allow_leading_underscore: true + convention: hyphenated_lowercase # or 'BEM', or a regex pattern + + NestingDepth: + enabled: true + max_depth: 3 + + PlaceholderInExtend: + enabled: true + + PropertyCount: + enabled: false + include_nested: false + max_properties: 10 + + PropertySortOrder: + enabled: false + ignore_unspecified: false + separate_groups: false + + PropertySpelling: + enabled: true + extra_properties: [] + + QualifyingElement: + enabled: false + allow_element_with_attribute: false + allow_element_with_class: false + allow_element_with_id: false + + SelectorDepth: + enabled: true + max_depth: 3 + + SelectorFormat: + enabled: true + convention: '([a-z0-9]+-?)+' + + Shorthand: + enabled: true + + SingleLinePerProperty: + enabled: true + allow_single_line_rule_sets: false + + SingleLinePerSelector: + enabled: false + + SpaceAfterComma: + enabled: true + + SpaceAfterPropertyColon: + enabled: true + style: one_space # or 'no_space', or 'at_least_one_space', or 'aligned' + + SpaceAfterPropertyName: + enabled: true + + SpaceBeforeBrace: + enabled: true + style: space # or 'new_line' + allow_single_line_padding: true + + SpaceBetweenParens: + enabled: true + spaces: 0 + + StringQuotes: + enabled: true + style: single_quotes # or double_quotes + + TrailingSemicolon: + enabled: true + + TrailingZero: + enabled: false + + UnnecessaryMantissa: + enabled: true + + UnnecessaryParentReference: + enabled: true + + UrlFormat: + enabled: true + + UrlQuotes: + enabled: true + + VariableForProperty: + enabled: false + properties: [] + + VendorPrefixes: + enabled: true + identifier_list: base + include: [] + exclude: [] + + ZeroUnit: + enabled: true + + Compass::*: + enabled: false \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 55763356..6b121185 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -22,6 +22,7 @@ var gulp = require('gulp'), map = require('vinyl-map'), fs = require('fs'), rimraf = require('rimraf'), + scssLint = require('gulp-scss-lint'), // HTML stuff minifyHTML = require('gulp-minify-html'), inkyGulp = require('gulp-inky'), @@ -163,6 +164,15 @@ gulp.task('inky-parse', function() { // }); +// Lints Sass files for formatting issues +gulp.task('lint', ['lint:sass']); +gulp.task('lint:sass', function() { + return gulp.src('scss/**/*.scss') + .pipe(scssLint({ + 'config': 'config/scss-lint.yml' + })); +}); + // 7. Utility Tasks // - - - - - - - - - - - - - - - diff --git a/package.json b/package.json index ca8d3546..d1b073d1 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "gulp-minify-html": "^0.1.8", "gulp-rename": "^1.2.0", "gulp-ruby-sass": "^0.7.1", + "gulp-scss-lint": "^0.2.4", "handlebars": "^3.0.0", "media-query-extractor": "^0.1.1", "path": "^0.11.14", diff --git a/scss/ink.scss b/scss/ink.scss index e22e6523..3bbf50f6 100755 --- a/scss/ink.scss +++ b/scss/ink.scss @@ -1,17 +1,18 @@ -/********************************************** -* Ink v1.0.5 - Copyright 2013 ZURB Inc * -**********************************************/ +// Foundation by ZURB +// foundation.zurb.com +// Licensed under MIT Open Source + +$foundation-version: '1.0.0-alpha'; -// Make sure the charset is set appropriately @charset "UTF-8"; -// Behold, here are all the Ink components. @import "ink/settings", "ink/components/normalize", "ink/components/grid", "ink/components/block-grid", "ink/components/alignment", + "ink/components/visibility", "ink/components/type", "ink/components/button", "ink/components/callout", diff --git a/scss/ink/components/_alignment.scss b/scss/ink/components/_alignment.scss index af8a6dfa..a354ef68 100755 --- a/scss/ink/components/_alignment.scss +++ b/scss/ink/components/_alignment.scss @@ -2,45 +2,29 @@ // zurb.com/ink/ // Licensed under MIT Open Source -@import "global"; - -// -// @variables -// -$include-html-alignment-classes: $include-html-classes !default; - -@include exports("alignment") { - @if $include-html-alignment-classes { - /* Alignment & Visibility Classes */ - - table.center, td.center { - text-align: center; - } - - h1.center, - h2.center, - h3.center, - h4.center, - h5.center, - h6.center, - p.center { - text-align: center; - } - - span.center { - display: block; - width: 100%; - text-align: center; - } - - img.center { - margin: 0 auto; - float: none; - } - - .show-for-small, - .hide-for-desktop { - display: none; - } - } -} \ No newline at end of file +//// +/// @group alignment +//// + +table.center, +td.center, +h1.center, +h2.center, +h3.center, +h4.center, +h5.center, +h6.center, +p.center, +span.center { + text-align: center; +} + +span.center { + display: block; + width: 100%; +} + +img.center { + margin: 0 auto; + float: none; +} diff --git a/scss/ink/components/_block-grid.scss b/scss/ink/components/_block-grid.scss index 15215e15..6cca54ab 100755 --- a/scss/ink/components/_block-grid.scss +++ b/scss/ink/components/_block-grid.scss @@ -4,49 +4,35 @@ @import "global"; -// -// @variables -// -$include-html-grid-classes: $include-html-classes !default; -$include-html-block-grid-classes: $include-html-grid-classes !default; +//// +/// @group block-grid +//// -// We use this to control the maximum number of block grid elements per row +///Defualt number of elements in the block grid per row. +///@type Number $block-grid-elements: 8 !default; -$block-grid-default-spacing: $column-gutter !default; -$align-block-grid-to-grid: false !default; -@if $align-block-grid-to-grid { - $block-grid-default-spacing: $column-gutter; -} - -// -// Block Grid Mixins -// +///Defualt gutter between elements in the block grid. +///@type Number +$block-grid-spacing: $column-gutter !default; -// Generate markup for block grid. -// -@mixin block-grid-html-classes() { +///Creates all of the block-grid classes. +@mixin block-grid { @for $i from 2 through $block-grid-elements { - .block-grid-#{$i} td { - width: floor(($container-width - $i * $block-grid-default-spacing) / $i) !important; + .up-#{$i} td { + width: floor(($container-width - $i * $block-grid-spacing) / $i) !important; } } } -@include exports("block-grid") { - @if $include-html-block-grid-classes { - /* Block Grid */ - - .block-grid { - width: 100%; - max-width: $container-width; - } - - .block-grid td { - display: inline-block; - padding: $block-grid-default-spacing / 2; - } +.block-grid { + width: 100%; + max-width: $container-width; - @include block-grid-html-classes(); + td { + display: inline-block; + padding: $block-grid-spacing / 2; } -} \ No newline at end of file +} + +@include block-grid(); diff --git a/scss/ink/components/_button.scss b/scss/ink/components/_button.scss index bd08ed4e..7686c426 100755 --- a/scss/ink/components/_button.scss +++ b/scss/ink/components/_button.scss @@ -4,9 +4,10 @@ @import "global"; -// -// @variables -// +//// +/// @group button +//// + $include-html-button-classes: $include-html-classes !default; // We use these to build padding for buttons. diff --git a/scss/ink/components/_visibility.scss b/scss/ink/components/_visibility.scss new file mode 100644 index 00000000..d5e3e021 --- /dev/null +++ b/scss/ink/components/_visibility.scss @@ -0,0 +1,12 @@ +// Ink by ZURB +// zurb.com/ink/ +// Licensed under MIT Open Source + +//// +/// @group visibility +//// + +.show-for-small, +.hide-for-desktop { + display: none; +}