2015-08-29 41 views
0

目前我正在开发一些应用程序的GUI,这是在QT(多平台框架)中开发的。 QT中的GUI可以作为普通的CSS来设计。OOCSS to Long CSS生成器

所以,我开发GUI作为一个基本的web应用程序(HTML5,CSS3和JS),我使用较少的预处理的造型和创造一些原因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; 
} 

是否有转换到OOCSS造型旧校园(加长版)任何工具或任务(咕噜/一饮而尽)?

预期的结果:

.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可能对他一点困惑。

感谢您的答复 亚当

+0

你为什么要这样做? –

+0

Couse对于我的客户来说,开发该应用程序会更容易。我只准备CSS类... –

+0

我不明白。你的意思是说你的客户**更容易维持**吗?最初因素的类更容易维护。 –

回答

0

首先,我认为这是伟大的,你正试图使这个尽可能容易为你的客户。那很棒!

其次,我认为这是一个很好的机会让你的客户学习CSS的基础知识。是的,长版本并不使用OOCSS,但现在需要管理更多的声明,从长远来看,这些声明可能难以管理。

再次打结,你的客户有你帮忙解释的事情。这对于强大的客户关系和良好的业务来说是一个很好的机会。

如果您的客户也可以学习LESS,那将是非常好的,但如果他们不能,您总是可以使用Pleeease。它完成了我们所喜爱的预处理器的所有功能,但使用了香草css。

祝你好运!保持好状况!