Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promote better deprecation communication and compatibility #3261

Merged
merged 5 commits into from Dec 18, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
52 changes: 52 additions & 0 deletions src/stylesheets/core/_deprecated.scss
@@ -0,0 +1,52 @@
/* deprecated.scss
---
Occasionally the design system will deprecate
old variables or functionality. If we replace
the old functionality with something new, this is a
place to connect the old functionality to the
new functionality, in the service of better
continuity and backwards compatibility within a
major release cycle.

Note the USWDS version where we deprecated the
old functionality in a comment.

Add the deprecation to the warning.

This file should started fresh at each
major version.
*/

@if $theme-show-deprecation-warnings {
@warn "\a"
+ "--------------------------------------------------------------------\a"
+ "Deprecated in USWDS 2.x\a"
thisisdano marked this conversation as resolved.
Show resolved Hide resolved
+ "--------------------------------------------------------------------\a"
+ "2.2.0\a"
+ "$theme-navigation-width \2192 $theme-header-min-width\a"
+ "$theme-megamenu-logo-text-width \2192 $theme-header-logo-text-width\a"
+ "--------------------------------------------------------------------\a"
+ "2.0.2\a"
+ "$theme-title-font-size \2192 $theme-display-font-size\a"
+ "@include title \2192 @include display\a"
+ "@include typeset-title \2192 @include typeset-display\a"
+ "--------------------------------------------------------------------\a"
+ "Disable this message using \a"
+ "$theme-show-deprecation-warnings: false\a"
+ "--------------------------------------------------------------------\a";
}

// Deprecated in 2.2.0
$theme-navigation-width: $theme-header-min-width;
$theme-megamenu-logo-text-width: $theme-header-logo-text-width;

// Deprecated in 2.0.2
$theme-title-font-size: $theme-display-font-size;

@mixin title {
@include display;
}

@mixin typeset-title {
@include typeset-display;
}
3 changes: 3 additions & 0 deletions src/stylesheets/packages/_required.scss
Expand Up @@ -15,3 +15,6 @@
@import "../core/properties";
@import "../core/mixins/all";
@import "../core/placeholders/all";

// deprecated import needs to be last
@import "../core/deprecated";
3 changes: 3 additions & 0 deletions src/stylesheets/settings/_settings-general.scss
Expand Up @@ -33,10 +33,13 @@ Show compile warnings
----------------------------------------
Show Sass warnings when functions and
mixins use non-standard tokens.
AND
Show deprecation notifications.
----------------------------------------
*/

$theme-show-compile-warnings: true !default;
$theme-show-deprecation-warnings: true !default;

/*
----------------------------------------
Expand Down
3 changes: 3 additions & 0 deletions src/stylesheets/theme/_uswds-theme-general.scss
Expand Up @@ -33,10 +33,13 @@ Show compile warnings
----------------------------------------
Show Sass warnings when functions and
mixins use non-standard tokens.
AND
Show deprecation notifications.
----------------------------------------
*/

$theme-show-compile-warnings: true;
$theme-show-deprecation-warnings: true;

/*
----------------------------------------
Expand Down