Use $primaryColor for h1 for all themes - Sapphire

Post Reply
msbhalani
Posts: 4
Joined: 17 Sep 2016, 06:41

15 Mar 2020, 06:49

Trying to use $primaryColor for h1 (one of the component) and should work for all themes.
What's the way to use $primaryColor variable inside component scss?
I tried following entries as part of _theme_styles.scss but that does not work either.

/* Add your customizations of theme here */
h1.primary {
color:$primaryColor;
}

Can you please advise?

Thanks!

merve7
Posts: 554
Joined: 12 Sep 2017, 10:44

20 Mar 2020, 08:43

Hi,
I tried your code and it works but please, check your _theme.scss file (src/assets/sass/theme/_theme.scss), it should contain "@import '../overrides/theme_styles';". You can also try to enclose your code in the body tag;

Code: Select all

body {
     h1.primary {
         color:$primaryColor;
     }
}
Image

msbhalani
Posts: 4
Joined: 17 Sep 2016, 06:41

26 Mar 2020, 06:35

Thank you for your suggestions. I tried both options but none of them worked for me.

Please see attached. I am using Sapphire v8...

https://i.ibb.co/4j8Z4xh/1.jpg
https://i.ibb.co/jTSxp7y/2.jpg
https://i.ibb.co/x1ByS51/3.jpg

Thanks!

msbhalani
Posts: 4
Joined: 17 Sep 2016, 06:41

27 Mar 2020, 22:54

I tried even v9 ("as is" template with just code change for this test)... styles/css are not picked up from assets/saas/theme/*.scss files. I tried to put it in couple files to just test it and none of them work.

I tried to use css to fix header (refer one of the forum solution)...pasted in "_layout_styles"... did not work but as soon as I put it in "styles.scss" it did work.

Any idea why none of the change reflect from files under overrides folder?

Any help will be appreciated.

Regards,

aragorn
Posts: 3918
Joined: 29 Jun 2013, 12:38

03 Apr 2020, 10:17

Hi,

Thanks a lot for the screenshots! Please change the following code in theme.scss;

Code: Select all

...
@import '../overrides/_theme_styles'; /* instead of theme_styles */
Best Regards,

Post Reply

Return to “Sapphire - PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest