Web Design Web Design Forum
Registration is free! Here you can view your subscribed threads, work with private messages and edit your profile and preferences Calendar Find other members Frequently Asked Questions Search
Home Web Design

Convenient web based access to our favorite web design Usenet groups

web design reviews

This is Interesting: Free Magazines for Graphics designers and webmasters  





  Last Thread  Next Thread
Author
Thread Post New Thread   

Include a style from another class
 

StarQuake




quote this post edit post

IP Loged report this post

Old Post  09-20-05 - 09:24 AM  
For example:

I have two css files. One with the class foo and one with the class bar:

foo.css:
---------
.foo {
font-size : 12px;
}

bar.css:
---------
.bar {
some include function here
}

What I want is that the class bar becomes exactly the same as foo.

Thanks!

StarQuake

--
for some how-to's and rpms visit my site    : http://solid.bounceme.net
for commercially supported solutions visit  : http://www.robas.com


Post Follow-Up to this message ]
Re: Include a style from another class
 

'sNiek




quote this post edit post

IP Loged report this post

Old Post  09-20-05 - 12:26 PM  
StarQuake schreef:
> For example:
>
> I have two css files. One with the class foo and one with the class bar:
>
> foo.css:
> ---------
> .foo {
>    font-size : 12px;
> }
>
> bar.css:
> ---------
> .bar {
>    some include function here
> }
>
> What I want is that the class bar becomes exactly the same as foo.
>
> Thanks!
>
> StarQuake
>

Just call it .foo and the styles it will overrule (or supplement) the styles
 in the foo.css


--
Niek


Post Follow-Up to this message ]
Re: Include a style from another class
 

StarQuake




quote this post edit post

IP Loged report this post

Old Post  09-20-05 - 12:26 PM  
'sNiek wrote:
> StarQuake schreef:
> 
>
> Just call it .foo and the styles it will overrule (or supplement) the
> styles in the foo.css
>
>

Yes, that would be possible but the problem is I can't change the code
that refers to both foo.css and bar.css

So I'd rather do something like this:

.bar {
include .foo
}

If there's no solution I can just copy the contents of the foo class to
the bar class but then everytime I change foo I will have to change bar too.

StarQuake
--
for some how-to's and rpms visit my site    : http://solid.bounceme.net
for commercially supported solutions visit  : http://www.robas.com


Post Follow-Up to this message ]
Re: Include a style from another class
 

'sNiek




quote this post edit post

IP Loged report this post

Old Post  09-20-05 - 12:26 PM  
StarQuake schreef:
> 'sNiek wrote:
> 
>
> Yes, that would be possible but the problem is I can't change the code
> that refers to both foo.css and bar.css
>
> So I'd rather do something like this:
>
> .bar {
> include .foo
> }
>
> If there's no solution I can just copy the contents of the foo class to
> the bar class but then everytime I change foo I will have to change bar
> too.
>
> StarQuake

Another solution would be something like <p class="foo bar">


--
Niek


Post Follow-Up to this message ]
Re: Include a style from another class
 

Stan Brown




quote this post edit post

IP Loged report this post

Old Post  09-21-05 - 12:39 AM  
On Tue, 20 Sep 2005 10:56:08 +0200 in
comp.infosystems.www.authoring.stylesheets, StarQuake favored us
with...
> So I'd rather do something like this:
>
> .bar {
> include .foo
> }
>
> If there's no solution I can just copy the contents of the foo class to
> the bar class but then everytime I change foo I will have to change bar too.[/colo
r]

This is an FAQ; the answer is "no way in CSS, but you can always
implement some sort of text preprocessing to build your CSS file."

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator:      http://validator.w3.org/
CSS 2.1 spec:   http://www.w3.org/TR/CSS21/
validator:      http://jigsaw.w3.org/css-validator/
Why We Won't Help You:

http://diveintomark.org/archives/20...e_wont_help_you


Post Follow-Up to this message ]
Re: Include a style from another class
 

Jef Driesen




quote this post edit post

IP Loged report this post

Old Post  09-21-05 - 12:39 AM  
StarQuake wrote:
> For example:
>
> I have two css files. One with the class foo and one with the class bar:
>
> foo.css:
> ---------
> .foo {
>    font-size : 12px;
> }
>
> bar.css:
> ---------
> .bar {
>    some include function here
> }
>
> What I want is that the class bar becomes exactly the same as foo.

If you used only one css file you could do something like this:

.foo, .bar {
// Common properties
}
.foo {
// Different properties (foo only)
}
.bar {
// Different properties (bar only)
}


Post Follow-Up to this message ]
Sponsored Links
 





All times are GMT. The time now is 08:06 AM. Post New Thread   
  Previous Last Thread   Next Thread next
Stylesheets archive | Show Printable Version | Email this Page | Subscribe to this Thread

Popular forums

Adobe Photoshop forum Macromedia Flash Web Site Design
Dreamweaver FrontPage forum
JavaScript Forum XML forum
Style Sheets VRML
Forum Jump:
Rate This Thread:

 

XML RSS Feed web design latest articles Syndicate our forum via XML or simple JavaScript

Web Design archive  Database administration help  


Top Home  -  Register  -  Control Panel   -  Memberlist  -  Calendar  -  Faq  -  Search Top