-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0 #7771
Comments
same stuff mate |
same here |
1 similar comment
same here |
I know this comment is getting downvoted, but I found this github thread while trying to migrate from Change this: @import 'stylesheet.scss' to this: @use 'stylesheet.scss' as *;
// or `@use 'stylesheet.scss' as stylesheet;`
// which can then be used like `font-size: stylesheet.$font-size;` |
same here |
@knakamura13 , I changed it, but the warnings are still displayed in the console Upd, works for me: export default defineConfig({
plugins: [react()],
css: {
preprocessorOptions: {
scss: {
api: 'modern-compiler',
},
},
},
}) After that, I changed all |
What are my options if I've got (S)CSS rules/properties in the files I want to import globally as well, and not just "variables, mixins, and functions". |
Watch message in console! $ npm install -g sass-migrator ($ sass-migrator module --migrate-deps <path/to/style.scss>) I done it - and it works! |
After changing to @use it shows a Deprecation Warning |
Yes, I got too! U must change your js-files. |
While it's necessary for everyone to update their own stylesheets to use |
sass used to be the best part of my job. |
So no way to use global variables now without having to import them in each and every scss component? |
I found a possible solution to this problem using sass (scss) and webpack (not sure if this is a good way to solve it): module.exports = {
// ...
module: {
// ...
rules: [
{
test: /\.scss$/,
use: [
'style-loader',
'css-loader',
{
loader: 'sass-loader',
options: {
additionalData: `@use 'pathToFile.scss' as *;`,
},
},
],
},
],
},
}; And in this file we need to import other files using @forward: @forward 'pathToAnotherFile.scss'; So now we can use our variables in the app: .header{
color: $primary;
} |
Check that this is really a bug
Reproduction link
https://codesandbox.io/p/devbox/zf6kxq
Bug description
Deprecation Warning on line 13, column 9 of node_modules/swiper/swiper.scss:
Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.
More info and automated migrator: https://sass-lang.com/d/import
Expected Behavior
Compatibility with Dart Sass 3.0.0.
Actual Behavior
No response
Swiper version
11.1.14
Platform/Target and Browser Versions
Dart Sass 3.0
Validations
Would you like to open a PR for this bug?
You can check PR here: #7772
The text was updated successfully, but these errors were encountered: