简体   繁体   English

我如何在同一个 angular 项目中实现 2 个 html 主题

[英]How can i implement 2 html theme in same angular project

I want to use different html theme for my angular blog project.我想为我的 angular 博客项目使用不同的 html 主题。 One is for front view and another is for admin view.一个用于前视图,另一个用于管理视图。 but how can i do it?但我该怎么做? If i use my all html and js inside angular.json file html does not work correctly.如果我在 angular.json 文件中使用我所有的 html 和 js,则 ZFC35FDC70D5FC69D769883A8ZE 不能正常工作。 What is the solution解决办法是什么

it is already a good time to make use of css variables.现在是使用 css 变量的好时机。 they are supported for almost all users.几乎所有用户都支持它们。 lets say you have main and secondary color.假设您有主要颜色和次要颜色。 default theme file could look like this默认主题文件可能如下所示

document {
  --my-main-color: #aabbcd;
  --my-secondary-color: green;
}

component.css组件.css

.element {
  background: var(--my-main-color);
}

.input {
  background: var(--my-secondary-color);
}

than you can overwrite value of any "theme property" through changing style of html element您可以通过更改html元素的样式来覆盖任何“主题属性”的值

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM