Issue
I am using this HTML syntax that produces the toolbar to be in my primary color and the text inside the toolbar to be in contrast with that color:
<ion-header>
<ion-toolbar color="primary">
<ion-title>
GreenWalls Aplikace
</ion-title>
</ion-toolbar>
</ion-header>
My application will have many page's and I don't want to set all of the toolbar color's manually - instead I want to set this color inside global.scss
file and apply it automatically and globally. This is what I have tried and didn't work so far (from Ionic theming tutorial):
ion-toolbar {
background: var(--ion-color-primary);
color: var(--ion-color-primary-contrast);
}
Result from the code above:
How can I achieve the same output in SCSS
as using in HTML color="primary"
in Ionic (using Angular framework)?
Solution
You forgot "--" before CSS properties name.
Try this :
ion-toolbar {
--background: var(--ion-color-primary);
--color: var(--ion-color-primary-contrast);
}
Answered By - Adrii SAULNIER
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.