How to get selected theme scss variables

Post Reply
Posts: 10
Joined: 02 Jan 2018, 09:32

03 Jan 2018, 14:05

I have custom button, which has white background color and text color same color with theme color. I want to change text color when theme changes. How can i accomplish it

Posts: 648
Joined: 12 Sep 2017, 10:44

17 Jan 2018, 10:29

You can define variable for button text color in theme files and use this variable for button color. Like this;
in your-theme.scss or your-theme.css

Code: Select all

//other variables
and your.css or your.scss

Code: Select all

.ui-button {
        color: $buttonTextColor;
        background-color: $primaryColor;
        //other codes
And you can see in examples in src/assets/sass and src/assets/theme folders.

Posts: 20
Joined: 11 Aug 2018, 11:20

11 Aug 2018, 12:44

Adding a color will generate CSS styles for all Ionic components. This increases the size of your CSS file and can slow down your application. If you only need to use the color in some places, we recommend that you add a new Sass variable.

Posts: 648
Joined: 12 Sep 2017, 10:44

10 Sep 2018, 09:05

Thank you for recommendation.

Post Reply

Return to “Verona - PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests