We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Switching between themes

Thread ID:

Created:

Updated:

Platform:

Replies:

145386 Jun 19,2019 06:09 PM UTC Jun 20,2019 09:59 AM UTC Vue 1
loading
Tags: Data Grid
Eric Albino
Asked On June 19, 2019 06:09 PM UTC

I am trying to switch from the fabric theme to fabric-dark theme when switching from light mode to dark mode. I am setting up the application with v-app from vuetify. I wondering if its possible to switch between themes. Code Example of the template section below

MainApp.Vue
<template>
<v-app :dark="getDarkMode">
<v-content>
<v-container fluid>
<v-layout>
<ejs-grid
:dataSource="data">
     <e-column field="userId" width="120"></e-column>
<e-column field="username" headerText="Username" textAlign="Center" width="120"></e-column>
    </ejs-grid>       
</v-layout>
</v-container>
</v-content>
</v-app>
</template>



 

Pavithra Subramaniyam [Syncfusion]
Replied On June 20, 2019 09:59 AM UTC

Hi Eric, 
 
Thanks for contacting Syncfusion support. 
 
From your query, we found that you want to change the Syncfusion components theme programmatically. So, we suggest to use the Syncfusion CDN styles to achieve this requirement. While using CDN you can achieve this like as below code snippet, 
 
CDN Links: 
 
<link class="syncTheme" rel='nofollow' href="http://cdn.syncfusion.com/ej2/ej2-base/styles/fabric.css" rel="stylesheet" /> 
<link class="syncTheme" rel='nofollow' href="http://cdn.syncfusion.com/ej2/ej2-vue-buttons/styles/fabric.css" rel="stylesheet" /> 
<link class="syncTheme" rel='nofollow' href="http://cdn.syncfusion.com/ej2/ej2-vue-grids/styles/fabric.css" rel="stylesheet" /> 
<link class="syncTheme" rel='nofollow' href="http://cdn.syncfusion.com/ej2/ej2-vue-popups/styles/fabric.css" rel="stylesheet" /> 
<link class="syncTheme" rel='nofollow' href="http://cdn.syncfusion.com/ej2/ej2-vue-navigations/styles/fabric.css" rel="stylesheet" /> 
<link class="syncTheme" rel='nofollow' href="http://cdn.syncfusion.com/ej2/ej2-vue-dropdowns/styles/fabric.css" rel="stylesheet" /> 
 
Button Click: 
 
onClick: function(args) { 
        var cssLink = document.getElementsByClassName('syncTheme'); 
        for (var i = 0; i < cssLink.length; i++) { 
            cssLink[i].rel='nofollow' href = cssLink[i].rel='nofollow' href.replace("fabric", "fabric-dark"); 
        } 
    } 
 
In this code we have used button click to change the fabric to fabric-dark theme. We have prepared the sample with this requirement and you can find that sample from the below link, 
 
 
Regards, 
Pavithra S. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon