Skip to content

Commit

Permalink
Deprecate default-margin and default-padding Sass variables
Browse files Browse the repository at this point in the history
Please use custom properties instead.
  • Loading branch information
tvdeyen committed Jun 10, 2024
1 parent e8cdb75 commit 73c9575
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/assets/stylesheets/alchemy/_deprecated_variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@import "alchemy/deprecation";

@include alchemy-deprecated-variable("$default-padding", "var(--spacing-1)");
@include alchemy-deprecated-variable("$default-margin", "var(--spacing-1)");
17 changes: 17 additions & 0 deletions app/assets/stylesheets/alchemy/_deprecation.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@charset "UTF-8";

/// Throws Sass warnings to announce backend deprecations. You can disable them
/// by setting the `$output-alchemy-deprecation-warnings` variable to `false`.
///
/// @access private

$output-alchemy-deprecation-warnings: true !default;

@mixin alchemy-deprecated-variable($variable, $replacement) {
@if $output-alchemy-deprecation-warnings == true {
@if global-variable-exists($variable) {
@warn "[Alchemy] [Deprecation] Sass variable `#{$variable}` is deprecated and will be " +
"removed in Alchemy 8.0. Please use custom property `#{$replacement}` instead";
}
}
}
2 changes: 2 additions & 0 deletions app/assets/stylesheets/alchemy/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import "alchemy/deprecated_variables";

$light-blue: #cddce5;
$very-light-blue: lighten($light-blue, 12%);
$blue: #2d5a8d;
Expand Down

0 comments on commit 73c9575

Please sign in to comment.