[Pro] using External Stylesheets

This is probably a bit of a nube question… but I have been using Freeway for some years now and never really understood the benefit of using external stylesheets. Can anyone tell me what the benefits and pitfalls are with using them and if you have any nuggets of wisdom regarding them. Is it purely for using them on other jobs… or does the site work better with external css styles etc etc?

Many thanks for your help

Jon


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Anyone?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Using external stylesheets reduces the amount of HTML in your individual pages, shunting it off to a single site-wide resource which can be downloaded once and cached by the browser. There’s a slight speed advantage to be had there.

There is another advantage, in that a screen reader doesn’t need to wade through as much non-content code before getting to the “good stuff”.

That said, Freeway doesn’t do a complete job of “externalizing” the CSS from your page layout. Just about the only things that get sent out to the external sheet are text styles. All positioning code (the stuff that makes the individual elements on the page whatever color, position, and dimensions they’re going to be) is all coded inline, directly in the page code. This means that there’s still a lot of “internal” code that could move to an external stylesheet, and any HTML purists will cluck their tongues disapprovingly at all that “chocolate in your peanut butter”. But I’m hopeful that the next version of Freeway will take another giant step in the direction of “buzzword-compliance”.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Cheers Walter,

As ever… a brilliant explanation of things. Is there anyway (foolproof hopefully) of externalizing the CSS text styles so that the code works way more efficiently? Does it boil down to getting mucky with CSSEdit (of which I have no experience of yet) or do you have any tricks up your tremendously long sleeves for sorting this!?

Jon


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

There’s no “Freeway-way” to do this, short of using Freeway to generate the layout, then using another tool (probably a text editor) to hack up the code that Freeway writes and move parts of it elsewhere. It’s not for the faint of heart, and it’s terribly fragile. Plus, once you do it, you either never go back to Freeway, or you do it all over again after you make any changes in Freeway.

Look up “sisyphean” in the dictionary and you’ll see a picture of this workflow next to it.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I wish this was available now… or soon. My client wants it all
externalised as soon as possible which means I’m probably going to
have to work with someone who knows CSS (as I haven’t even scratched
the surface) and which also means I may not be able to use FW.

Nathan Garner
email@hidden

FW5 Pro | MacBook Pro | Leopard

On 7 Jul 2009, at 21:34, waltd wrote:

Using external stylesheets reduces the amount of HTML in your
individual pages, shunting it off to a single site-wide resource
which can be downloaded once and cached by the browser. There’s a
slight speed advantage to be had there.

There is another advantage, in that a screen reader doesn’t need to
wade through as much non-content code before getting to the “good
stuff”.

That said, Freeway doesn’t do a complete job of “externalizing” the
CSS from your page layout. Just about the only things that get sent
out to the external sheet are text styles. All positioning code (the
stuff that makes the individual elements on the page whatever color,
position, and dimensions they’re going to be) is all coded inline,
directly in the page code. This means that there’s still a lot of
“internal” code that could move to an external stylesheet, and any
HTML purists will cluck their tongues disapprovingly at all that
“chocolate in your peanut butter”. But I’m hopeful that the next
version of Freeway will take another giant step in the direction of
“buzzword-compliance”.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Paul Dunning wrote some actions a while back that might help here. They’re very much experimental, but you might want to contact him and see where they stand. The largest hump to get over is that Freeway creates same-name elements on different pages. (Naturally it never names anything the same twice within a page, but within a site it certainly does.) So if you were to scoop up all the style information from within a page and deposit it in a single external stylesheet, you would have a strong likelihood that one or more elements would be incorrectly styled on one or more pages, simply because their names were the same. Whichever style was “last” in the source order of the stylesheet would “win”, in other words.

I believe Paul’s Action used a counter or some other mechanism to make sure that each page had unique element names site-wide. But that kind of destroys the benefit of a site-wide CSS sheet. All you are really doing is moving the file-size problem somewhere else. The real grail would be to have elements that have the same style properties all share a single style rule. That cuts down on duplication and waste. But that’s just amazingly hard to do inside an Action, given what an Action can “know” about a particular object while Freeway is in the process of publishing it.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options