Questions tagged darkmode

Explore the latest questions and answers asked by our top developers.

Dynamically change less variable for dark theme in Angular

I hope it is possible. Need to dynamically change less variable for using dark theme. The code is below: @theme: dark; @colors: { primary-violet-light: #608cef; primary-violet-dark: #031d58; } @primary-violet: @colors[[email protected]{theme}]; // have to be #031d58 But even it doesn’t work. The error is in the last row. "[email protected]{theme}" have to be primary-violet-dark but it doesnt. […]

By Illia Haponov
Categorized as angular, darkmode, javascript, less, variables Tagged , , , ,

Ionic how to know programmatically if the dark theme is applied?

I’m working with Ionic angular and Mapbox. I want to know which theme is applied to load the mapbox theme too… something like this: const currentIonicTheme = ionic.theme.apllied; // here is where I want to know how to get the current theme in the app const map = new mapboxgl.Map({ style: `mapbox://styles/mapbox/${currentIonicTheme}-v10`, center: [this.lng,], […]

How to load third party custom element into Angular app

I wanna include this dark-mode-togle custom element in my Angular app. After adding in package.json and angular.json‘s scripts section and reading on the official Angular guide on custom elements I’m still not sure how to to embed it correctly in the App module. The docs I found are all talking about including an custom element […]

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us