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

CSS: Use custom properties for spacing #2925

Merged
merged 3 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Deprecate default-margin and default-padding Sass variables
Please use custom properties instead.
  • Loading branch information
tvdeyen committed Jun 17, 2024
commit 52994fe88c136f69b88a2d5917a3d952a156bf50
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