Hi Ed,
> // The part I don't understand:...
> .panel .content {
> padding: 10px;
> }
This part is not special to GWT. This is pure CSS. This technique is
called "selector".
http://www.w3.org/TR/CSS2/selector.html
It means that a tag with with a class named "content" gets a padding
of 10px when it lay within a tag with a class named "panel".
".panel .content" is NOT a third class, it is just a nestling of two
classes
This example makes more sense if you define a padding for content
only, too.
.content {
padding: 20px;
}
Then it mean, normally content gets 20px padding, but when it lays
within a panel (class) it gets 10px
Does this make sense to you?
Stefan Bachert
http://gwtworld.de
On 24 Apr., 07:01, Ed Bras <[email protected]> wrote:
> Hi Stefan,
>
> Thanks for your reaction.
> Let me tell you a bit more.
> I am starting to use styles through CssResource in my code now.
> I know how to use a single style, but have no idea how to use a prefixed
> style.
> Example:
> Suppose I have the following stylesheet:
> I am trying to use a style like:
>
> .panel {
> width: 10px;
> }
>
> .content {
> font-size: 10;
> }
>
> // The part I don't understand:...
> .panel .content {
> padding: 10px;
> }
>
> And my CssResource interface:
> interface MyCssResource extends CssResource {
> public MyCssResource INSTANCE = GWT.create(MyCssResource.class);
>
> @ClassName("panel")
> String panel();
>
> @ClassName("content")
> String content();
>
> }
>
> So in my code I do something like this:
> ...
> SimplePanel panel = new SimplePanel();
> panel.setStyleName(MyCssResource.INSTANCE.panel());
>
> Label content = new Label("someText");
> content.setStyleName(MyCssResource.INSTANCE.content);
>
> So how is this prefixed style ".panel .content" used and obfuscated ?...
> Should I use the @import annoation for this ? .. and how ? :(... A bit
> confusing
>
> In the doc they use several sheets. Maybe I should use that?.. But how do I
> link these to the client bundle :(...
>
> Ed
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group
> athttp://groups.google.com/group/google-web-toolkit?hl=en.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.