Hello everybody.
How can I detect when Dark Mode is selected so I can give my own components the correct looks?
Thank you!
Detect Dark Mode
Forum rules
Please note that response time for technical support is within 3-5 business days.
Please note that response time for technical support is within 3-5 business days.
-
- Posts: 5281
- Joined: 29 Jun 2013, 12:38
Hi,
We can detect it using darkMode variable in app.main.component.ts in our sample project. I don't know the structure in your project, but if you have a switch-mode structure, the variable you use for that structure can help you.
Then, maybe you can add a class to app.main.component.html
Best Regards,
We can detect it using darkMode variable in app.main.component.ts in our sample project. I don't know the structure in your project, but if you have a switch-mode structure, the variable you use for that structure can help you.
Then, maybe you can add a class to app.main.component.html
Code: Select all
<div class="layout-wrapper" (click)="onLayoutClick()" [ngClass]="{'layout-dark': darkMode, ...}"
...
Github Profile: https://github.com/mertsincan
-
- Information
-
Who is online
Users browsing this forum: No registered users and 4 guests