[英]Closure stylesheets css renaming issue
Closure Stylesheets can rename css classes. 闭包样式表可以重命名CSS类。 Example:
例:
.class-one {
// ...
}
.class-two {
// ...
}
After compilation the javascript output will be: 编译后,javascript输出将是:
{
'class' : 'a',
'one' : 'b',
'two' : 'c'
}
And the css output: 和css输出:
.a-b {
// ...
}
.a-c {
// ...
}
I have a big project with many css classes. 我有一个很多CSS类的大型项目。 After compilation I noticed that not every word was renamed.
编译后,我注意到并不是每个单词都被重命名了。 In "a-Rf-rightslider" first two words were renamed while the last one is not.
在“ a-Rf-rightslider”中,前两个单词被重命名,而最后一个则没有。
I think that Closure Stylesheets has limitation on the renaming array size. 我认为Closure Stylesheets对重命名数组大小有限制。 Something like: 'a', 'b', ..., 'ZY', 'ZZ'.
类似于:“ a”,“ b”,...,“ ZY”,“ ZZ”。 And skips all the rest.
并跳过其余所有内容。 Am I right?
我对吗? Any ideas?
有任何想法吗?
AFAIK There is no such limitation. AFAIK没有这样的限制。 Classnames can go way beyond ZZ and I have seen names like aScF even.
类名可以超越ZZ,甚至我也见过像aScF这样的名称。
Can you make sure that the class names are used with goog.getCssName
? 您可以确保将类名与
goog.getCssName
一起使用吗?
Also now days Googlers prefer to name their classes in camelCase
instead of joining-with-dash
because that gives you no -
s in the minified name. 另外现在的Google天更愿意说出他们在课堂上
camelCase
,而不是joining-with-dash
,因为这让你没有-
S IN缩小的名称。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.