Css questions

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

Css questions

Mariano Martinez Peck
Hi folks!

There are thing I don't understand with Css, seaside and pier. I created a MyLibrary that subclass WAFileLIbrary, I created the method myCss and selectorsToInclude that included myCss. I could successfully put styles in my pier application that were in MyLibrary. I also added my css images to that library. The questions are:

1)  When I go to "edit design" command in Pier, all that Css I see, where it comes from ? I didn't see any Pier library that has those css.

2) When I edit design from Pier, where is it stored ?

3) When I add different libraries to a Application, how Css are inherit ? If I have defined different thing for a same class in different libraries for example, what happens ?

4) I really don't know when to add css to my library and when to add it to "edit design" command.

5) I tried to put some css in mylibrary, like .a:hoover .a: link .component   but they are ignored. I guess it is using the css I see in "edit design". How can I do to override that css ?

Ok, that's all for now.

Thanks for the help.

Mariano




_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Css questions

Gerhard Obermann
ad 5) use !important

A rule that has the !important property will always be applied no matter where that rule appears in the CSS document.

Cheers
Gerhard


On Fri, Mar 27, 2009 at 2:54 PM, Mariano Martinez Peck <[hidden email]> wrote:
Hi folks!

There are thing I don't understand with Css, seaside and pier. I created a MyLibrary that subclass WAFileLIbrary, I created the method myCss and selectorsToInclude that included myCss. I could successfully put styles in my pier application that were in MyLibrary. I also added my css images to that library. The questions are:

1)  When I go to "edit design" command in Pier, all that Css I see, where it comes from ? I didn't see any Pier library that has those css.

2) When I edit design from Pier, where is it stored ?

3) When I add different libraries to a Application, how Css are inherit ? If I have defined different thing for a same class in different libraries for example, what happens ?

4) I really don't know when to add css to my library and when to add it to "edit design" command.

5) I tried to put some css in mylibrary, like .a:hoover .a: link .component   but they are ignored. I guess it is using the css I see in "edit design". How can I do to override that css ?

Ok, that's all for now.

Thanks for the help.

Mariano




_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki



_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Css questions

Lukas Renggli
In reply to this post by Mariano Martinez Peck
> 1)  When I go to "edit design" command in Pier, all that Css I see, where it
> comes from ? I didn't see any Pier library that has those css.

The way you add styles is the Seaside way of doing it. That's fine and
works well with Pier. However, the styles in 'Edit Design' are part of
Pier itself, so these are editable from within Pier.

> 2) When I edit design from Pier, where is it stored ?

There are links above the textareas in 'Edit Design' that show the
location of these files.

> 3) When I add different libraries to a Application, how Css are inherit ? If
> I have defined different thing for a same class in different libraries for
> example, what happens ?

It depends on the CSS selectors you use and on the order you define them:

1. CSS selectors have different weights
(http://www.w3.org/TR/CSS21/cascade.html). The more specific a
selector is, the higher its weight. With "!important" you can make a
definition override anything else, but I would only use this as a last
resort.

2. If the weight of several selectors is the same, it depends on the
order. Seaside libraries always come first, then the custom styles
from components and from Pier in the order they render.

> 4) I really don't know when to add css to my library and when to add it to
> "edit design" command.

Whatever is more convenient for you.

> 5) I tried to put some css in mylibrary, like .a:hoover .a: link
> .component   but they are ignored. I guess it is using the css I see in
> "edit design". How can I do to override that css ?

Remove the style in "Edit Design" if you use your own CSS in a WAFileLibrary.

Or don't use the WAFileLibrary and replace the style in "Edit Desing"
with your own.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Css questions

Mariano Martinez Peck


On Fri, Mar 27, 2009 at 12:33 PM, Lukas Renggli <[hidden email]> wrote:
> 1)  When I go to "edit design" command in Pier, all that Css I see, where it
> comes from ? I didn't see any Pier library that has those css.

The way you add styles is the Seaside way of doing it. That's fine and
works well with Pier. However, the styles in 'Edit Design' are part of
Pier itself, so these are editable from within Pier.

Ahh okok. This would be method one from here: http://onsmalltalk.com/pragmatic-css-and-javascript-in-seaside. Am I correct ?

 

> 3) When I add different libraries to a Application, how Css are inherit ? If
> I have defined different thing for a same class in different libraries for
> example, what happens ?

It depends on the CSS selectors you use and on the order you define them:

1. CSS selectors have different weights
(http://www.w3.org/TR/CSS21/cascade.html). The more specific a
selector is, the higher its weight. With "!important" you can make a
definition override anything else, but I would only use this as a last
resort.

2. If the weight of several selectors is the same, it depends on the
order. Seaside libraries always come first, then the custom styles
from components and from Pier in the order they render.

thanks for this :) 


> 5) I tried to put some css in mylibrary, like .a:hoover .a: link
> .component   but they are ignored. I guess it is using the css I see in
> "edit design". How can I do to override that css ?

Remove the style in "Edit Design" if you use your own CSS in a WAFileLibrary.

Or don't use the WAFileLibrary and replace the style in "Edit Desing"
with your own.


Ok. This is my main problem. I am mixin two strategies.

Thanks for the help. I will put all in my library :)


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Css questions

Lukas Renggli
>> > 1)  When I go to "edit design" command in Pier, all that Css I see,
>> > where it
>> > comes from ? I didn't see any Pier library that has those css.
>>
>> The way you add styles is the Seaside way of doing it. That's fine and
>> works well with Pier. However, the styles in 'Edit Design' are part of
>> Pier itself, so these are editable from within Pier.
>
> Ahh okok. This would be method one from here:
> http://onsmalltalk.com/pragmatic-css-and-javascript-in-seaside. Am I correct
> ?

Yeah, according to this blog article you are doing "Method Two: File
Libraries". Pier "Edit Design" uses "Method Three: File Includes",
however it does all in the background.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki