2015-08-29 44 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。

祝你好運!保持好狀況!