CSS: "Sync" Selector Properties


My Google-fu is failing me, and I'm not quite sure if what I'm looking for even exists.

That being said, I'm trying to find a way to dynamically fetch/pull/reference a CSS property from an element in pure CSS.

I've made up a function to describe what I would like, called 'prop', which accepts a selector and a property name, and returns the value of the supplied property.

div.charlie {
    background-color: black;

div.echo {
    color: prop(div#charlie, background-color);

My reason for doing this is that I actually will not know beforehand (without using JS) what the background-color of .charlie will be (it's an external site), but I still need the color of .echo to match and stay "in sync".

Any suggestions?

Problem courtesy of: TheMusiKid


Apparently this is not possible in pure CSS (thank you @Paulie_D).

I'd have to use Less or SASS.

Oh well :P

Solution courtesy of: TheMusiKid


There is currently no discussion for this recipe.

This recipe can be found in it's original form on Stack Over Flow.