Skip to content

Theme switching light <-> dark mode not working correctly on IOS in NS Angular project #296

@cjohn001

Description

@cjohn001

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 8.1.0
  • Cross-platform modules: "@nativescript/core": "~8.1.2",
  • iOS Runtime: JSC
  • Plugin(s): "@nativescript/theme": "~3.0.1"

Describe the bug
When switching between dark and light mode The new theme is not applied correctly. It looks like pages in the history of the navigation stack do not get the new styles applied. When I navigate back in the page history the styles are partly from the old theme. When I than navigate forward again, the new theme styles are applied correctly.

In my _app-common.scss file I assign the styles as follows:

.mnd .text-field-grey {
	color: $dark-grey-text-color;
	background-color: $light-grey-color;
}
.ns-dark .mnd .text-field-grey {
	color: $very-light-grey-color;
	background-color: $medium-dark-grey-color;
}

and in the component specific scss files, I am using the following syntax:

.mnd .searchbar-bg {
	background-color: white;
}
.ns-root.ns-dark :host .mnd .searchbar-bg {
	background-color: $dark-mode-light-grey-blue;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions