css3 - Lighten parent's (unknown) background-color in child -


is there way in less or (css3 in general) access parent's background-color without knowing it?

something like:

.child-class {     background-color: lighten(parent-background-color, 30%); } 

a less variable obvious approach in case don't know parent's background-color can dynamically styled.

anybody got in trick box out?

edit: have @ scotts's answer clever solution need.

that cannot done in pure css. reason these types of references lead 'circular' situations. or situations dom has looped on multiple times determine final value. both these situations css avoids.

now, if main goal define 'pallette' of sorts , have colors work together, should css expansion tools "sass" or "less". let define colors , change them , other useful comparison things. have @ tools if want such flexibility. cannot however, direct comparison ask, since reduce css in end.

this can done using javascript, , more using jquery. wont clutter answer javascript/jquery code when isn't need.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -