Topic: Standalone SCSS transpile (FYI)

Flub premium asked 1 year ago


Would be better SCSS could transpile regardless of Angular project (FYI)

My project loads css dynamically because I need to be able to switch between skins. Therefore, I have seperate styling folders for these skins. To use a user-chosen skin, I add a link tag to the head, as such, I don't use the regular Angular styles.scss.

After an upgrade to MDB5 3.0, I had some layout issues (Full-screen-width dropdowns... ) After tracking down the problem, I found out the reason:

mdb-angular-ui-kit/assets/scss/mdb.scss contains the following lines:

@import '~@angular/cdk/overlay-prebuilt.css'; @import '~@angular/cdk/text-field-prebuilt.css';

Therefore transpiler cannot import those two files because tildes are package-manager related, not scss. I solved the problem doing this in my scss file:

@import "../node_modules/mdb-angular-ui-kit/assets/scss/mdb"; @import '../node_modules/@angular/cdk/overlay-prebuilt'; @import '../node_modules/@angular/cdk/text-field-prebuilt';

Should these two file imports not be outside of mdb.scss for better portability?

Thanks


Arkadiusz Idzikowski staff commented 1 year ago

Could you please edit your post and provide a more detailed description of the approach you use to load the styles? We would like to make sure to test that correctly on our end.


Grzegorz Bujański staff answered 1 year ago


Thanks for reporting. We will discuss it in the team



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Premium
  • Premium support: Yes
  • Technology: MDB Angular
  • MDB Version: MDB5 3.0.0
  • Device: PC
  • Browser: All
  • OS: Windows 11
  • Provided sample code: No
  • Provided link: No