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

Replacing @import with @use in theme-base + removing global variables/mixins ? #158

Open
baloghbence0915 opened this issue Dec 8, 2024 · 0 comments

Comments

@baloghbence0915
Copy link

Hi all,

I'm wondering is there any intention to replace deprecated sass @import rules by the more modern @use?

Of course this would change a lot on how the 'factory themes' (in this repo) are declared also it would cause braking changes for dev teams, that rely on this repo, for customizing their own PrimeNg theme.

One importan and noticable implementation diff, between these 2 is the matter of global variables, mixins...

While this is possible with @import, where $specialBgColor is a global variable:

// variables.scss
$specialBgColor: red;

// button.scss
.themed-element {
    background-color: $specialBgColor;
}

// theme.scss
@import './variables';
@import './button';

// OUTPUT
.theme-element {
  background-color: red;
}

This wouldn't be possible with @use. As this rule requires to import variables/mixins/functions into the file, where you need them. And use them with or w/o namespace.

Thanks for your replies,
Bence

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

No branches or pull requests

1 participant