Overriding Theme Variables

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
mb99
Posts: 4
Joined: 08 Jun 2020, 22:43

08 Jun 2020, 22:48

Hello,

I was looking at the mirage-ng-9.0.1 angular demo. I tried overriding the

Code: Select all

$primaryColor
and

Code: Select all

$primaryTextColor
variables within the

Code: Select all

/overrides/_theme_variables.scss
file, but that doesn't work.
It looks like importing goes like this:
1) import theme file (for example blue>theme-light.scss)
2) import vars/_theme_light
3) import variables/_theme
4) import overrides/_theme_variables

but the variables in 2) will override 4) since they are declared afterwards?

Thanks for your help!

yigitfindikli
Posts: 449
Joined: 08 Aug 2018, 14:09

18 Jun 2020, 14:07

mb99 wrote:
08 Jun 2020, 22:48
Hello,

I was looking at the mirage-ng-9.0.1 angular demo. I tried overriding the

Code: Select all

$primaryColor
and

Code: Select all

$primaryTextColor
variables within the

Code: Select all

/overrides/_theme_variables.scss
file, but that doesn't work.
It looks like importing goes like this:
1) import theme file (for example blue>theme-light.scss)
2) import vars/_theme_light
3) import variables/_theme
4) import overrides/_theme_variables

but the variables in 2) will override 4) since they are declared afterwards?

Thanks for your help!
Hi,
$primaryColor and $primaryTextColor coming from layout variables. You need to use _layout_variables.scss.

mb99
Posts: 4
Joined: 08 Jun 2020, 22:43

18 Jun 2020, 17:47

Oh gotcha, I was under the impression we could avoid importing Layout files altogether (we only needed the themed components). But that makes sense.
Thanks!

mb99
Posts: 4
Joined: 08 Jun 2020, 22:43

10 Jul 2020, 00:13

Hi again,

I'm running into an issue for overriding this variable:

Code: Select all

$datatableCellBorderColor
I tried overriding within overrides/_theme_variables.scss as well as overrides/_layout_variables.scss so that my Pagination border color can change. None of them seem to work?

Thanks

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

13 Jul 2020, 10:29

Hi,

You're right, so sorry. We fixed for the next release but you can follow the below steps to use until the next release;

1. remove last import line (@import '../overrides/theme_variables';) from the _theme.scss (src/assets/sass/variables/_theme.scss)
2. add new import line (@import '../overrides/_theme_variables';) end of the _theme_light.scss and _theme_dark.scss file (src/assets/sass/variables/_theme_light.scss and src/assets/sass/variables/_theme_dark.scss)

You can use now the overrides/_theme_variables file.

mb99
Posts: 4
Joined: 08 Jun 2020, 22:43

14 Jul 2020, 22:12

merve7 wrote:
13 Jul 2020, 10:29
Hi,

You're right, so sorry. We fixed for the next release but you can follow the below steps to use until the next release;

1. remove last import line (@import '../overrides/theme_variables';) from the _theme.scss (src/assets/sass/variables/_theme.scss)
2. add new import line (@import '../overrides/_theme_variables';) end of the _theme_light.scss and _theme_dark.scss file (src/assets/sass/variables/_theme_light.scss and src/assets/sass/variables/_theme_dark.scss)

You can use now the overrides/_theme_variables file.
Sounds good, will do that, thank you!

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

02 Aug 2020, 14:04

Thanks a lot, @merve and @yigitfindikli ;)

Post Reply

Return to “Mirage - PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests