I'm creating a website using ASP.NET and I'd like to use some CSS in a user-defined control that will automatically borrow a certain style from the page it's used in.
For instance, suppose we have two pages (foo.aspx and bar.aspx) that use CSS files which each define a style for outlined sidebars in that page:
foo.css
.sidebar{
float: right;
border-style: solid;
border-width: thin;
border-color: red;
}
bar.css
.sidebar{
float: right;
border-style: solid;
border-width: thin;
border-color: blue;
}
I'd like to give the control some CSS that will pick up the value of a selector defined in the page it's being used in:
.sidebarcoloredtext {
color: {value of ".sidebar border-color"};
}
Is this possible without adding .sidebarcoloredtext to foo.css and bar.css and manually setting it to the same color as the outline? I suspect the answer is 'no' in vanilla CSS, but I thought I'd ask anyway and see what add-ons can help with this sort of thing.
By the way, please don't answer this by pointing me to the posts that talk about including one style in another style. This is a similar question, but rather opposite in intent.