Skip to content

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

Closed

Description

@m-abs

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

Activity

  1. changed the title [-]CSS special selector ":host" only works first tiem.[/-] [+]CSS special selector ":host" only work first time[/+] on Jun 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions