PrimeNG does not work with SASS theme change

UI Components for Angular
Post Reply
JeffBrower
Posts: 25
Joined: 31 Jan 2013, 02:54

18 Jun 2018, 16:04

When using the SCSS/SASS option for styling, the theme change fails.

The error returned is:

Code: Select all

 ERROR TypeError: Cannot read property 'href' of null
The relevant lines of code are:

Code: Select all

   const themeLink: HTMLLinkElement = <HTMLLinkElement>document.getElementById('theme-css');
   const href = themeLink.href;
in my angular-cli.json I enabled SCSS as my default like this:

Code: Select all

  "defaults": {
    "styleExt": "scss",
    "component": {}
  }
I am enabling the SCSS with this in styles.scss:

Code: Select all

@import 'assets/theme/theme-blue-light.scss',
        'assets/layout/css/layout-blue-light.scss'
Everything works as long as you are willing to dedicate to a single theme and remove user choices.

Is this intended functionality, or is PrimeNG truly limited to only CSS if you want to use the theme switching function?
PrimeNG (Angular): Apollo, Mirage
PrimeFaces (JSF)

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 15 guests