Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » CSS Questions(How to organize CSS classes in .css file?)
CSS Questions [message #898605] Thu, 26 July 2012 16:55 Go to next message
Ronald So is currently offline Ronald So
Messages: 198
Registered: April 2011
Senior Member
Hello,

Just a couple quick questions on CSS settings for RAP.

Label.labelError {
    font: normal normal 12px Trebucket, Arial, sans-serif;
    color: red;
}
Label.labelInfo {
    font: normal normal 12px Trebucket, Arial, sans-serif;
    color: blue;
}
Label.labelBold {
    font: normal bold 12px Trebucket, Arial, sans-serif;
}


I have the above in the CSS code that may not be ideal. I can use all three classes by
Label.setData(WidgetUtil.CUSTOM_VARIANT, "labelBold");


1. How can I change all Label to size 12px without defining it in every Label CSS style?
2. What is the recommended way to manage this CSS file? I can only imagine that this file will grow big with all these variances of styles. Is there a strategy that you can recommend to better manage these CSS settings?

Thanks so much for your help.

Ronald


Re: CSS Questions [message #898783 is a reply to message #898605] Fri, 27 July 2012 10:21 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1797
Registered: July 2009
Senior Member
Hi Roland,
see my answers bellow

On 7/26/2012 11:55 PM, Ronald So wrote:
> Hello,
>
> Just a couple quick questions on CSS settings for RAP.
>
>
> Label.labelError {
> font: normal normal 12px Trebucket, Arial, sans-serif;
> color: red;
> }
> Label.labelInfo {
> font: normal normal 12px Trebucket, Arial, sans-serif;
> color: blue;
> }
> Label.labelBold {
> font: normal bold 12px Trebucket, Arial, sans-serif;
> }
>
>
> I have the above in the CSS code that may not be ideal. I can use all
> three classes by Label.setData(WidgetUtil.CUSTOM_VARIANT, "labelBold");
>
> 1. How can I change all Label to size 12px without defining it in
> every Label CSS style?
Just set it in the Label selector:
Label {
font: normal normal 12px Trebucket, Arial, sans-serif;
}
> 2. What is the recommended way to manage this CSS file? I can only
> imagine that this file will grow big with all these variances of
> styles. Is there a strategy that you can recommend to better manage
> these CSS settings?
Probably this is not a complete theme overwrite (complete theme) and you
only contribute some small changes/variants. Keep your changes in a
single CSS file and contribute them (themeContribution) to an existing
(default, business or fancy) theme.
>
> Thanks so much for your help.
>
> Ronald
>
>
>
Best,

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: CSS Questions [message #899453 is a reply to message #898783] Tue, 31 July 2012 17:52 Go to previous message
Ronald So is currently offline Ronald So
Messages: 198
Registered: April 2011
Senior Member
Thanks Ivan it works fine.

Ronald
Previous Topic:create a RAP Launch based on feature
Next Topic:CSS Setting for ToolItem
Goto Forum:
  


Current Time: Tue Sep 02 08:04:54 EDT 2014

Powered by FUDForum. Page generated in 0.01589 seconds