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 all 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
33 changes: 33 additions & 0 deletions src/stylesheets/core/_deprecated.scss
@@ -0,0 +1,33 @@
/* 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.

Be sure to update notifications.scss.

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

// 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;
}
43 changes: 43 additions & 0 deletions src/stylesheets/core/_notifications.scss
@@ -0,0 +1,43 @@
/* notifications.scss
---
Adds a notification at the top of each USWDS
compile. Use this file for important notifications
and updates to the design system.

This file should started fresh at each
major version.

*/

$uswds-notifications: "\a
--------------------------------------------------------------------
\2709 USWDS Notifications
--------------------------------------------------------------------
2.4.0: If your component settings aren't working as expected, make
sure you're importing the components settings in your Sass entry
point (often styles.scss) with `@import \"uswds-theme-components\"`.
A bug in 2.0 omitted that import.
--------------------------------------------------------------------
2.2.0: We changed the names of some settings.

- $theme-navigation-width \2192 $theme-header-min-width
- $theme-megamenu-logo-text-width \2192 $theme-header-logo-text-width
--------------------------------------------------------------------
2.0.2: We changed the names of some settings and mixins.

- $theme-title-font-size \2192 $theme-display-font-size
- @include title \2192 @include display
- @include typeset-title \2192 @include typeset-display";

$uswds-notification-disable-message: "
--------------------------------------------------------------------
These are notifications from the USWDS team, not necessarily a
problem with your code.

Disable notifications using `$theme-show-notifications: false`
--------------------------------------------------------------------\a";

@if $theme-show-notifications {
@warn "#{$uswds-notifications}"
+ "#{$uswds-notification-disable-message}";
}
4 changes: 4 additions & 0 deletions src/stylesheets/packages/_required.scss
Expand Up @@ -15,3 +15,7 @@
@import "../core/properties";
@import "../core/mixins/all";
@import "../core/placeholders/all";

// deprecated import needs to be last
@import "../core/deprecated";
@import "../core/notifications";
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 updates and notifications.
----------------------------------------
*/

$theme-show-compile-warnings: true !default;
$theme-show-notifications: 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 updates and notifications.
----------------------------------------
*/

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

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