@include and nested css files
<link href="<?php echo $this->getStyleSheet('mystyle.css')?>" rel="stylesheet" type="text/css" />
But the paths get confused with nested css files, where one css gives an @include for another css (which may then @include a further css).
In the long run, just flattening the whole lot into one optimised file is the obvious solution, but during development I would like the flexibility of structure so I can switch fragments in and out.
I can't be the first to run into this. Is there a solution I am missing? How do others solve it?
As such, assuming included.css is in the same directory as mystyle.css, you should be able to simply @include it.
/themes/my_theme/css/mystyle.css (all OK)
Which gets resolved to:
But it should have been:
(PS, just noticed my typo, should have read @import in the first post. It is just the post that I wrote @inlcude, not the css code, which correctly uses @import)
Though I have just moved away from imports as they restrict your page load time as each call is sequential, and not parallel.
This is googles stance on it
That bit there was enough for me to use only two files now, my main, and typography
I just make my main longer and copy in my css from others even during development, code commenting out the bits I don't need.
I now also use the css for blocks during development to test out things using custom templates.
As I first noted, in the long term, an optimised and flattened file is what I intend to use (unless output optimisers become good enough to do all that for me globally on the fly and I can be lazy). Its just that nested @imports are convenient during development when I want to switch various css fragments in and out.
Additionally, I am experimenting with using css frameworks and unfortunately they use relative @imports which are now broken. I was hoping for a way to fix that without having to hack the @imports inside the frameworks.
I have never looked at css frameworks before do they offer much extra? are they the grid layouts?
I have been using yui-2 in the past, then thought of using yui-3, but am now experimenting with yaml. My next stop will probably be ez-css, though I have never used that before. (I like the option of flexible layouts rather than being tied to a grid. I also like source ordering with main content first).
There is a yaml based free theme in the marketplace, but it has made some decisions I would prefer to do differently, so I decided to start from square 1.