Did you verify this is a real problem by searching the [NativeScript Forum]
yes
Tell us about the problem
In NS 2.0 the application wide css variables where exposed so that my NS-Themes plugin could easily allow dynmically re-theming the application. The user could chose any number of themes while running the application and it would apply them in real time. Key factor, without messing up any other loaded css.
In NS 4 (possibly in a 3.x version???) this value was moved was put into local variables of the Style-Scope.ts file https://github.com/NativeScript/NativeScript/blob/master/tns-core-modules/ui/styling/style-scope.ts#L66
Without that ability anymore; I investigated the ability to change is the localCssSelectors
https://github.com/NativeScript/NativeScript/blob/master/tns-core-modules/ui/styling/style-scope.ts#L517 of the frame object. However, these are NOT propagated to the children from the Frame (see: #5911) . So basically with the new version of 4.x; I can't actually dynamically theme the entire app at runtime properly using either the frame or application value.. If I apply it to the page; then the theme is only applied to a single page. If I use the cssChanged event to attempt to modify the application wide css;
https://github.com/NativeScript/NativeScript/blob/master/tns-core-modules/ui/styling/style-scope.ts#L239 then I will overwrite any "app.css" which is NOT the desired behavior.
I need either some method to access the applicationAdditionalSelectors or I need the Frame to propagate the CSS (see: #5911) to its child properly.
Which platform(s) does your issue occur on?
Confirmed Android, iOS probably -- code is in common code files...
Please provide the following version numbers that your issue occurs with:
4.1 - Current latest release on everything.
Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.
https://github.com/NathanaelA/NativeScript-Themes
Did you verify this is a real problem by searching the [NativeScript Forum]
yes
Tell us about the problem
In NS 2.0 the application wide css variables where exposed so that my NS-Themes plugin could easily allow dynmically re-theming the application. The user could chose any number of themes while running the application and it would apply them in real time. Key factor, without messing up any other loaded css.
In NS 4 (possibly in a 3.x version???) this value was moved was put into local variables of the Style-Scope.ts file https://github.com/NativeScript/NativeScript/blob/master/tns-core-modules/ui/styling/style-scope.ts#L66
Without that ability anymore; I investigated the ability to change is the localCssSelectors
https://github.com/NativeScript/NativeScript/blob/master/tns-core-modules/ui/styling/style-scope.ts#L517 of the frame object. However, these are NOT propagated to the children from the Frame (see: #5911) . So basically with the new version of 4.x; I can't actually dynamically theme the entire app at runtime properly using either the frame or application value.. If I apply it to the page; then the theme is only applied to a single page. If I use the cssChanged event to attempt to modify the application wide css;
https://github.com/NativeScript/NativeScript/blob/master/tns-core-modules/ui/styling/style-scope.ts#L239 then I will overwrite any "app.css" which is NOT the desired behavior.
I need either some method to access the applicationAdditionalSelectors or I need the Frame to propagate the CSS (see: #5911) to its child properly.
Which platform(s) does your issue occur on?
Confirmed Android, iOS probably -- code is in common code files...
Please provide the following version numbers that your issue occurs with:
4.1 - Current latest release on everything.
Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.
https://github.com/NathanaelA/NativeScript-Themes