Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[FR] :host-context - Allow theming of your app #1706

Copy link
Copy link
Open
@larssn

Description

@larssn
Issue body actions

I'd like to request support for :host-context

It doesn't seem to be supported currently.
With it, it would be possible to easily theme your app without breaking component encapsulation.
Currently, all theming has to be in global (s)css classes which is a mess to maintain.

Small example:
my-component.html
<Label text="Hello World"></Label>

my.component.scss

:host-context(.theme-light) Label {
  background-color: white;
  color: black;
}

:host-context(.theme-dark) Label {
  background-color: black;
  color: white;
}

app.component.html
<StackLayout [ngClass]="{'theme-light': light, 'theme-dark': !light}"><router-outlet></router-outlet></StackLayout>

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.