styles in embedded components (2.9)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

styles in embedded components (2.9)

laza
Hi!

I have a component that has css definitions in a style method. Now I
embed this component in another component. Should I expect that the
style definitions of the embedded component will also show up in the
resulting page?
So now this works when used as a root component not as an embedded one.

Alex

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: styles in embedded components (2.9)

Ramon Leon-5
>
> I have a component that has css definitions in a style method. Now I
> embed this component in another component. Should I expect that the
> style definitions of the embedded component will also show up in the
> resulting page?

Yes, all #style methods create a css include.

> So now this works when used as a root component not as an
> embedded one.
>
> Alex

CSS is one big flat namespace, all styles are global.  If you don't want a
subcomponents style affecting it's parent component, you need to build your
CSS with that in mind.

Say you have a comment form, you can wrap its render in a div with class
commentForm then write your css scoped to that like this...

.commentForm p {...}

To only have that style apply to paragraph tags inside the comment form and
not affect the parent components tags.

Ramon Leon
http://onsmalltalk.com

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: styles in embedded components (2.9)

laza
Ramon Leon schrieb:
> Yes, all #style methods create a css include.

The problem is, if I use firebug to look at the page header I see the following when my component is a root component:

[...]
<link href="/seaside/files/WADevelopmentFiles/tools.css" type="text/css" rel="stylesheet"></link>
<link href="/seaside/comments?_s=FhfuMIZ92s3hunGX" type="text/css" rel="stylesheet"></link>
1.commentlist p { font-weight: normal; line-height: 1.5em; text-transform: none; }

Last css is the content of the style method.
When I use this as a embedded component I get only

[...]
<link href="/seaside/files/WADevelopmentFiles/halo.css" type="text/css" rel="stylesheet"></link>
<link href="/seaside/files/WADevelopmentFiles/tools.css" type="text/css" rel="stylesheet"></link>

So should the css reference of the embedded component show up here or is this a bug?

Alex


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: styles in embedded components (2.9)

Avi Bryant-2
This sounds like your embedded component is returned from #children in
the parent - is that possible?

Avi

On Tue, Dec 23, 2008 at 3:06 PM, Alexander Lazarević <[hidden email]> wrote:

> Ramon Leon schrieb:
>>
>> Yes, all #style methods create a css include.
>
> The problem is, if I use firebug to look at the page header I see the
> following when my component is a root component:
>
> [...]
> <link href="/seaside/files/WADevelopmentFiles/tools.css" type="text/css"
> rel="stylesheet"></link>
> <link href="/seaside/comments?_s=FhfuMIZ92s3hunGX" type="text/css"
> rel="stylesheet"></link>
> 1.commentlist p { font-weight: normal; line-height: 1.5em; text-transform:
> none; }
>
> Last css is the content of the style method.
> When I use this as a embedded component I get only
>
> [...]
> <link href="/seaside/files/WADevelopmentFiles/halo.css" type="text/css"
> rel="stylesheet"></link>
> <link href="/seaside/files/WADevelopmentFiles/tools.css" type="text/css"
> rel="stylesheet"></link>
>
> So should the css reference of the embedded component show up here or is
> this a bug?
>
> Alex
>
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: styles in embedded components (2.9)

Avi Bryant-2
Sorry, *isn't* returned from #children.

2008/12/23 Avi Bryant <[hidden email]>:

> This sounds like your embedded component is returned from #children in
> the parent - is that possible?
>
> Avi
>
> On Tue, Dec 23, 2008 at 3:06 PM, Alexander Lazarević <[hidden email]> wrote:
>> Ramon Leon schrieb:
>>>
>>> Yes, all #style methods create a css include.
>>
>> The problem is, if I use firebug to look at the page header I see the
>> following when my component is a root component:
>>
>> [...]
>> <link href="/seaside/files/WADevelopmentFiles/tools.css" type="text/css"
>> rel="stylesheet"></link>
>> <link href="/seaside/comments?_s=FhfuMIZ92s3hunGX" type="text/css"
>> rel="stylesheet"></link>
>> 1.commentlist p { font-weight: normal; line-height: 1.5em; text-transform:
>> none; }
>>
>> Last css is the content of the style method.
>> When I use this as a embedded component I get only
>>
>> [...]
>> <link href="/seaside/files/WADevelopmentFiles/halo.css" type="text/css"
>> rel="stylesheet"></link>
>> <link href="/seaside/files/WADevelopmentFiles/tools.css" type="text/css"
>> rel="stylesheet"></link>
>>
>> So should the css reference of the embedded component show up here or is
>> this a bug?
>>
>> Alex
>>
>>
>> _______________________________________________
>> seaside mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
>

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: styles in embedded components (2.9)

Ramon Leon-5
In reply to this post by laza
> Ramon Leon schrieb:
> > Yes, all #style methods create a css include.
>
> The problem is, if I use firebug to look at the page header I
> see the following when my component is a root component:
>
> [...]
> <link href="/seaside/files/WADevelopmentFiles/tools.css"
> type="text/css" rel="stylesheet"></link>
> <link href="/seaside/comments?_s=FhfuMIZ92s3hunGX"
> type="text/css" rel="stylesheet"></link>
> 1.commentlist p { font-weight: normal; line-height: 1.5em;
> text-transform: none; }
>
> Last css is the content of the style method.
> When I use this as a embedded component I get only
>
> [...]
> <link href="/seaside/files/WADevelopmentFiles/halo.css"
> type="text/css" rel="stylesheet"></link>
> <link href="/seaside/files/WADevelopmentFiles/tools.css"
> type="text/css" rel="stylesheet"></link>
>
> So should the css reference of the embedded component show up
> here or is this a bug?
>
> Alex

Are you property returning your embeded component from #children, because it
should show up?

Ramon Leon
http://onsmalltalk.com

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: styles in embedded components (2.9)

laza
In reply to this post by Avi Bryant-2
Ah yes! :)

I had initialized the children iVar, but the accessor was missing!
Thanks for the hint to the both of you.

Alex

Avi Bryant schrieb:

> Sorry, *isn't* returned from #children.
>
> 2008/12/23 Avi Bryant <[hidden email]>:
>> This sounds like your embedded component is returned from #children in
>> the parent - is that possible?
>>
>> Avi
>>
>> On Tue, Dec 23, 2008 at 3:06 PM, Alexander Lazarević <[hidden email]> wrote:
>>> Ramon Leon schrieb:
>>>> Yes, all #style methods create a css include.
>>> The problem is, if I use firebug to look at the page header I see the
>>> following when my component is a root component:
>>>
>>> [...]
>>> <link href="/seaside/files/WADevelopmentFiles/tools.css" type="text/css"
>>> rel="stylesheet"></link>
>>> <link href="/seaside/comments?_s=FhfuMIZ92s3hunGX" type="text/css"
>>> rel="stylesheet"></link>
>>> 1.commentlist p { font-weight: normal; line-height: 1.5em; text-transform:
>>> none; }
>>>
>>> Last css is the content of the style method.
>>> When I use this as a embedded component I get only
>>>
>>> [...]
>>> <link href="/seaside/files/WADevelopmentFiles/halo.css" type="text/css"
>>> rel="stylesheet"></link>
>>> <link href="/seaside/files/WADevelopmentFiles/tools.css" type="text/css"
>>> rel="stylesheet"></link>
>>>
>>> So should the css reference of the embedded component show up here or is
>>> this a bug?
>>>
>>> Alex
>>>
>>>
>>> _______________________________________________
>>> seaside mailing list
>>> [hidden email]
>>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> seaside mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside