@DavidDudson wrote:
Hi all,
Version: Ionic 4.0.0-beta.0.
Framework: Angular 6Scanning the new docs: https://beta.ionicframework.com/docs/theming/advanced/
There is no mention of how to add a new colour, outside of “primary/secondary etc”
I would like to use custom colors in the stencil components.
For example:
<ion-icon name='menu' color='charcoal'></ion-icon>
:root { --ion-color-charcoal: #454545; --ion-color-charcoal-rgb: 69,69,69; --ion-color-charcoal-contrast: #FFFFFF; --ion-color-charcoal-contrast-rgb: 255,255,255; --ion-color-charcoal-shade: #3D3D3D; --ion-color-charcoal-tint: #4C4C4C; }
The above does not actually work.
Looking in ionic.functions.color.scss…
@function ion-color
Uses the $colors map to pull out variations, although@function current-color
just uses the css variable.Bonus question:
Is it possible to add new colours at runtime via ngStyle?
Posts: 1
Participants: 1