Re: [Zope-dev] ZPT for CSS, anyone?

2004-03-30 Thread Fred Drake
On Tuesday 30 March 2004 01:40 pm, Dieter Maurer wrote:
 > Furthermore, stylesheets often contain customization "variables",
 > e.g. for a color scheme. I think, this is useful.

This is one of the most painful warts in CSS that would have been really easy 
to do right, I think.  Being able to name colors for parts of pages and then 
reuse those names would make a lot of this sort of problem go away for style 
sheets where the colors are the only difference.

CSS 3 might include this, but I've not tracked it closely.


  -Fred

-- 
Fred L. Drake, Jr.  
PythonLabs at Zope Corporation


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZPT for CSS, anyone?

2004-03-30 Thread Dieter Maurer
Jamie Heilman wrote at 2004-3-30 02:13 -0800:
> ...
>Stylesheets should always be static documents, a dynamic stylesheet
>defeats browser caching and destroys the advantages over just inlining
>all the presentation markup.

We just converted some stylesheets from static to dynamic.
Some parts of the stylesheet need to be different dependent
on the virtual host it is used for.

Furthermore, stylesheets often contain customization "variables",
e.g. for a color scheme. I think, this is useful.

-- 
Dieter

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZPT for CSS, anyone?

2004-03-30 Thread Jamie Heilman
Dylan Jay wrote:
> Actually my use case isn't really for dynamic stylesheets but for
> absolute urls. I want to be able to edit say a filesystem site using
> dreamweaver and have relative urls like background-image:
> url(back.jpg) work, and then when this is used in a zope site such
> as a plone site then have it use something like background-image:
> url(http://site.com/back.jpg) to save on repeated requests.

If the zope hierarchy matches your filesystem hierarchy, you shouldn't
need to use absolute URIs.

> The other possible use case might what plone does with dtml in it's
> skins which is to define a color/font once and use it in many
> places. I'm not that fussed about that one, but neither of them are
> really dynamic.

I don't use plone, so I couldn't speak to this.

> What if there was a CSSFile that when loaded changes all urls to
> absolute urls? That might be too specific but at least it does open
> the dynamisim flood gates.

Thats doing the work in the wrong place.  If you have a one-time
translation job, which is basically what you're asking for, then
you should do it once before the object is placed into the zodb.

-- 
Jamie Heilman http://audible.transient.net/~jamie/
"Paranoia is a disease unto itself, and may I add, the person standing
 next to you may not be who they appear to be, so take precaution."
-Sathington Willoughby

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZPT for CSS, anyone?

2004-03-30 Thread Dylan Jay
- Original Message - 
From: "Jamie Heilman" <[EMAIL PROTECTED]>
To: "Chris Withers" <[EMAIL PROTECTED]>
Cc: "Dylan Jay" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, March 30, 2004 8:13 PM
Subject: Re: [Zope-dev] ZPT for CSS, anyone?


> Chris Withers wrote:
> > Dylan Jay wrote:
> > >disadvantage that the css is no longer valid once templated. ZPT of
course
> > >would be the solution if CSS was XML, but alas :(
> >
> > I think ZPT is just fine for generating CSS. It coudl do with a plan
text
> > mode, like it has an HTML and XML mode, but apart fro mthat, it rocks
:-)
>
> Stylesheets should always be static documents, a dynamic stylesheet
> defeats browser caching and destroys the advantages over just inlining
> all the presentation markup.  If you want to have dynamic style, you
> should use dynamic cascading & inclusion instructions, but the
> stylesheets themselves should remain static.  As such, generating
> style in ZPT is a complete waste of time and effort.  The File object
> is a much better fit.

Actually my use case isn't really for dynamic stylesheets but for absolute
urls. I want to be able to edit say a filesystem site using dreamweaver and
have relative urls like background-image: url(back.jpg) work, and then when
this is used in a zope site such as a plone site then have it use something
like background-image: url(http://site.com/back.jpg) to save on repeated
requests.
The other possible use case might what plone does with dtml in it's skins
which is to define a color/font once and use it in many places. I'm not that
fussed about that one, but neither of them are really dynamic.
What if there was a CSSFile that when loaded changes all urls to absolute
urls? That might be too specific but at least it does open the dynamisim
flood gates.



Dylan Jay
---
http://www.meetmemap.com - makes giving directions easy
http://www.pretaweb.com - Update-it-yourself, low cost websites
http://www.eatmanifesto.com - against all dumbing  down of food
http://www.idartatravelimages.com/mySearchResults.aspx?query=Virginia%20Choy&cid=0


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZPT for CSS, anyone?

2004-03-30 Thread Jamie Heilman
Chris Withers wrote:
> Dylan Jay wrote:
> >disadvantage that the css is no longer valid once templated. ZPT of course
> >would be the solution if CSS was XML, but alas :( 
> 
> I think ZPT is just fine for generating CSS. It coudl do with a plan text 
> mode, like it has an HTML and XML mode, but apart fro mthat, it rocks :-)

Stylesheets should always be static documents, a dynamic stylesheet
defeats browser caching and destroys the advantages over just inlining
all the presentation markup.  If you want to have dynamic style, you
should use dynamic cascading & inclusion instructions, but the
stylesheets themselves should remain static.  As such, generating
style in ZPT is a complete waste of time and effort.  The File object
is a much better fit.

-- 
Jamie Heilman http://audible.transient.net/~jamie/
"You came all this way, without saying squat, and now you're trying
 to tell me a '56 Chevy can beat a '47 Buick in a dead quarter mile?
 I liked you better when you weren't saying squat kid." -Buddy

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZPT for CSS, anyone?

2004-03-30 Thread Chris Withers
(keep on list ;-)

Dylan Jay wrote:

so how do you get a CSS file with ZPT code in that is a valid CSS file and
works on the filesystem?
Urm? If you mean prior to rendering the ZPT, the nthat wasn't a usecase you 
specified ;-)

If you mean post-rendering, use a PageTemplateFile and whatever you want inside it.

What problems did you encounter?

Chris

--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZPT for CSS, anyone?

2004-03-29 Thread Chris Withers
Dylan Jay wrote:
disadvantage that the css is no longer valid once templated. ZPT of course
would be the solution if CSS was XML, but alas :( 
I think ZPT is just fine for generating CSS. It coudl do with a plan text mode, 
like it has an HTML and XML mode, but apart fro mthat, it rocks :-)

cheers,

Chris

--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZPT for CSS, anyone?

2004-03-27 Thread Jamie Heilman
Dylan Jay wrote:
> Has anyone had a go at building a new templating language for CSS files?

No, because it isn't needed.  99.9% of the time a style sheet is
static.

> My current need for this is being able to put set correct absolute urls for
> background images in a css file such that I can still use dreamweaver to do
> visual editing.

How do you do this with a normal ?  Describe the process.  Then
we'll tell you how to use that very same process with a style sheet.

> Speaking of which, absolute urls are a real pain. There must be a better way
> of being able to edit files on a file system and have the server use
> absolute urls without having to write expressions for every single
> reference? Isn't there some equivilent to the html base tag to specify what
> "/" means?

Why are you bent on using absolute URLs for images in the first place?

-- 
Jamie Heilman http://audible.transient.net/~jamie/
"You came all this way, without saying squat, and now you're trying
 to tell me a '56 Chevy can beat a '47 Buick in a dead quarter mile?
 I liked you better when you weren't saying squat kid." -Buddy

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )