目前我正在为一些应用程序开发 GUI,该应用程序是在 QT(多平台框架)中开发的。QT 中的 GUI 可以设置为普通 CSS 样式。
因此,我将 GUI 开发为一个基本的 Web 应用程序(HTML5、CSS3 和 JS),并且出于某些原因,我使用 LESS 预处理器进行样式设置和创建 OOCSS(面向对象的 CSS)......
由LESS生成:
.button {
position: absolute;
display: block;
text-align: center;
line-height: 50px;
height: 50px;
text-transform: uppercase;
text-decoration: none;
font-size: 14px;
width: 120px;
background-color: white;
color: blue;
}
.button.button-big {
font-size: 20px !important;
width: 200px !important;
}
.button.button-green {
background-color: green !important;
color: white !important;
}
是否有任何工具或任务(grunt/gulp)可以将 OOCSS 转换为 oldschool 样式(长版)?
预期结果:
.button {
position: absolute;
display: block;
text-align: center;
line-height: 50px;
height: 50px;
text-transform: uppercase;
text-decoration: none;
font-size: 14px;
width: 120px;
background-color: white;
color: blue;
}
.button-big {
position: absolute;
display: block;
text-align: center;
line-height: 50px;
height: 50px;
text-transform: uppercase;
text-decoration: none;
font-size: 14px;
width: 120px;
background-color: white;
color: blue;
font-size: 20px !important;
width: 200px !important;
}
.button-green {
position: absolute;
display: block;
text-align: center;
line-height: 50px;
height: 50px;
text-transform: uppercase;
text-decoration: none;
font-size: 14px;
width: 120px;
background-color: white;
color: blue;
background-color: green !important;
color: white !important;
}
当然,我将不得不清理课程,但该工具将为我节省大量时间。
原因: 我的客户在 CSS 方面不高级。所以,OOCSS 对他来说可能有点困惑。
感谢您的回复亚当