473,387 Members | 1,528 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Nested definiations in CSS

In a CSS I want to define a custom color and the use this in other
parts of the css such as the body tag defination. How do I need to
define the CSS file to be able to do this?

Jul 21 '05 #1
3 1455
In our last episode,
<11*********************@o13g2000cwo.googlegroups. com>,
the lovely and talented ro*******@hotmail.com
broadcast on comp.infosystems.www.authoring.stylesheets:
In a CSS I want to define a custom color and the use this in other
parts of the css such as the body tag defination. How do I need to
define the CSS file to be able to do this?


If you are asking whether you can use a variable name in css
that you can assign to somewhere else in your stylesheet, the
answer is no. This sort of thing is very easy to do with a
preprocessor, and for something simple like this, just about any
preprocessor that is available for your system will do.

--
Lars Eighner ei*****@io.com http://www.larseighner.com/
God is REAL, unless explicitly declared INTEGER.
Jul 21 '05 #2
ro*******@hotmail.com wrote:
In a CSS I want to define a custom color and the use this in other
parts of the css such as the body tag defination. How do I need to
define the CSS file to be able to do this?


I've never tried this, but a think (as Lars says) you can try to
preprocess it on server side.
Just link a *.php file instead of *.css and this *.php can just prepare
and serve you typical css file combining some template with variables,
variables definitions.

Remember about serving proper headers (mime type)

--
Janusz 'Kali' Kaliszczak
+ pies rasy *jumnik*
=> http://www.deviantart.com/view/18982956/ <= GG#52055
Jul 21 '05 #3
On 01/07/2005 14:55, Janusz 'Kali' Kaliszczak wrote:

[snip]
I've never tried this, but a think (as Lars says) you can try to
preprocess it on server side.


Server-side processing may be overkill, depending on exactly what the OP
needs to do. If it's the equivalent of simple macro expansion, then I'd
run it through a preprocessor (command-line PHP, for example) /before/
uploading.

Unless the style sheet really needs to be dynamic (some content might be
based on user preferences, for example), it's a waste of server time.
Doing it properly may entail calculating the Content-Length header value
yourself, and ensuring that freshness and validator information is
included, too. Using a static file allows the server to take care of all
of that for you.

Preprocessing before upload requires a little more effort that simply
uploading and serving something dynamically, but the use of a shell
script do automate the process could negate that, and I think it's a
better solution.

[snip]

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Glen | last post by:
I have a Struts action form which contains a bean. I am trying to display a bean retrieved from the database in this form using the nested tag. Can anyone help me? I continue to get an error...
6
by: Andy Baker | last post by:
Hi there, I'm learning Python at the moment and trying to grok the thinking behind it's scoping and nesting rules. I was googling for nested functions and found this Guido quote:...
3
by: Erik Bongers | last post by:
Hi, Nested classes only seem to be able to access static members of the surrounding class : class SurroundingClass { public: class InnerClass { public:
10
by: nimmi_srivastav | last post by:
Below you will see an example of a nested conditional expression that this colleague of mine loves. He claims that it is more efficient that a multi-level if-else-if structure. Moreover, our...
6
by: B0nj | last post by:
I've got a class in which I want to implement a property that operates like an indexer, for the various colors associated with the class. For instance, I want to be able to do 'set' operations...
8
by: Robert W. | last post by:
I've almost completed building a Model-View-Controller but have run into a snag. When an event is fired on a form control I want to automatically updated the "connnected" property in the Model. ...
1
by: Tomas Sieger | last post by:
Hi all, I'm in doubt with the following code: class Base { public: class Nested {}; }; class Derived:public Base { public: class Nested {
77
by: Peter Olcott | last post by:
http://www.tommti-systems.de/go.html?http://www.tommti-systems.de/main-Dateien/reviews/languages/benchmarks.html The above link shows that C# is 450% slower on something as simple as a nested loop....
7
by: patrick j | last post by:
Hi I'm wondering about lists with nested lists as one does on a Saturday afternoon. Anyway below is an example of a list with a nested list which the iCab browser's very useful HTML...
3
by: jdurancomas | last post by:
Dear all, I'm trying to declare the operator++ to a nested class. The nested class is not template but the container it is. The code used in teh sample program is included bellow: ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.