Re: [css-d] Request for Comments on this CSS Stylesheet Approach
Hello, This method is not something I would recommend. The possible problems I see: * no full use of caching. A css file needs to be loaded by a browser only once, then it is stored in cache. By adding a separate stylesheet for each page you will lose that speed gain. * what with elements that appear on more than one page, but not on enough pages to put them into the main.css. Do you plan on updating all css files when the style of this element changes? * The fact that you have two css files to check won't make it any easier either. * What about new templates. People will need to create new stylesheets for those, even when no new elements are introduced. When using a tool like Firebug to find css rules, the problem of a big css is limited. Also, using a good editor will fix most of the issues. And of course, there's always the trusty ctrl+F In the long run, I would advise against this method :) Greets, Niels Matthijs -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rick Faircloth Sent: maandag 18 februari 2008 17:09 To: 'CSS Discussion' Subject: [css-d] Request for Comments on this CSS Stylesheet Approach Hi, all. I'd like to know your thoughts on including separate stylesheets for individual pages. I've realized at the start of a pretty large site, including Internet and Intranet sections, that my stylesheet could grow very large and even finding sections of styles for particular pages could be a cumbersome task. What I'm considering is having one main stylesheet, then having supplemental stylesheet for the various pages I will create. E.g., for a particular page, I would have main.css, plus index.css. For announcements, I would have main.css, plus announcements.css. I would be avoiding loading a lot of irrelevant styles for a particular page and make finding style references much easier, too. It seems like the best way to go, but I want to make sure I'm not creating a problem with the technique with which I'm unaware. I can easily specify which particular page's stylesheet is called by using coldfusion and the cgi.script_name variable. Thoughts? Thanks, Rick __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/ No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.20.7/1285 - Release Date: 18/02/2008 5:50 No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.20.7/1285 - Release Date: 18/02/2008 5:50 __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] Request for Comments on this CSS Stylesheet Approach
Rafael wrote: Chris Broadfoot wrote: Rafael wrote: Having separate style sheets usually helps to keep everything organized (depending on how you build them), but it also gives you more connections to the server. So what you can do is to make use of that server-side language you have, just make sure to send the appropriate HTTP headers. I.e: In the (x)HTML page: link rel=stylesheet type=text/css href=css.dynamic.xxx/common/web / In css.dynamic.xxx, something like - split path-info by '/' - check by matching against the available files - send headers and embed all the files into one I personally don't like this idea. You have no benefit from caching and might as well include all those styles in an inline style tag. I don't understand you, You have no benefit from caching? As far as I know, caching is better than having the browser download the same content over and over again. If you meant that such benefit is not present here, you're wrong, it is, that's what the Last-Modified header is for ---It still opens a connection though, since it has to check what's the last modification date. and might as well include all those styles in an inline style tag. Well, yes. Having a server-side script to build the CSS file will allow you to use that content in any way you want, including putting it in a style tag (I'll assume inline is a typo). Now, why would you want that...? If we're talking about a potentially large file, I doubt you'll ever want to add that to every file you send to your users, would you?. I think styles for each page is inherently bad, your styles across the site should be consistent, therefore you shouldn't /need/ a large amount of specific styles for pages. We don't know what are the specifics of this case, so we can't decide that (IMO). Also, having a consistent style across the site doesn't necessarily mean having a small file. I hope you can see my point: I can't see yours. Regards, Chris Rafael. __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
[css-d] Request for Comments on this CSS Stylesheet Approach
Hi, all. I'd like to know your thoughts on including separate stylesheets for individual pages. I've realized at the start of a pretty large site, including Internet and Intranet sections, that my stylesheet could grow very large and even finding sections of styles for particular pages could be a cumbersome task. What I'm considering is having one main stylesheet, then having supplemental stylesheet for the various pages I will create. E.g., for a particular page, I would have main.css, plus index.css. For announcements, I would have main.css, plus announcements.css. I would be avoiding loading a lot of irrelevant styles for a particular page and make finding style references much easier, too. It seems like the best way to go, but I want to make sure I'm not creating a problem with the technique with which I'm unaware. I can easily specify which particular page's stylesheet is called by using coldfusion and the cgi.script_name variable. Thoughts? Thanks, Rick __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] Request for Comments on this CSS Stylesheet Approach
I'd like to know your thoughts on including separate stylesheets for individual pages. Personally I do prefer what you are suggesting Rick. I have a few large sites that have subdomains, where the subdomains have individual differences from the main site's styles, but that must maintain some level of consistency. Rather than create a whole cluster of classes and ID's specific to the subdomain I simply use a supplemental style-sheet for subdomain-specific modifications. This keeps the main style sheet clean and uncluttered, and also allows the owners of the subdomains to utilize the same tagging scheme (classes, ids, etc.) as the site as a whole. ...Rob __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] Request for Comments on this CSS Stylesheet Approach
On 18/02/2008 16:09, Rick Faircloth wrote: I've realized at the start of a pretty large site, including Internet and Intranet sections, that my stylesheet could grow very large and even finding sections of styles for particular pages could be a cumbersome task. What I'm considering is having one main stylesheet, then having supplemental stylesheet for the various pages I will create. E.g., for a particular page, I would have main.css, plus index.css. For announcements, I would have main.css, plus announcements.css. I would be avoiding loading a lot of irrelevant styles for a particular page and make finding style references much easier, too. You could take the modular approach. Instead of creating stylesheets for individual pages, you could, for example have * common.css * web.css * intranet.css Having individual style files for individual pages seems worse than embedding styles in the head of a document. It seems to me you've got all the disadvantages plus extra calls to the server. -- http://antanova.blogspot.com __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] Request for Comments on this CSS Stylesheet Approach
I'd set an ID in the body tag for each individual page and divide up your CSS based on that. body id=index, body id=common, etc. Then you've got #index ... { } #common ... { } I do a lot of work with a product called Farcry which is a content management system and this is how I change styles on a per-page basis. _ Jake Churchill Team Leader 11204 Davenport, Ste. 100 Omaha, NE 68154 http://www.cfwebtools.com 402-408-3733 x103 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jason Crosse Sent: Monday, February 18, 2008 10:27 AM To: 'CSS Discussion' Subject: Re: [css-d] Request for Comments on this CSS Stylesheet Approach On 18/02/2008 16:09, Rick Faircloth wrote: I've realized at the start of a pretty large site, including Internet and Intranet sections, that my stylesheet could grow very large and even finding sections of styles for particular pages could be a cumbersome task. What I'm considering is having one main stylesheet, then having supplemental stylesheet for the various pages I will create. E.g., for a particular page, I would have main.css, plus index.css. For announcements, I would have main.css, plus announcements.css. I would be avoiding loading a lot of irrelevant styles for a particular page and make finding style references much easier, too. You could take the modular approach. Instead of creating stylesheets for individual pages, you could, for example have * common.css * web.css * intranet.css Having individual style files for individual pages seems worse than embedding styles in the head of a document. It seems to me you've got all the disadvantages plus extra calls to the server. -- http://antanova.blogspot.com __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/ No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.20.7/1284 - Release Date: 2/17/2008 2:39 PM No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.20.7/1284 - Release Date: 2/17/2008 2:39 PM __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] Request for Comments on this CSS Stylesheet Approach
On Mon, 18 Feb 2008 10:36:11 -0600 Jake Churchill wrote: I'd set an ID in the body tag for each individual page and divide up your CSS based on that. body id=index, body id=common, etc. Then you've got #index ... { } #common ... { } I do a lot of work with a product called Farcry which is a content management system and this is how I change styles on a per-page basis. This just feels like a cludge necessary only because of the restrictions of your CMS. -- Michael All shall be well, and all shall be well, and all manner of things shall be well - Julian of Norwich 1342 - 1416 __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] Request for Comments on this CSS Stylesheet Approach
Rick Faircloth wrote: Hi, all. I'd like to know your thoughts on including separate stylesheets for individual pages. I've realized at the start of a pretty large site, including Internet and Intranet sections, that my stylesheet could grow very large and even finding sections of styles for particular pages could be a cumbersome task. What I'm considering is having one main stylesheet, then having supplemental stylesheet for the various pages I will create. E.g., for a particular page, I would have main.css, plus index.css. For announcements, I would have main.css, plus announcements.css. I would be avoiding loading a lot of irrelevant styles for a particular page and make finding style references much easier, too. It seems like the best way to go, but I want to make sure I'm not creating a problem with the technique with which I'm unaware. I can easily specify which particular page's stylesheet is called by using coldfusion and the cgi.script_name variable. Thoughts? Thanks, Rick __ css-discuss [EMAIL PROTECTED] Rick, I think this is an allright solution. However, you might end up repeating yourself if you are not careful in delegating styles to the main sheet. As long as you can stay vigilant on pushing shared classes to the shared sheets, you'll be fine. Otherwise you can end up with spaghetti styles with the same class/id defined 3 different ways on 3 different sheets. Personally I divide my sheets by section. So for a CMS all the styles related to each type of content are on a single sheet. If anything ends up on more than one sheet it goes into the common sheet. -Mark __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] Request for Comments on this CSS Stylesheet Approach
However, you might end up repeating yourself if you are not careful Very true! Thanks, Mark! Rick Rick, I think this is an allright solution. However, you might end up repeating yourself if you are not careful in delegating styles to the main sheet. As long as you can stay vigilant on pushing shared classes to the shared sheets, you'll be fine. Otherwise you can end up with spaghetti styles with the same class/id defined 3 different ways on 3 different sheets. Personally I divide my sheets by section. So for a CMS all the styles related to each type of content are on a single sheet. If anything ends up on more than one sheet it goes into the common sheet. -Mark __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] Request for Comments on this CSS Stylesheet Approach
On the contrary, this is a particularly nice feature when it comes to multiple skins. I can create completely different look and feels with only a change to an ID, thus allowing the user to completely change the layout of the site without my intervention. _ Jake Churchill Team Leader 11204 Davenport, Ste. 100 Omaha, NE 68154 http://www.cfwebtools.com 402-408-3733 x103 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael Adams Sent: Monday, February 18, 2008 2:13 PM To: css-d@lists.css-discuss.org Subject: Re: [css-d] Request for Comments on this CSS Stylesheet Approach On Mon, 18 Feb 2008 10:36:11 -0600 Jake Churchill wrote: I'd set an ID in the body tag for each individual page and divide up your CSS based on that. body id=index, body id=common, etc. Then you've got #index ... { } #common ... { } I do a lot of work with a product called Farcry which is a content management system and this is how I change styles on a per-page basis. This just feels like a cludge necessary only because of the restrictions of your CMS. -- Michael All shall be well, and all shall be well, and all manner of things shall be well - Julian of Norwich 1342 - 1416 __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/ No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.20.7/1284 - Release Date: 2/17/2008 2:39 PM No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.20.7/1284 - Release Date: 2/17/2008 2:39 PM __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] Request for Comments on this CSS Stylesheet Approach
Jason Crosse wrote: On 18/02/2008 16:09, Rick Faircloth wrote: I've realized at the start of a pretty large site, including Internet and Intranet sections, that my stylesheet could grow very large and even finding sections of styles for particular pages could be a cumbersome task. What I'm considering is having one main stylesheet, then having supplemental stylesheet for the various pages I will create. E.g., for a particular page, I would have main.css, plus index.css. For announcements, I would have main.css, plus announcements.css. I would be avoiding loading a lot of irrelevant styles for a particular page and make finding style references much easier, too. You could take the modular approach. Instead of creating stylesheets for individual pages, you could, for example have * common.css * web.css * intranet.css Having individual style files for individual pages seems worse than embedding styles in the head of a document. It seems to me you've got all the disadvantages plus extra calls to the server. This may be a slightly off-topic thread, but in the meanwhile... If you are concerned about performance you should combine everything, even more if you have a server-side language at your disposition. So what I mean is a little bit more of a complex solution... Having separate style sheets usually helps to keep everything organized (depending on how you build them), but it also gives you more connections to the server. So what you can do is to make use of that server-side language you have, just make sure to send the appropriate HTTP headers. I.e: In the (x)HTML page: link rel=stylesheet type=text/css href=css.dynamic.xxx/common/web / In css.dynamic.xxx, something like - split path-info by '/' - check by matching against the available files - send headers and embed all the files into one off-topic I haven't used Cold Fusion, but in PHP (css.dynamic.php) it would be something like this... [[ /illustrative code only/ ]] ob_start('ob_gzhandler'); ob_implicit_flush(FALSE); header('Content-Type: text/css'); $available_css = array( 'common', 'web', 'intranet' ); $css_files = explode('/', @$_SERVER['ORIG_PATH_INFO']); $css_files = array_intersect($css_files, $available_css); $num_css_files = count($css_files); $last = time(); for ( $i = 0; $i $num_css_files; $i ++ ) { $file = some/path/{$css_files[$i]}.css; $stamp = filemtime($file); if ( 0 == $i || $stamp $last ) { $last = $stamp; } echo \n\n/* , ucfirst($css_files[$i]), */\n\n; readfile($file); } header('Last-Modified: '. gmdate('D, d M Y H:i:s \G\M\T', $last)); ob_end_flush(); /off-topic Rafael. __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] Request for Comments on this CSS Stylesheet Approach
Rafael wrote: Jason Crosse wrote: On 18/02/2008 16:09, Rick Faircloth wrote: I've realized at the start of a pretty large site, including Internet and Intranet sections, that my stylesheet could grow very large and even finding sections of styles for particular pages could be a cumbersome task. What I'm considering is having one main stylesheet, then having supplemental stylesheet for the various pages I will create. E.g., for a particular page, I would have main.css, plus index.css. For announcements, I would have main.css, plus announcements.css. I would be avoiding loading a lot of irrelevant styles for a particular page and make finding style references much easier, too. You could take the modular approach. Instead of creating stylesheets for individual pages, you could, for example have * common.css * web.css * intranet.css Having individual style files for individual pages seems worse than embedding styles in the head of a document. It seems to me you've got all the disadvantages plus extra calls to the server. This may be a slightly off-topic thread, but in the meanwhile... If you are concerned about performance you should combine everything, even more if you have a server-side language at your disposition. So what I mean is a little bit more of a complex solution... Having separate style sheets usually helps to keep everything organized (depending on how you build them), but it also gives you more connections to the server. So what you can do is to make use of that server-side language you have, just make sure to send the appropriate HTTP headers. I.e: In the (x)HTML page: link rel=stylesheet type=text/css href=css.dynamic.xxx/common/web / In css.dynamic.xxx, something like - split path-info by '/' - check by matching against the available files - send headers and embed all the files into one I personally don't like this idea. You have no benefit from caching and might as well include all those styles in an inline style tag. I think styles for each page is inherently bad, your styles across the site should be consistent, therefore you shouldn't /need/ a large amount of specific styles for pages. Regards, Chris __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/