Skip to content

CSS special selector ":host" only work first time #1845

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
m-abs opened this issue Jun 1, 2019 · 0 comments · Fixed by #1852
Closed

CSS special selector ":host" only work first time #1845

m-abs opened this issue Jun 1, 2019 · 0 comments · Fixed by #1852
Labels

Comments

@m-abs
Copy link
Contributor

m-abs commented Jun 1, 2019

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: 5.4.0
  • Cross-platform modules:
  • Android Runtime: 5.4.0
  • iOS Runtime:
  • Plugin(s):
  • NativeScript-Angular: 7.2.4
  • Angular: 7.2.15

Describe the bug

The :host css selector only works first time, after that that the selector is ignored for the component.

To Reproduce

  • Use :host in a components stylesheet.
  • Use the component more than once.
  • The style is ignored.

Expected behavior
I'd expect the style to be applied to every instance of the component.

Sample project

I've made a small project with a ListView and an item-component here:
https://play.nativescript.org/?template=play-ng&id=NXYfcY&v=15

All the items should have: background-color = green, color = black, text centered, font-weight = normal and padding = 8.
But only the first item looks like that the others have: background-color: blue, color = white, text right aligned, font-weight = bold and no padding.

Additional context

@m-abs m-abs changed the title CSS special selector ":host" only works first tiem. CSS special selector ":host" only work first time Jun 3, 2019
@tsonevn tsonevn added the bug label Jun 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants