NativeScript / theme

@nativescript/theme
https://v7.docs.nativescript.org/ui/theme
Apache License 2.0
127 stars 44 forks source link

CSS variable override #286

Closed sivo1981 closed 3 years ago

sivo1981 commented 3 years ago

What is the correct way to override CSS variable $accent-dark? Overriding $secondary-dark works as expected.

@import "~@nativescript/theme/core";
/*@import "~@nativescript/theme/default";*/

//https://docs.nativescript.org/ui/theme

/* Colors */
//$primary: #8dc640;
$accent: #8CC640;
$accent-dark: #8CC640;
$secondary: #E9E9E9;
$secondary-dark: #333132;
$complementary: #FFF;

/* The variables are loaded before the Core styles */
@import '~@nativescript/theme/index';
sivo1981 commented 3 years ago

Overriding variables works as expected. Issue was only on Android with dark mode. Setting <item name="android:forceDarkAllowed">false</item> in App_Resources\Android\src\main\res\values-v29\styles.xml resolves this issue.