Skip to content

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

@baloghbence0915

Description

@baloghbence0915

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions