From 23eef7eb01e1b226a15a8a0585ff5b866623766e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatriz=20Sopen=CC=83a=20Merino?= Date: Mon, 25 Nov 2024 00:41:22 +0100 Subject: [PATCH 01/17] fix(sass): use `@forward` and `@use` instead of `@import` to avoid deprecation warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Error: - Deprecation Warning: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0. Reason: - Originally, Sass used `@import` rules to load other files with a single global namespace, with all built-in functions also available globally. We’re deprecating both Sass `@import` rules and global built-in functions now that the module system (`@use` and `@forward` rules) has been available for several years. While Dart Sass 2.0.0 will be released soon with various smaller breaking changes, we don’t expect to remove Sass @import rules or global built-in functions until Dart Sass 3.0.0, which will be released no sooner than two years after Dart Sass 1.80.0. Solution: - All file imports that are not from the `abstracts` folder into `styles.scss`, are now imported using `@use` instead of `@import`. - Files in the `abstracts` folder, which were previously imported into `styles.scss`, have been moved to `abstracts/_index.scss` and are now imported using `@forward` instead of `@import`. With `@forward`, we can import all files from `functions`, `mixins` and `variables` at once wherever they are used (`components`, `base`, `animations`) using `@use ‘../abstracts/index’ as *;`, instead of having to import file by file. - Files that depend on resources in the `abstracts` folder, must now import each of these explicitly using `@use` along with the asterisk (`*`), ensuring that only utilities are integrated where they are needed. By using the asterisk, we can avoid having to use module prefixes to access utilities in the `abstracts` folder, avoiding the need to do something like `abstracts-variables-colors.$color-brand-1` and allowing us to use `$color-brand-1` directly, as we could before with `@import`. References: - https://sass-lang.com/d/import - https://sass-lang.com/documentation/at-rules/use/ - https://sass-lang.com/documentation/at-rules/forward/ - https://www.youtube.com/watch?v=CR-a8upNjJ0&ab_channel=KevinPowell --- src/sass/abstracts/_index.sass | 16 +++++ .../mixins/_abstracts-mixins-media.scss | 2 + .../mixins/_abstracts-mixins-position.sass | 1 + .../_abstracts-mixins-prefix-animation.sass | 1 + .../_animations-keyframes-fade.sass | 1 + .../_animations-keyframes-move.sass | 1 + .../_animations-keyframes-size.sass | 1 + src/sass/base/_base-fonts.sass | 1 + src/sass/components/_components-button.sass | 1 + .../components/_components-container.sass | 1 + .../components/_components-form-ckeditor.sass | 1 + .../components/_components-form-error.sass | 1 + .../_components-form-input-check.sass | 1 + .../_components-form-input-color.sass | 1 + .../_components-form-input-range.sass | 1 + .../components/_components-form-require.sass | 1 + .../components/_components-form-select.sass | 1 + src/sass/components/_components-form.sass | 1 + src/sass/components/_components-icon.sass | 1 + src/sass/components/_components-link.sass | 1 + src/sass/components/_components-message.sass | 1 + src/sass/components/_components-page.sass | 1 + src/sass/styles.sass | 62 +++++++------------ 23 files changed, 60 insertions(+), 40 deletions(-) create mode 100644 src/sass/abstracts/_index.sass diff --git a/src/sass/abstracts/_index.sass b/src/sass/abstracts/_index.sass new file mode 100644 index 0000000..afcd2a6 --- /dev/null +++ b/src/sass/abstracts/_index.sass @@ -0,0 +1,16 @@ +// PARTIALS SASS +// =============================================================================== + +// ABSTRACTS +// ---------------------------------------------------------------------- +@forward "./functions/abstracts-functions-contains" +// ------------------ +@forward "./mixins/abstracts-mixins-media" +@forward "./mixins/abstracts-mixins-position" +@forward "./mixins/abstracts-mixins-prefix" +@forward "./mixins/abstracts-mixins-prefix-keyframes" +@forward "./mixins/abstracts-mixins-prefix-animation" +// ------------------ +@forward "./variables/abstracts-variables-colors" +@forward "./variables/abstracts-variables-fonts" +@forward "./variables/abstracts-variables-breakpoints" diff --git a/src/sass/abstracts/mixins/_abstracts-mixins-media.scss b/src/sass/abstracts/mixins/_abstracts-mixins-media.scss index 7c1757e..c1dd193 100644 --- a/src/sass/abstracts/mixins/_abstracts-mixins-media.scss +++ b/src/sass/abstracts/mixins/_abstracts-mixins-media.scss @@ -1,6 +1,8 @@ // ABSTRACTS - MIXINS // MEDIA // ================================================= +@use "../variables/abstracts-variables-breakpoints" as *; +@use "../functions/abstracts-functions-contains" as *; diff --git a/src/sass/abstracts/mixins/_abstracts-mixins-position.sass b/src/sass/abstracts/mixins/_abstracts-mixins-position.sass index 221c370..f9d9794 100644 --- a/src/sass/abstracts/mixins/_abstracts-mixins-position.sass +++ b/src/sass/abstracts/mixins/_abstracts-mixins-position.sass @@ -1,6 +1,7 @@ // ABSTRACTS - MIXINS // POSITION // ================================================= +@use "abstracts/mixins/abstracts-mixins-prefix" as * diff --git a/src/sass/abstracts/mixins/_abstracts-mixins-prefix-animation.sass b/src/sass/abstracts/mixins/_abstracts-mixins-prefix-animation.sass index 582a7d6..5ee7339 100644 --- a/src/sass/abstracts/mixins/_abstracts-mixins-prefix-animation.sass +++ b/src/sass/abstracts/mixins/_abstracts-mixins-prefix-animation.sass @@ -1,6 +1,7 @@ // ABSTRACTS - MIXINS // PREFIX-ANIMATION // ================================================= +@use "abstracts/mixins/abstracts-mixins-prefix" as * diff --git a/src/sass/animations/_animations-keyframes-fade.sass b/src/sass/animations/_animations-keyframes-fade.sass index 27a51df..135f5a3 100644 --- a/src/sass/animations/_animations-keyframes-fade.sass +++ b/src/sass/animations/_animations-keyframes-fade.sass @@ -1,6 +1,7 @@ // ANIMATIONS // KEYFRAMES-FADE // ================================================= +@use "../abstracts/index" as * diff --git a/src/sass/animations/_animations-keyframes-move.sass b/src/sass/animations/_animations-keyframes-move.sass index 048350c..2ddf855 100644 --- a/src/sass/animations/_animations-keyframes-move.sass +++ b/src/sass/animations/_animations-keyframes-move.sass @@ -1,6 +1,7 @@ // ANIMATIONS // KEYFRAMES-MOVE // ================================================= +@use "../abstracts/index" as * diff --git a/src/sass/animations/_animations-keyframes-size.sass b/src/sass/animations/_animations-keyframes-size.sass index 0f06984..cc62762 100644 --- a/src/sass/animations/_animations-keyframes-size.sass +++ b/src/sass/animations/_animations-keyframes-size.sass @@ -1,6 +1,7 @@ // ANIMATIONS // KEYFRAMES-SIZE // ================================================= +@use "../abstracts/index" as * diff --git a/src/sass/base/_base-fonts.sass b/src/sass/base/_base-fonts.sass index bdc80ba..a1b80aa 100644 --- a/src/sass/base/_base-fonts.sass +++ b/src/sass/base/_base-fonts.sass @@ -1,6 +1,7 @@ // BASE // FONTS // ================================================= +@use "../abstracts/index" as * diff --git a/src/sass/components/_components-button.sass b/src/sass/components/_components-button.sass index ffd9d8c..7f3b9a4 100644 --- a/src/sass/components/_components-button.sass +++ b/src/sass/components/_components-button.sass @@ -1,6 +1,7 @@ // COMPONENTS // BUTTON // ================================================= +@use "../abstracts/index" as * diff --git a/src/sass/components/_components-container.sass b/src/sass/components/_components-container.sass index f40d977..5556a7e 100644 --- a/src/sass/components/_components-container.sass +++ b/src/sass/components/_components-container.sass @@ -1,6 +1,7 @@ // COMPONENTS // CONTAINER // ================================================= +@use "../abstracts/index" as * diff --git a/src/sass/components/_components-form-ckeditor.sass b/src/sass/components/_components-form-ckeditor.sass index 3d685e8..039fbcb 100644 --- a/src/sass/components/_components-form-ckeditor.sass +++ b/src/sass/components/_components-form-ckeditor.sass @@ -1,6 +1,7 @@ // COMPONENTS // FORM-CKEDITOR // ================================================= +@use "../abstracts/index" as * diff --git a/src/sass/components/_components-form-error.sass b/src/sass/components/_components-form-error.sass index b7cc101..3fa3d3b 100644 --- a/src/sass/components/_components-form-error.sass +++ b/src/sass/components/_components-form-error.sass @@ -1,6 +1,7 @@ // COMPONENTS // FORM-ERROR // ================================================= +@use "../abstracts/index" as * diff --git a/src/sass/components/_components-form-input-check.sass b/src/sass/components/_components-form-input-check.sass index eb8c85a..784376b 100644 --- a/src/sass/components/_components-form-input-check.sass +++ b/src/sass/components/_components-form-input-check.sass @@ -3,6 +3,7 @@ // ================================================= @use "sass:math" @use "sass:color" +@use "../abstracts/index" as * diff --git a/src/sass/components/_components-form-input-color.sass b/src/sass/components/_components-form-input-color.sass index c76745f..bc0265c 100644 --- a/src/sass/components/_components-form-input-color.sass +++ b/src/sass/components/_components-form-input-color.sass @@ -1,6 +1,7 @@ // COMPONENTS // FORM-INPUT-COLOR // ================================================= +@use "../abstracts/index" as * diff --git a/src/sass/components/_components-form-input-range.sass b/src/sass/components/_components-form-input-range.sass index f7b17ae..056f996 100644 --- a/src/sass/components/_components-form-input-range.sass +++ b/src/sass/components/_components-form-input-range.sass @@ -3,6 +3,7 @@ // ================================================= @use "sass:math" @use "sass:color" +@use "../abstracts/index" as * diff --git a/src/sass/components/_components-form-require.sass b/src/sass/components/_components-form-require.sass index 7237c4f..71e6d41 100644 --- a/src/sass/components/_components-form-require.sass +++ b/src/sass/components/_components-form-require.sass @@ -1,6 +1,7 @@ // COMPONENTS // FORM-REQUIRE // ================================================= +@use "../abstracts/index" as * diff --git a/src/sass/components/_components-form-select.sass b/src/sass/components/_components-form-select.sass index 43acbaa..d57565b 100644 --- a/src/sass/components/_components-form-select.sass +++ b/src/sass/components/_components-form-select.sass @@ -1,6 +1,7 @@ // COMPONENTS // FORM-SELECT // ================================================= +@use "../abstracts/index" as * diff --git a/src/sass/components/_components-form.sass b/src/sass/components/_components-form.sass index 1dd66d5..d732525 100644 --- a/src/sass/components/_components-form.sass +++ b/src/sass/components/_components-form.sass @@ -1,6 +1,7 @@ // COMPONENTS // FORM // ================================================= +@use "../abstracts/index" as * diff --git a/src/sass/components/_components-icon.sass b/src/sass/components/_components-icon.sass index 8f98292..526e66a 100644 --- a/src/sass/components/_components-icon.sass +++ b/src/sass/components/_components-icon.sass @@ -1,6 +1,7 @@ // COMPONENTS // ICON // ================================================= +@use "../abstracts/index" as * diff --git a/src/sass/components/_components-link.sass b/src/sass/components/_components-link.sass index e57c08c..731de4c 100644 --- a/src/sass/components/_components-link.sass +++ b/src/sass/components/_components-link.sass @@ -1,6 +1,7 @@ // COMPONENTS // LINK // ================================================= +@use "../abstracts/index" as * diff --git a/src/sass/components/_components-message.sass b/src/sass/components/_components-message.sass index 49a8518..5ac3ffd 100644 --- a/src/sass/components/_components-message.sass +++ b/src/sass/components/_components-message.sass @@ -1,6 +1,7 @@ // COMPONENTS // MESSAGE // ================================================= +@use "../abstracts/index" as * diff --git a/src/sass/components/_components-page.sass b/src/sass/components/_components-page.sass index d8bfa56..64efb02 100644 --- a/src/sass/components/_components-page.sass +++ b/src/sass/components/_components-page.sass @@ -2,6 +2,7 @@ // PAGE // ================================================= @use "sass:color" +@use "../abstracts/index" as * diff --git a/src/sass/styles.sass b/src/sass/styles.sass index 4677105..a810947 100644 --- a/src/sass/styles.sass +++ b/src/sass/styles.sass @@ -5,30 +5,12 @@ -// ABSTRACTS -// ---------------------------------------------------------------------- -@import "abstracts/functions/abstracts-functions-contains" -// ------------------ -@import "abstracts/mixins/abstracts-mixins-media" -@import "abstracts/mixins/abstracts-mixins-position" -@import "abstracts/mixins/abstracts-mixins-prefix" -@import "abstracts/mixins/abstracts-mixins-prefix-keyframes" -@import "abstracts/mixins/abstracts-mixins-prefix-animation" -// ------------------ -@import "abstracts/variables/abstracts-variables-colors" -@import "abstracts/variables/abstracts-variables-fonts" -@import "abstracts/variables/abstracts-variables-breakpoints" - - - - - // BASE // ---------------------------------------------------------------------- -// @import "base/base-reset-ericmeyer" -// @import "base/base-reset-normalize" -@import "base/base-reset-personal" -@import "base/base-fonts" +// @use "base/base-reset-ericmeyer" +// @use "base/base-reset-normalize" +@use "base/base-reset-personal" +@use "base/base-fonts" @@ -36,10 +18,10 @@ // ANIMATIONS // ---------------------------------------------------------------------- -// @import "animations/animations-animate-css" -@import "animations/animations-keyframes-fade" -@import "animations/animations-keyframes-move" -@import "animations/animations-keyframes-size" +// @use "animations/animations-animate-css" +@use "animations/animations-keyframes-fade" +@use "animations/animations-keyframes-move" +@use "animations/animations-keyframes-size" @@ -47,17 +29,17 @@ // COMPONENTS // ---------------------------------------------------------------------- -@import "components/components-container" -@import "components/components-page" -@import "components/components-link" -@import "components/components-button" -@import "components/components-icon" -@import "components/components-message" -@import "components/components-form" -@import "components/components-form-select" -@import "components/components-form-input-range" -@import "components/components-form-input-check" -@import "components/components-form-input-color" -@import "components/components-form-require" -@import "components/components-form-error" -@import "components/components-form-ckeditor" +@use "components/components-container" +@use "components/components-page" +@use "components/components-link" +@use "components/components-button" +@use "components/components-icon" +@use "components/components-message" +@use "components/components-form" +@use "components/components-form-select" +@use "components/components-form-input-range" +@use "components/components-form-input-check" +@use "components/components-form-input-color" +@use "components/components-form-require" +@use "components/components-form-error" +@use "components/components-form-ckeditor" From f21270642de143e078c2d8a220cd4a63bf93aa84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatriz=20Sopen=CC=83a=20Merino?= Date: Mon, 25 Nov 2024 01:26:24 +0100 Subject: [PATCH 02/17] fix(sass): rename `variable_exists` function to `variable-exists` Error: - The `variable_exists()` function in the `media` mixin is incorrectly named with an underscore (`_`) instead of a hyphen (`-`), causing issues since Sass uses the hyphenated version. Solution: - Renamed `variable_exists()` to `variable-exists()` for correct usage: From `variable_exists(breakpoints)` to `variable-exists(breakpoints)`. From `variable_exists(breakpoint)` to `variable-exists(breakpoint)`. References: - https://sass-lang.com/documentation/modules/meta/#variable-exists --- src/sass/abstracts/mixins/_abstracts-mixins-media.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sass/abstracts/mixins/_abstracts-mixins-media.scss b/src/sass/abstracts/mixins/_abstracts-mixins-media.scss index c1dd193..847b6a0 100644 --- a/src/sass/abstracts/mixins/_abstracts-mixins-media.scss +++ b/src/sass/abstracts/mixins/_abstracts-mixins-media.scss @@ -33,7 +33,7 @@ } @else { @error "Invalid units provided"; } - } @else if variable_exists(breakpoints) { + } @else if variable-exists(breakpoints) { @if map-has-key($breakpoints, $breakpoint) { @media (#{$rule}-#{$dimension}: #{inspect(map-get($breakpoints, $breakpoint))}) { @content; @@ -41,7 +41,7 @@ } @else { @error "Unfortunately, no value could be retrieved from `#{$breakpoint}`. " + "Available breakpoints are: #{map-keys($breakpoints)}."; } - } @else if variable_exists(breakpoint) { + } @else if variable-exists(breakpoint) { @media (#{$rule}-#{$dimension}: #{$breakpoint}) { @content; } From 0d0faaa61511c169470c754de9ff7cf3961608ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatriz=20Sopen=CC=83a=20Merino?= Date: Mon, 25 Nov 2024 01:35:57 +0100 Subject: [PATCH 03/17] fix(sass): correct assignment of `$dimension` parameter in `media` mixin Error: - The `$dimension` variable was not being correctly assigned in the `media` mixin when the provided dimension value was invalid. The `$rule` variable was mistakenly being reassigned instead of `$dimension`. Solution: - Updated the conditional block to assign the value `width` to `$dimension` when the provided dimension is not valid. --- src/sass/abstracts/mixins/_abstracts-mixins-media.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sass/abstracts/mixins/_abstracts-mixins-media.scss b/src/sass/abstracts/mixins/_abstracts-mixins-media.scss index 847b6a0..4c2f480 100644 --- a/src/sass/abstracts/mixins/_abstracts-mixins-media.scss +++ b/src/sass/abstracts/mixins/_abstracts-mixins-media.scss @@ -18,7 +18,7 @@ } @if not contains($dimensions, $dimension) { - $rule: "width"; + $dimension: "width"; } @if type-of($breakpoint) == number { From 0b123f9d88d2311966d392108586fc84a396ff32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatriz=20Sopen=CC=83a=20Merino?= Date: Mon, 25 Nov 2024 01:40:15 +0100 Subject: [PATCH 04/17] fix(sass): add default `unit` validation to the `media` mixin Description: - Ensure the `$unit` parameter in the `media` mixin defaults to `"px"` if not provided or invalid. Steps: - Added a validation step to check whether `$unit` exists within the predefined `$units` list. - If `$unit` is missing or invalid, it now defaults to `"px"`. Reason: - Improve robustness of the `media` mixin by handling missing or invalid `$unit` values gracefully, ensuring consistent behavior. --- src/sass/abstracts/mixins/_abstracts-mixins-media.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sass/abstracts/mixins/_abstracts-mixins-media.scss b/src/sass/abstracts/mixins/_abstracts-mixins-media.scss index 4c2f480..478f9af 100644 --- a/src/sass/abstracts/mixins/_abstracts-mixins-media.scss +++ b/src/sass/abstracts/mixins/_abstracts-mixins-media.scss @@ -21,6 +21,10 @@ $dimension: "width"; } + @if not contains($units, $unit) { + $unit: "px"; + } + @if type-of($breakpoint) == number { @if unitless($breakpoint) { @media (#{$rule}-#{$dimension}: #{$breakpoint + $unit}) { From 211d961e132c3f30436abbcbb66537ad2be59bd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatriz=20Sopen=CC=83a=20Merino?= Date: Mon, 25 Nov 2024 01:46:06 +0100 Subject: [PATCH 05/17] fix(sass): use `meta.variable-exists` instead of `variable-exists` to avoid deprecation warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Error: - Deprecation Warning: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0. Use meta.variable-exists instead. Reason: - We are deprecating the global functions now that the module system has been available for several years in sass: modules. While Dart Sass 2.0.0 will be released soon with various smaller breaking changes, we don’t expect to remove Sass @import rules or global built-in functions until Dart Sass 3.0.0, which will be released no sooner than two years after Dart Sass 1.80.0. Solution: - Import the `sass:meta` module to use the functions: `@use "sass:meta"` In this case, since the `meta.variable-exists` function will only be used inside the `media` mixin and not globally across components, the `sass:meta` module should be imported specifically within the file that defines the `media` mixin, rather than in the global `styles.scss` file. This ensures that the module is only loaded where necessary, avoiding unnecessary global imports. You can still use the `@nuxtjs/style-resources` package to inject other global styles into components, but the `sass:meta` module will only be used within the `abstracts` for the `media` mixin. Once the `sass:meta` module is imported in the relevant file, you can use `meta.variable-exists` within the mixin. - Use `meta.variable-exists` instead of `variable-exists()`: From `variable-exists(breakpoints)` to `meta.variable-exists(breakpoints)`. From `variable-exists(breakpoint)` to `meta.variable-exists(breakpoint)`. References: - https://sass-lang.com/d/import - https://sass-lang.com/documentation/modules/meta/#variable-exists --- src/sass/abstracts/mixins/_abstracts-mixins-media.scss | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sass/abstracts/mixins/_abstracts-mixins-media.scss b/src/sass/abstracts/mixins/_abstracts-mixins-media.scss index 478f9af..a228e12 100644 --- a/src/sass/abstracts/mixins/_abstracts-mixins-media.scss +++ b/src/sass/abstracts/mixins/_abstracts-mixins-media.scss @@ -1,6 +1,7 @@ // ABSTRACTS - MIXINS // MEDIA // ================================================= +@use "sass:meta"; @use "../variables/abstracts-variables-breakpoints" as *; @use "../functions/abstracts-functions-contains" as *; @@ -37,7 +38,7 @@ } @else { @error "Invalid units provided"; } - } @else if variable-exists(breakpoints) { + } @else if meta.variable-exists(breakpoints) { @if map-has-key($breakpoints, $breakpoint) { @media (#{$rule}-#{$dimension}: #{inspect(map-get($breakpoints, $breakpoint))}) { @content; @@ -45,7 +46,7 @@ } @else { @error "Unfortunately, no value could be retrieved from `#{$breakpoint}`. " + "Available breakpoints are: #{map-keys($breakpoints)}."; } - } @else if variable-exists(breakpoint) { + } @else if meta.variable-exists(breakpoint) { @media (#{$rule}-#{$dimension}: #{$breakpoint}) { @content; } From 53465bbdd5234f2d6df7cb62e539183fdc347f89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatriz=20Sopen=CC=83a=20Merino?= Date: Mon, 25 Nov 2024 01:54:38 +0100 Subject: [PATCH 06/17] fix(sass): use `meta.type-of` instead of `type-of` to avoid deprecation warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Error: - Deprecation Warning: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0. Use meta.type-of instead. Reason: - We are deprecating the global functions now that the module system has been available for several years in sass: modules. While Dart Sass 2.0.0 will be released soon with various smaller breaking changes, we don’t expect to remove Sass @import rules or global built-in functions until Dart Sass 3.0.0, which will be released no sooner than two years after Dart Sass 1.80.0. Solution: - Import the `sass:meta` module to use the functions: `@use "sass:meta"` In this case, since the `meta.type-of` function will only be used inside the `media` mixin and not globally across components, the `sass:meta` module should be imported specifically within the file that defines the `media` mixin, rather than in the global `styles.scss` file. This ensures that the module is only loaded where necessary, avoiding unnecessary global imports. You can still use the `@nuxtjs/style-resources` package to inject other global styles into components, but the `sass:meta` module will only be used within the `abstracts` for the `media` mixin. Once the `sass:meta` module is imported in the relevant file, you can use `meta.type-of` within the mixin. - Use `meta.type-of` instead of `type-of()`: From `type-of(breakpoints)` to `meta.type-of(breakpoints)`. From `type-of(breakpoint)` to `meta.type-of(breakpoint)`. References: - https://sass-lang.com/d/import - https://sass-lang.com/documentation/modules/meta/#type-of --- src/sass/abstracts/mixins/_abstracts-mixins-media.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sass/abstracts/mixins/_abstracts-mixins-media.scss b/src/sass/abstracts/mixins/_abstracts-mixins-media.scss index a228e12..858c2f0 100644 --- a/src/sass/abstracts/mixins/_abstracts-mixins-media.scss +++ b/src/sass/abstracts/mixins/_abstracts-mixins-media.scss @@ -26,7 +26,7 @@ $unit: "px"; } - @if type-of($breakpoint) == number { + @if meta.type-of($breakpoint) == number { @if unitless($breakpoint) { @media (#{$rule}-#{$dimension}: #{$breakpoint + $unit}) { @content; From 1e1eadb8a014df0202df54c8689b08f234124e2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatriz=20Sopen=CC=83a=20Merino?= Date: Mon, 25 Nov 2024 01:59:57 +0100 Subject: [PATCH 07/17] fix(sass): use `list.index` instead of `list` to avoid deprecation warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Error: - Deprecation Warning: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0. Use list.index instead. Reason: - We are deprecating the global functions now that the module system has been available for several years in sass: modules. While Dart Sass 2.0.0 will be released soon with various smaller breaking changes, we don’t expect to remove Sass @import rules or global built-in functions until Dart Sass 3.0.0, which will be released no sooner than two years after Dart Sass 1.80.0. Solution: - Import the `sass:list` module to use the functions: `@use "sass:list"` You can't do these imports in the main `styles.scss` file, it doesn't work, you must do it in the file you are going to use it in. - Use `list.index` instead of `index()`: From `index($list, $item)` to `list.index($list, $item)`. References: - https://sass-lang.com/d/import - https://sass-lang.com/documentation/modules/list/#index --- .../abstracts/functions/_abstracts-functions-contains.sass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sass/abstracts/functions/_abstracts-functions-contains.sass b/src/sass/abstracts/functions/_abstracts-functions-contains.sass index ed19ddc..d3167b5 100644 --- a/src/sass/abstracts/functions/_abstracts-functions-contains.sass +++ b/src/sass/abstracts/functions/_abstracts-functions-contains.sass @@ -1,10 +1,11 @@ // ABSTRACTS - FUNCTIONS // CONTAINS // ================================================= +@use "sass:list" @function contains($list, $item) - @return index($list, $item) != null + @return list.index($list, $item) != null From d7a5fab069d2a67759865a959f6b252633fe300d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatriz=20Sopen=CC=83a=20Merino?= Date: Mon, 25 Nov 2024 02:08:29 +0100 Subject: [PATCH 08/17] fix(sass): use `map.get` instead of `map-get` to avoid deprecation warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Error: - Deprecation Warning: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0. Use map.get instead. Reason: - We are deprecating the global functions now that the module system has been available for several years in sass: modules. While Dart Sass 2.0.0 will be released soon with various smaller breaking changes, we don’t expect to remove Sass @import rules or global built-in functions until Dart Sass 3.0.0, which will be released no sooner than two years after Dart Sass 1.80.0. Solution: - Import the `sass:map` module to use the functions: `@use "sass:map"` You can't do these imports in the main `styles.scss` file, it doesn't work, you must do it in the file you are going to use it in. - Use `map.get` instead of `map-get()`: From `map-get($breakpoints, $breakpoint)` to `map.get($breakpoints, $breakpoint)`. References: - https://sass-lang.com/d/import - https://sass-lang.com/documentation/modules/map/#get --- src/sass/abstracts/mixins/_abstracts-mixins-media.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sass/abstracts/mixins/_abstracts-mixins-media.scss b/src/sass/abstracts/mixins/_abstracts-mixins-media.scss index 858c2f0..4301496 100644 --- a/src/sass/abstracts/mixins/_abstracts-mixins-media.scss +++ b/src/sass/abstracts/mixins/_abstracts-mixins-media.scss @@ -2,6 +2,7 @@ // MEDIA // ================================================= @use "sass:meta"; +@use "sass:map"; @use "../variables/abstracts-variables-breakpoints" as *; @use "../functions/abstracts-functions-contains" as *; @@ -40,7 +41,7 @@ } } @else if meta.variable-exists(breakpoints) { @if map-has-key($breakpoints, $breakpoint) { - @media (#{$rule}-#{$dimension}: #{inspect(map-get($breakpoints, $breakpoint))}) { + @media (#{$rule}-#{$dimension}: #{inspect(map.get($breakpoints, $breakpoint))}) { @content; } } @else { From c5a8a971e9f8cfde99b3627f4608a48b8bb8b6c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatriz=20Sopen=CC=83a=20Merino?= Date: Mon, 25 Nov 2024 02:13:22 +0100 Subject: [PATCH 09/17] fix(sass): use `map.has-key` instead of `map-has-key` to avoid deprecation warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Error: - Deprecation Warning: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0. Use map.has-key instead. Reason: - We are deprecating the global functions now that the module system has been available for several years in sass: modules. While Dart Sass 2.0.0 will be released soon with various smaller breaking changes, we don’t expect to remove Sass @import rules or global built-in functions until Dart Sass 3.0.0, which will be released no sooner than two years after Dart Sass 1.80.0. Solution: - Import the `sass:map` module to use the functions: `@use "sass:map"` You can't do these imports in the main `styles.scss` file, it doesn't work, you must do it in the file you are going to use it in. - Use `map.has-key` instead of `map-has-key()`: From `map-has-key($breakpoints, $breakpoint)` to `map.has-key($breakpoints, $breakpoint)`. References: - https://sass-lang.com/d/import - https://sass-lang.com/documentation/modules/map/#has-key --- src/sass/abstracts/mixins/_abstracts-mixins-media.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sass/abstracts/mixins/_abstracts-mixins-media.scss b/src/sass/abstracts/mixins/_abstracts-mixins-media.scss index 4301496..cd31402 100644 --- a/src/sass/abstracts/mixins/_abstracts-mixins-media.scss +++ b/src/sass/abstracts/mixins/_abstracts-mixins-media.scss @@ -40,7 +40,7 @@ @error "Invalid units provided"; } } @else if meta.variable-exists(breakpoints) { - @if map-has-key($breakpoints, $breakpoint) { + @if map.has-key($breakpoints, $breakpoint) { @media (#{$rule}-#{$dimension}: #{inspect(map.get($breakpoints, $breakpoint))}) { @content; } From 104411b81683a3d136ec7c485a1a76aabb3ea252 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatriz=20Sopen=CC=83a=20Merino?= Date: Mon, 25 Nov 2024 02:20:33 +0100 Subject: [PATCH 10/17] fix(sass): use `meta.inspect` instead of `inspect` to avoid deprecation warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Error: - Deprecation Warning: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0. Use meta.inspect instead. Reason: - We are deprecating the global functions now that the module system has been available for several years in sass: modules. While Dart Sass 2.0.0 will be released soon with various smaller breaking changes, we don’t expect to remove Sass @import rules or global built-in functions until Dart Sass 3.0.0, which will be released no sooner than two years after Dart Sass 1.80.0. Solution: - Import the `sass:meta` module to use the functions: `@use "sass:meta"` You can't do these imports in the main `styles.scss` file, it doesn't work, you must do it in the file you are going to use it in. - Use `meta.inspect` instead of `inspect()`: From `inspect(map.get($breakpoints, $breakpoint))` to `meta.inspect(map.get($breakpoints, $breakpoint))`. References: - https://sass-lang.com/d/import - https://sass-lang.com/documentation/modules/meta/#inspect --- src/sass/abstracts/mixins/_abstracts-mixins-media.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sass/abstracts/mixins/_abstracts-mixins-media.scss b/src/sass/abstracts/mixins/_abstracts-mixins-media.scss index cd31402..a1d6d81 100644 --- a/src/sass/abstracts/mixins/_abstracts-mixins-media.scss +++ b/src/sass/abstracts/mixins/_abstracts-mixins-media.scss @@ -41,7 +41,7 @@ } } @else if meta.variable-exists(breakpoints) { @if map.has-key($breakpoints, $breakpoint) { - @media (#{$rule}-#{$dimension}: #{inspect(map.get($breakpoints, $breakpoint))}) { + @media (#{$rule}-#{$dimension}: #{meta.inspect(map.get($breakpoints, $breakpoint))}) { @content; } } @else { From 1575b84556c383372b4b6725131eb8ff9690c02b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatriz=20Sopen=CC=83a=20Merino?= Date: Mon, 25 Nov 2024 02:25:34 +0100 Subject: [PATCH 11/17] fix(sass): use `map.keys` instead of `map-keys` to avoid deprecation warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Error: - Deprecation Warning: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0. Use map.keys instead. Reason: - We are deprecating the global functions now that the module system has been available for several years in sass: modules. While Dart Sass 2.0.0 will be released soon with various smaller breaking changes, we don’t expect to remove Sass @import rules or global built-in functions until Dart Sass 3.0.0, which will be released no sooner than two years after Dart Sass 1.80.0. Solution: - Import the `sass:map` module to use the functions: `@use "sass:map"` You can't do these imports in the main `styles.scss` file, it doesn't work, you must do it in the file you are going to use it in. - Use `map.keys` instead of `map-keys()`: From `map-keys($breakpoints)` to `map.keys($breakpoints)`. References: - https://sass-lang.com/d/import - https://sass-lang.com/documentation/modules/map/#keys --- src/sass/abstracts/mixins/_abstracts-mixins-media.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sass/abstracts/mixins/_abstracts-mixins-media.scss b/src/sass/abstracts/mixins/_abstracts-mixins-media.scss index a1d6d81..7b9fa4e 100644 --- a/src/sass/abstracts/mixins/_abstracts-mixins-media.scss +++ b/src/sass/abstracts/mixins/_abstracts-mixins-media.scss @@ -45,7 +45,7 @@ @content; } } @else { - @error "Unfortunately, no value could be retrieved from `#{$breakpoint}`. " + "Available breakpoints are: #{map-keys($breakpoints)}."; + @error "Unfortunately, no value could be retrieved from `#{$breakpoint}`. " + "Available breakpoints are: #{map.keys($breakpoints)}."; } } @else if meta.variable-exists(breakpoint) { @media (#{$rule}-#{$dimension}: #{$breakpoint}) { From 12488737331f0bcf4176785741efb41b805ce21f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatriz=20Sopen=CC=83a=20Merino?= Date: Mon, 25 Nov 2024 02:28:02 +0100 Subject: [PATCH 12/17] fix(sass): use `math.is-unitless` instead of `unitless` to avoid deprecation warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Error: - Deprecation Warning: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0. Use math.is-unitless instead. Reason: - We are deprecating the global functions now that the module system has been available for several years in sass: modules. While Dart Sass 2.0.0 will be released soon with various smaller breaking changes, we don’t expect to remove Sass @import rules or global built-in functions until Dart Sass 3.0.0, which will be released no sooner than two years after Dart Sass 1.80.0. Solution: - Import the `sass:math` module to use the functions: `@use "sass:math"` You can't do these imports in the main `styles.scss` file, it doesn't work, you must do it in the file you are going to use it in. - Use `math.is-unitless` instead of `unitless()`: From `unitless($breakpoint)` to `math.is-unitless($breakpoint)`. References: - https://sass-lang.com/d/import - https://sass-lang.com/documentation/modules/math/#is-unitless --- src/sass/abstracts/mixins/_abstracts-mixins-media.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sass/abstracts/mixins/_abstracts-mixins-media.scss b/src/sass/abstracts/mixins/_abstracts-mixins-media.scss index 7b9fa4e..e33fc6e 100644 --- a/src/sass/abstracts/mixins/_abstracts-mixins-media.scss +++ b/src/sass/abstracts/mixins/_abstracts-mixins-media.scss @@ -2,6 +2,7 @@ // MEDIA // ================================================= @use "sass:meta"; +@use "sass:math"; @use "sass:map"; @use "../variables/abstracts-variables-breakpoints" as *; @use "../functions/abstracts-functions-contains" as *; @@ -28,7 +29,7 @@ } @if meta.type-of($breakpoint) == number { - @if unitless($breakpoint) { + @if math.is-unitless($breakpoint) { @media (#{$rule}-#{$dimension}: #{$breakpoint + $unit}) { @content; } From ad1969b708e925ebda0bb3723ecc1822aaa66590 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatriz=20Sopen=CC=83a=20Merino?= Date: Mon, 25 Nov 2024 02:34:55 +0100 Subject: [PATCH 13/17] fix(sass): use `math.unit` instead of `unit` to avoid deprecation warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Error: - Deprecation Warning: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0. Use math.unit instead. Reason: - We are deprecating the global functions now that the module system has been available for several years in sass: modules. While Dart Sass 2.0.0 will be released soon with various smaller breaking changes, we don’t expect to remove Sass @import rules or global built-in functions until Dart Sass 3.0.0, which will be released no sooner than two years after Dart Sass 1.80.0. Solution: - Import the `sass:math` module to use the functions: `@use "sass:math"` You can't do these imports in the main `styles.scss` file, it doesn't work, you must do it in the file you are going to use it in. - Use `math.unit` instead of `unit()`: From `unit($breakpoint)` to `math.unit($breakpoint)`. References: - https://sass-lang.com/d/import - https://sass-lang.com/documentation/modules/math/#unit --- src/sass/abstracts/mixins/_abstracts-mixins-media.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sass/abstracts/mixins/_abstracts-mixins-media.scss b/src/sass/abstracts/mixins/_abstracts-mixins-media.scss index e33fc6e..7a36922 100644 --- a/src/sass/abstracts/mixins/_abstracts-mixins-media.scss +++ b/src/sass/abstracts/mixins/_abstracts-mixins-media.scss @@ -33,7 +33,7 @@ @media (#{$rule}-#{$dimension}: #{$breakpoint + $unit}) { @content; } - } @else if contains($units, unit($breakpoint)) { + } @else if contains($units, math.unit($breakpoint)) { @media (#{$rule}-#{$dimension}: #{$breakpoint}) { @content; } From 2761ff69ea1b498fd70c33dd0bdaee28ed796e38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatriz=20Sopen=CC=83a=20Merino?= Date: Mon, 25 Nov 2024 02:39:26 +0100 Subject: [PATCH 14/17] fix(sass): use `list.nth` instead of `list` to avoid deprecation warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Error: - Deprecation Warning: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0. Use list.nth instead. Reason: - We are deprecating the global functions now that the module system has been available for several years in sass: modules. While Dart Sass 2.0.0 will be released soon with various smaller breaking changes, we don’t expect to remove Sass @import rules or global built-in functions until Dart Sass 3.0.0, which will be released no sooner than two years after Dart Sass 1.80.0. Solution: - Import the `sass:list` module to use the functions: `@use "sass:list"` You can't do these imports in the main `styles.scss` file, it doesn't work, you must do it in the file you are going to use it in. - Use `list.nth` instead of `nth()`: From `nth($animate, $i)` to `list.nth($animate, $i)`. References: - https://sass-lang.com/d/import - https://sass-lang.com/documentation/modules/list/#nth --- .../abstracts/mixins/_abstracts-mixins-prefix-animation.sass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sass/abstracts/mixins/_abstracts-mixins-prefix-animation.sass b/src/sass/abstracts/mixins/_abstracts-mixins-prefix-animation.sass index 5ee7339..1ece7e9 100644 --- a/src/sass/abstracts/mixins/_abstracts-mixins-prefix-animation.sass +++ b/src/sass/abstracts/mixins/_abstracts-mixins-prefix-animation.sass @@ -1,6 +1,7 @@ // ABSTRACTS - MIXINS // PREFIX-ANIMATION // ================================================= +@use "sass:list" @use "abstracts/mixins/abstracts-mixins-prefix" as * @@ -12,7 +13,7 @@ $animations: "" @for $i from 1 through $max - $animations: #{$animations + nth($animate, $i)} + $animations: #{$animations + list.nth($animate, $i)} @if $i < $max $animations: #{$animations + ", "} From 72bb8e8cf3c94bca6ce41d23586c238d0a7a5fd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatriz=20Sopen=CC=83a=20Merino?= Date: Mon, 25 Nov 2024 02:42:59 +0100 Subject: [PATCH 15/17] fix(sass): use `list.length` instead of `list` to avoid deprecation warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Error: - Deprecation Warning: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0. Use list.length instead. Reason: - We are deprecating the global functions now that the module system has been available for several years in sass: modules. While Dart Sass 2.0.0 will be released soon with various smaller breaking changes, we don’t expect to remove Sass @import rules or global built-in functions until Dart Sass 3.0.0, which will be released no sooner than two years after Dart Sass 1.80.0. Solution: - Import the `sass:list` module to use the functions: `@use "sass:list"` You can't do these imports in the main `styles.scss` file, it doesn't work, you must do it in the file you are going to use it in. - Use `list.length` instead of `length()`: From `length($animate)` to `list.length($animate)`. References: - https://sass-lang.com/d/import - https://sass-lang.com/documentation/modules/list/#length --- .../abstracts/mixins/_abstracts-mixins-prefix-animation.sass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sass/abstracts/mixins/_abstracts-mixins-prefix-animation.sass b/src/sass/abstracts/mixins/_abstracts-mixins-prefix-animation.sass index 1ece7e9..ea8be12 100644 --- a/src/sass/abstracts/mixins/_abstracts-mixins-prefix-animation.sass +++ b/src/sass/abstracts/mixins/_abstracts-mixins-prefix-animation.sass @@ -9,7 +9,7 @@ @mixin animation($animate...) - $max: length($animate) + $max: list.length($animate) $animations: "" @for $i from 1 through $max From 1ebb9462a8906264643a020379a077b253a2e6f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatriz=20Sopen=CC=83a=20Merino?= Date: Mon, 25 Nov 2024 02:54:53 +0100 Subject: [PATCH 16/17] style(sass): sort sass imports alphabetically --- src/sass/abstracts/mixins/_abstracts-mixins-media.scss | 4 ++-- src/sass/components/_components-form-input-check.sass | 2 +- src/sass/components/_components-form-input-range.sass | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sass/abstracts/mixins/_abstracts-mixins-media.scss b/src/sass/abstracts/mixins/_abstracts-mixins-media.scss index 7a36922..a4de7c2 100644 --- a/src/sass/abstracts/mixins/_abstracts-mixins-media.scss +++ b/src/sass/abstracts/mixins/_abstracts-mixins-media.scss @@ -1,9 +1,9 @@ // ABSTRACTS - MIXINS // MEDIA // ================================================= -@use "sass:meta"; -@use "sass:math"; @use "sass:map"; +@use "sass:math"; +@use "sass:meta"; @use "../variables/abstracts-variables-breakpoints" as *; @use "../functions/abstracts-functions-contains" as *; diff --git a/src/sass/components/_components-form-input-check.sass b/src/sass/components/_components-form-input-check.sass index 784376b..3e2a952 100644 --- a/src/sass/components/_components-form-input-check.sass +++ b/src/sass/components/_components-form-input-check.sass @@ -1,8 +1,8 @@ // COMPONENTS // FORM-INPUT-CHECK // ================================================= -@use "sass:math" @use "sass:color" +@use "sass:math" @use "../abstracts/index" as * diff --git a/src/sass/components/_components-form-input-range.sass b/src/sass/components/_components-form-input-range.sass index 056f996..35c2ce7 100644 --- a/src/sass/components/_components-form-input-range.sass +++ b/src/sass/components/_components-form-input-range.sass @@ -1,8 +1,8 @@ // COMPONENTS // FORM-INPUT-RANGE // ================================================= -@use "sass:math" @use "sass:color" +@use "sass:math" @use "../abstracts/index" as * From dfc3818967a15d5947e7da31ff7daa8e5d9c19ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatriz=20Sopen=CC=83a=20Merino?= Date: Mon, 25 Nov 2024 02:59:30 +0100 Subject: [PATCH 17/17] fix(package): update project version number from `2.2.0` to `2.2.1` Description: - A new version tag is going to be created, so it needs to be updated in the `package.json` and `package-lock.json` files. --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4cbcd13..24a5133 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "validation-form", - "version": "2.2.0", + "version": "2.2.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "validation-form", - "version": "2.2.0", + "version": "2.2.1", "license": "ISC", "devDependencies": { "@babel/core": "^7.26.0", diff --git a/package.json b/package.json index c68da11..3590a20 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "2.2.0", + "version": "2.2.1", "name": "validation-form", "description": "Customized form with validation for different types of fields.", "author": "beatrizsmerino@gmail.com",