Skip to content
This repository was archived by the owner on Jul 7, 2022. It is now read-only.
This repository was archived by the owner on Jul 7, 2022. It is now read-only.

Applying styles in NS Angular #23

@abhayastudios

Description

@abhayastudios

Hi!

Not sure if the creator of #22 is experiencing the same thing (there are too little details), but I am having some issues with applying the styles in Angular as well.

For example, in such a scenario (regular non-modal component) as below, the styles are applied only when using /deep/, whereas when using :host the styles get applied only to the first element of the ListView whereas the other items don't get the styles defined with the phone or tablet class. Since the Angular docs say that using /deep/ has been depreciated, I would prefer to avoid that use.

<ListView [items]="people$ | async" (itemTap)="onItemTap($event)">
      <ng-template let-item="item">
        <StackLayout class="card">
          <PeopleCard [profile]="item.profile"></PeopleCard>
        </StackLayout>
      </ng-template>
</ListView>

This works:

/deep/ .phone .card { width:300;  height:300; }
/deep/ .tablet .card { width:600;  height:600; }

This does not work:

.phone :host .card { width:300;  height:300; }
.tablet :host .card { width:600;  height:600; }

What am I missing?
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions