diff --git a/app/assets/stylesheets/_neat-helpers.scss b/app/assets/stylesheets/_neat-helpers.scss index e915c698..9c182d2e 100644 --- a/app/assets/stylesheets/_neat-helpers.scss +++ b/app/assets/stylesheets/_neat-helpers.scss @@ -5,3 +5,4 @@ // Settings @import "settings/grid"; @import "settings/visual-grid"; +@import "settings/disable-warnings"; diff --git a/app/assets/stylesheets/_neat.scss b/app/assets/stylesheets/_neat.scss index 77570c1e..9c743cdd 100644 --- a/app/assets/stylesheets/_neat.scss +++ b/app/assets/stylesheets/_neat.scss @@ -8,7 +8,6 @@ // Grid @import "grid/private"; -@import "grid/reset"; @import "grid/box-sizing"; @import "grid/omega"; @import "grid/outer-container"; diff --git a/app/assets/stylesheets/grid/_omega.scss b/app/assets/stylesheets/grid/_omega.scss index c99ed6cf..18094bd6 100644 --- a/app/assets/stylesheets/grid/_omega.scss +++ b/app/assets/stylesheets/grid/_omega.scss @@ -4,13 +4,13 @@ $auto: if(belongs-to(auto, $query), true, false); @if $direction != default { - @warn "The omega mixin will no longer take a $direction argument. To change the layout direction, use row($direction) or set $default-layout-direction instead." + @include -neat-warn("The omega mixin will no longer take a $direction argument. To change the layout direction, use the direction(){...} mixin."); } @else { $direction: get-direction($layout-direction, $default-layout-direction); } @if $table { - @warn "The omega mixin no longer removes padding in table layouts." + @include -neat-warn("The omega mixin no longer removes padding in table layouts."); } @if length($query) == 1 { @@ -42,7 +42,7 @@ } @else { - @warn "Too many arguments passed to the omega() mixin." + @include -neat-warn("Too many arguments passed to the omega() mixin."); } } diff --git a/app/assets/stylesheets/grid/_reset.scss b/app/assets/stylesheets/grid/_reset.scss deleted file mode 100644 index f237b716..00000000 --- a/app/assets/stylesheets/grid/_reset.scss +++ /dev/null @@ -1,14 +0,0 @@ -@mixin reset-display { - $container-display-table: false !global; - @warn "Resetting $display will be deprecated in future versions in favor of the display(){...} mixin." -} - -@mixin reset-layout-direction { - $layout-direction: $default-layout-direction !global; - @warn "Resetting $direction will be deprecated in future versions in favor of the direction(){...} mixin." -} - -@mixin reset-all { - @include reset-display; - @include reset-layout-direction; -} diff --git a/app/assets/stylesheets/grid/_row.scss b/app/assets/stylesheets/grid/_row.scss index 680974f1..7ed86bf0 100644 --- a/app/assets/stylesheets/grid/_row.scss +++ b/app/assets/stylesheets/grid/_row.scss @@ -1,12 +1,12 @@ @mixin row($display: default, $direction: $default-layout-direction) { @if $direction != $default-layout-direction { - @warn "The $direction argument will be deprecated in future versions in favor of the direction(){...} mixin." + @include -neat-warn("The $direction argument will be deprecated in future versions in favor of the direction(){...} mixin."); } $layout-direction: $direction !global; @if $display != default { - @warn "The $display argument will be deprecated in future versions in favor of the display(){...} mixin." + @include -neat-warn("The $display argument will be deprecated in future versions in favor of the display(){...} mixin."); } @if $display == table { diff --git a/app/assets/stylesheets/grid/_span-columns.scss b/app/assets/stylesheets/grid/_span-columns.scss index c79193d9..a6b665b4 100644 --- a/app/assets/stylesheets/grid/_span-columns.scss +++ b/app/assets/stylesheets/grid/_span-columns.scss @@ -21,7 +21,7 @@ } @if $display == collapse { - @warn "The 'collapse' argument will be deprecated. Use 'block-collapse' instead." + @include -neat-warn("The 'collapse' argument will be deprecated. Use 'block-collapse' instead."); } @if $display == collapse or $display == block-collapse { diff --git a/app/assets/stylesheets/grid/_to-deprecate.scss b/app/assets/stylesheets/grid/_to-deprecate.scss index d0a681fd..8a342c69 100644 --- a/app/assets/stylesheets/grid/_to-deprecate.scss +++ b/app/assets/stylesheets/grid/_to-deprecate.scss @@ -1,5 +1,5 @@ @mixin breakpoint($query:$feature $value $columns, $total-columns: $grid-columns) { - @warn "The breakpoint() mixin was renamed to media() in Neat 1.0. Please update your project with the new syntax before the next version bump."; + @include -neat-warn("The breakpoint() mixin was renamed to media() in Neat 1.0. Please update your project with the new syntax before the next version bump."); @if length($query) == 1 { @media screen and ($default-feature: nth($query, 1)) { @@ -47,11 +47,26 @@ } @else { - @warn "Wrong number of arguments for breakpoint(). Read the documentation for more details."; + @include -neat-warn("Wrong number of arguments for breakpoint(). Read the documentation for more details."); } } @mixin nth-omega($nth, $display: block, $direction: default) { - @warn "The nth-omega() mixin is deprecated. Please use omega() instead."; + @include -neat-warn("The nth-omega() mixin is deprecated. Please use omega() instead."); @include omega($nth $display, $direction); } + +@mixin reset-display { + $container-display-table: false !global; + @include -neat-warn("Resetting $display will be deprecated in future versions in favor of the display(){...} mixin."); +} + +@mixin reset-layout-direction { + $layout-direction: $default-layout-direction !global; + @include -neat-warn("Resetting $direction will be deprecated in future versions in favor of the direction(){...} mixin."); +} + +@mixin reset-all { + @include reset-display; + @include reset-layout-direction; +} diff --git a/app/assets/stylesheets/settings/_disable-warnings.scss b/app/assets/stylesheets/settings/_disable-warnings.scss new file mode 100644 index 00000000..055c897c --- /dev/null +++ b/app/assets/stylesheets/settings/_disable-warnings.scss @@ -0,0 +1,13 @@ +/** + * Disable all deprecation warnings. Defaults to `false`. Set with a `!global` flag. + * + * @type Bool + */ + +$disable-warnings: false !default; + +@mixin -neat-warn($message) { + @if $disable-warnings == false { + @warn "#{$message}"; + } +} diff --git a/test/_setup.scss b/test/_setup.scss index 42edf0ca..a3b1cb83 100644 --- a/test/_setup.scss +++ b/test/_setup.scss @@ -1,2 +1,3 @@ @import 'bourbon/bourbon'; @import 'app/assets/stylesheets/neat'; +$disable-warnings: true !global;