ASP.NET MVC如何用javascript更改较少的变量?

时间:2021-04-25 03:37:58

In my application I must add feature for the user to chnage UI colors.

在我的应用程序中,我必须为用户添加功能以更新UI颜色。

For this purpose I have created .less file and set some global variables to their default value.

为此,我创建了.less文件并将一些全局变量设置为其默认值。

What is the best practice for creating theme in Asp.net MVC?

在Asp.net MVC中创建主题的最佳实践是什么?

1 个解决方案

#1


2  

I would create a base styling for the default styling and different stylesheets (less files and finally seperate .css files) for each colorscheme, each scheme overrides the colors in the base file, then dynamically load the stylesheet according to your business logic using javascript

我将为每个colorscheme创建默认样式和不同样式表(较少文件和最终单独的.css文件)的基本样式,每个方案覆盖基本文件中的颜色,然后使用javascript根据您的业务逻辑动态加载样式表

Dynamically loading css stylesheets

动态加载css样式表

#1


2  

I would create a base styling for the default styling and different stylesheets (less files and finally seperate .css files) for each colorscheme, each scheme overrides the colors in the base file, then dynamically load the stylesheet according to your business logic using javascript

我将为每个colorscheme创建默认样式和不同样式表(较少文件和最终单独的.css文件)的基本样式,每个方案覆盖基本文件中的颜色,然后使用javascript根据您的业务逻辑动态加载样式表

Dynamically loading css stylesheets

动态加载css样式表