简体   繁体   English

收集所有包含特定颜色的CSS设置

[英]Collect all CSS settings that contains a certain color

I want to change color of a Wordpress theme. 我想更改Wordpress主题的颜色。 The problem is that I can not use "search and replace" of the current CSS file. 问题是我不能使用当前CSS文件的“搜索和替换”。 I must override all color settings in a separate file (in a child theme). 我必须在单独的文件(在子主题中)中覆盖所有颜色设置。 And there are over 100 different settings with the color. 并且有超过100种不同的颜色设置。

I need to collect all selectors and the CSS settings that contains this color and overide it by a new CSS file. 我需要收集所有选择器和包含此颜色的CSS设置,并用新的CSS文件覆盖它。

I would like this: 我想这样:

#some_id{width:100px;background:#ff0000;}
.some_class{height:100px;background:#ff0000;color:#ff0000;}
a:hover{color:#ff0000;font:12px/arial}

To become this: 要成为这个:

#some_id,.some_class{background:#ff0000;}
.some_class,a:hover{color:#ff0000;}

Any one know a tool or script for that? 有谁知道一种工具或脚本吗?

I know some basic PHP and Javascript. 我知道一些基本的PHP和Javascript。

Does your wordpress theme have different "skins" for different colors? 您的wordpress主题是否针对不同的颜色具有不同的“外观”? Like is there a setting where you can pick from a few limited pre-set colors that will turn all these 100+ elements that color? 就像有没有一种设置,您可以从几种有限的预设颜色中进行选择,从而将所有这100多种元素变成该颜色? If so there is probably a CSS file somewhere for each color option they provided (for example green.css, blue.css). 如果是这样,他们提供的每种颜色选项可能都在某个CSS文件中(例如,green.css,blue.css)。 you can copy/paste the code from there to find all the selectors 您可以从此处复制/粘贴代码以找到所有选择器

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

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