From 974f98beee3a6e9e74446c6f86fc0f4708cd7ab8 Mon Sep 17 00:00:00 2001 From: mohamad4j Date: Fri, 22 Aug 2025 09:25:35 +0330 Subject: [PATCH] fix: replace @import with @use to remove Sass warnings --- src/scss/_closeButton.scss | 2 ++ src/scss/_icon.scss | 2 ++ src/scss/_mixins.scss | 4 ++++ src/scss/_progressBar.scss | 2 ++ src/scss/_toast.scss | 2 ++ src/scss/_toastContainer.scss | 2 +- src/scss/animations/_bounce.scss | 7 ++----- src/scss/animations/_fade.scss | 9 +++------ src/scss/animations/_slideBlurred.scss | 8 +++----- src/scss/index.scss | 19 ++++++++++--------- 10 files changed, 31 insertions(+), 26 deletions(-) create mode 100644 src/scss/_mixins.scss diff --git a/src/scss/_closeButton.scss b/src/scss/_closeButton.scss index f54b030..d163dbc 100644 --- a/src/scss/_closeButton.scss +++ b/src/scss/_closeButton.scss @@ -1,3 +1,5 @@ +@use "variables" as *; + .#{$vt-namespace}__close-button { font-weight: bold; font-size: 24px; diff --git a/src/scss/_icon.scss b/src/scss/_icon.scss index 00af25e..000d021 100644 --- a/src/scss/_icon.scss +++ b/src/scss/_icon.scss @@ -1,3 +1,5 @@ +@use "variables" as *; + .#{$vt-namespace}__icon { margin: auto 18px auto 0px; background: transparent; diff --git a/src/scss/_mixins.scss b/src/scss/_mixins.scss new file mode 100644 index 0000000..500820d --- /dev/null +++ b/src/scss/_mixins.scss @@ -0,0 +1,4 @@ +$trans-cubic-bezier: cubic-bezier(0.215, 0.61, 0.355, 1); +@mixin timing-function { + animation-timing-function: $trans-cubic-bezier; +} diff --git a/src/scss/_progressBar.scss b/src/scss/_progressBar.scss index 8893706..4acca42 100644 --- a/src/scss/_progressBar.scss +++ b/src/scss/_progressBar.scss @@ -1,3 +1,5 @@ +@use "variables" as *; + @keyframes scale-x-frames { 0% { transform: scaleX(1); diff --git a/src/scss/_toast.scss b/src/scss/_toast.scss index 5f8a756..1d26d16 100644 --- a/src/scss/_toast.scss +++ b/src/scss/_toast.scss @@ -1,3 +1,5 @@ +@use "variables" as *; + .#{$vt-namespace}__toast { display: inline-flex; position: relative; diff --git a/src/scss/_toastContainer.scss b/src/scss/_toastContainer.scss index 579b146..39f6a8b 100644 --- a/src/scss/_toastContainer.scss +++ b/src/scss/_toastContainer.scss @@ -1,5 +1,5 @@ @use "sass:math"; - +@use "variables" as *; .#{$vt-namespace}__container { z-index: $vt-z-index; position: fixed; diff --git a/src/scss/animations/_bounce.scss b/src/scss/animations/_bounce.scss index a2d817e..977e9fc 100644 --- a/src/scss/animations/_bounce.scss +++ b/src/scss/animations/_bounce.scss @@ -1,9 +1,6 @@ // Bounce Animation taken from https://github.com/fkhadra/react-toastify -$trans-cubic-bezier: cubic-bezier(0.215, 0.61, 0.355, 1); -@mixin timing-function { - animation-timing-function: $trans-cubic-bezier; -} - +@use "../variables" as *; +@use "../mixins" as *; @keyframes bounceInRight { from, 60%, diff --git a/src/scss/animations/_fade.scss b/src/scss/animations/_fade.scss index 42c7c13..7c5c13d 100644 --- a/src/scss/animations/_fade.scss +++ b/src/scss/animations/_fade.scss @@ -1,12 +1,9 @@ -$trans-cubic-bezier: cubic-bezier(0.215, 0.61, 0.355, 1); -@mixin timing-function { - animation-timing-function: $trans-cubic-bezier; -} - +@use "../variables" as *; +@use "../mixins" as *; /* ---------------------------------------------- * Modified version from Animista * Animista is Licensed under FreeBSD License. - * See http://animista.net/license for more info. + * See http://animista.net/license for more info. * w: http://animista.net, t: @cssanimista * ---------------------------------------------- */ diff --git a/src/scss/animations/_slideBlurred.scss b/src/scss/animations/_slideBlurred.scss index 07e27b4..0910539 100644 --- a/src/scss/animations/_slideBlurred.scss +++ b/src/scss/animations/_slideBlurred.scss @@ -1,12 +1,10 @@ -$trans-cubic-bezier: cubic-bezier(0.215, 0.61, 0.355, 1); -@mixin timing-function { - animation-timing-function: $trans-cubic-bezier; -} +@use "../variables" as *; +@use "../mixins" as *; /* ---------------------------------------------- * Modified version from Animista * Animista is Licensed under FreeBSD License. - * See http://animista.net/license for more info. + * See http://animista.net/license for more info. * w: http://animista.net, t: @cssanimista * ---------------------------------------------- */ diff --git a/src/scss/index.scss b/src/scss/index.scss index e4a996a..4db14ca 100644 --- a/src/scss/index.scss +++ b/src/scss/index.scss @@ -1,12 +1,13 @@ @charset "UTF-8"; -@import "variables"; -@import "toastContainer"; -@import "toast"; -@import "closeButton"; -@import "progressBar"; -@import "icon"; +@forward "variables"; +@forward "toastContainer"; +@forward "toast"; +@forward "closeButton"; +@forward "progressBar"; +@forward "icon"; + +@forward "animations/bounce"; +@forward "animations/fade"; +@forward "animations/slideBlurred"; -@import "animations/bounce"; -@import "animations/fade"; -@import "animations/slideBlurred";