Including one stylesheet inside another
I've got a puzzling problem.
We have multiple sites that use the same large css file. I just make a
copy of it for each site. For each site, though, I'd like to customize a
couple small things like link color.
I could just edit each copy of the css file, but that would make it hard
to maintain when I want a change to appear in all sites.
The ideal solution would be to use an <include> in the css file:
my-big-file.css would be:
#mystyle {
whatever:10px;
}
<include include="my-custom-css.css">
Then for each site, "my-custom-css.css" could be different.
The obvious solution here is to break it up into two different css files
and include both in every page in every site. This would affect a lot of
pages unnecessarily, though, and would be cumbersome if I ever had to
break it into 2, 3, or 4 small css files. A single include statement in
one file would be a lot cleaner.
Is there some way to do this kind of include?
Re: Including one stylesheet inside another
Chris wrote:
> I've got a puzzling problem.
>
> We have multiple sites that use the same large css file. I just make a
> copy of it for each site. For each site, though, I'd like to customize a
> couple small things like link color.
>
> I could just edit each copy of the css file, but that would make it hard
> to maintain when I want a change to appear in all sites.
>
> The ideal solution would be to use an <include> in the css file:
>
> my-big-file.css would be:
>
> #mystyle {
> whatever:10px;
> }
> <include include="my-custom-css.css">
> Is there some way to do this kind of include?
[at] import "my-custom-css.css";
--
Els http://locusmeus.com/
Re: Including one stylesheet inside another
Els wrote:
> Chris wrote:
>
>> I've got a puzzling problem.
>>
>> We have multiple sites that use the same large css file. I just make a
>> copy of it for each site. For each site, though, I'd like to customize a
>> couple small things like link color.
>>
>> I could just edit each copy of the css file, but that would make it hard
>> to maintain when I want a change to appear in all sites.
>>
>> The ideal solution would be to use an <include> in the css file:
>>
>> my-big-file.css would be:
>>
>> #mystyle {
>> whatever:10px;
>> }
>> <include include="my-custom-css.css">
>
>> Is there some way to do this kind of include?
>
> [at] import "my-custom-css.css";
But I'd do it the other way round.
Let each site have its own my-custom-css.css, and have an
[at] import "my-big-file.css";
in it.
That way you don't have to copy the big file to the different sites
when you make a change to it.
--
Els http://locusmeus.com/
Re: Including one stylesheet inside another
In article <47a3a23a$0$14083$9a6e19ea [at] news.newshosting.com>,
Chris <spam_me_not [at] goaway.com> wrote:
> I've got a puzzling problem.
>
> We have multiple sites that use the same large css file. I just make a
> copy of it for each site. For each site, though, I'd like to customize a
> couple small things like link color.
Nothing easier. You link to the main one on all the sites and you
add underneath another link to another css, the second overriding
a few things you want overridden. Is there some problem you have
for this not to work?
<link rel="stylesheet" type="text/css" href="main.css">
<link rel="stylesheet" type="text/css" href="supplementary.css">
in the head of the html docs on the site where the supplementary
is appropriate.
--
dorayme
Re: Including one stylesheet inside another
dorayme wrote:
> In article <47a3a23a$0$14083$9a6e19ea [at] news.newshosting.com>,
> Chris <spam_me_not [at] goaway.com> wrote:
>
>> I've got a puzzling problem.
>>
>> We have multiple sites that use the same large css file. I just make a
>> copy of it for each site. For each site, though, I'd like to customize a
>> couple small things like link color.
>
> Nothing easier. You link to the main one on all the sites and you
> add underneath another link to another css, the second overriding
> a few things you want overridden. Is there some problem you have
> for this not to work?
>
> <link rel="stylesheet" type="text/css" href="main.css">
> <link rel="stylesheet" type="text/css" href="supplementary.css">
>
> in the head of the html docs on the site where the supplementary
> is appropriate.
From the OP:
<quote>
The obvious solution here is to break it up into two different css
files and include both in every page in every site. This would affect
a lot of pages unnecessarily, though, and would be cumbersome if I
ever had to break it into 2, 3, or 4 small css files. A single
include statement in one file would be a lot cleaner.
</quote>
;-)
--
Els http://locusmeus.com/