Customizing theme with Dart Sass results in compile error

1 Answer 55 Views
Styling / Themes
Jakub
Top achievements
Rank 1
Iron
Jakub asked on 19 Jun 2023, 12:30 PM | edited on 19 Jun 2023, 04:21 PM

Hello,

I'm using latest next.js framework, with Dart Sass 1.63.4. I've been trying to customize material theme, see:

Sample app

However, I'm encountering this error:

Syntax error: Selector "[hidden]" is not pure (pure selectors must contain at least one local class or id)

I've been following the documentation.

 

1 Answer, 1 is accepted

Sort by
1
Accepted
Jakub
Top achievements
Rank 1
Iron
answered on 19 Jun 2023, 04:24 PM | edited on 20 Jun 2023, 06:35 AM

I've managed to fix this issue. Instead of importing the Material theme inside page.module.scss and then importing it in page.tsx, I put the 

$kendo-color-primary: #ff0000; @import'~@progress/kendo-theme-material/dist/all.scss';

inside global.scss and import it inside layout.tsx.
Filip
Telerik team
commented on 21 Jun 2023, 07:32 AM

Hello, Jakub,

I am glad that you have found a working solution.

Moving the styles to a global scss file does indeed solve this error:

https://github.com/vercel/next.js/discussions/16050#discussioncomment-49022

Regards,
Filip

Tags
Styling / Themes
Asked by
Jakub
Top achievements
Rank 1
Iron
Answers by
Jakub
Top achievements
Rank 1
Iron
Share this question
or