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

update @import to @use #43

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

SeraphCoding
Copy link

@SeraphCoding SeraphCoding commented Nov 26, 2024

The usage of @import has been deprecated.
Global built in functions are also deprecated.

This PR imports sass:string and uses string.to-lower-case instead and changes all @import rules to @use instead.

Angular 19 will throw warnings during compilation - this fixes this issue.

Closes #44

@SeraphCoding SeraphCoding changed the title Seraph coding switch to @use update @import to @use Nov 26, 2024
@SeraphCoding SeraphCoding marked this pull request as draft November 26, 2024 12:13
@import has been deprecated
global built in functions are deprecated
@SeraphCoding SeraphCoding force-pushed the SeraphCoding-switch-to-@use branch from da85c6e to 8fc235e Compare November 26, 2024 16:24
@SeraphCoding
Copy link
Author

SeraphCoding commented Nov 28, 2024

@marella Could you take a look at this PR, please? It should (in theory) be a quick one.

@etienne582
Copy link

Please can this be merged :'( ?

@SeraphCoding
Copy link
Author

SeraphCoding commented Jan 6, 2025

Don't think this will happen anytime soon. Maintainer seems to be busy.

I've moved my projects to Fontsource.
See:
https://fontsource.org/docs/getting-started/material-symbols

The different material symbols versions can be found here:
https://fontsource.org/?query=Material%20Symbols

Copy link

@JuNe98 JuNe98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should change the suggested code. Everything else looks good

@@ -1,3 +1,3 @@
@import 'core';
@use 'core';

@include material-symbols-font('Material Symbols Outlined');
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have to add the namespace core here according to https://sass-lang.com/documentation/at-rules/use/#loading-members.

@include core.material-symbols-font('Material Symbols Outlined');

@@ -1,3 +1,3 @@
@import 'core';
@use 'core';

@include material-symbols-font('Material Symbols Rounded');
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have to add the namespace core here according to https://sass-lang.com/documentation/at-rules/use/#loading-members as well.

@include core.material-symbols-font('Material Symbols Rounded');

@@ -1,3 +1,3 @@
@import 'core';
@use 'core';

@include material-symbols-font('Material Symbols Sharp');
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have to add the namespace core here according to https://sass-lang.com/documentation/at-rules/use/#loading-members as well.

@include core.material-symbols-font('Material Symbols Sharp');

@import 'outlined';
@import 'rounded';
@import 'sharp';
@use 'outlined';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is better to use @forward instead of @use in side an index file. @forward takes your modules into an index file and then spits them out again.
Please have a look at the documentation https://sass-lang.com/documentation/at-rules/forward

@OleksiiSmerdov
Copy link

Hi @SeraphCoding,
Please also update the corresponding section in the Readme.md
https://github.com/marella/material-symbols/blob/main/material-symbols/README.md#using-sass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@import & global built in functions are deprecated and will be removed in Dart Sass 3.0.0
4 participants