Is this some sort of SCSS "inheritance"?
Permalink
Hello Forum. I have a .scss question. I don't know if this question belongs here but I thought I would give it a go. In the following .scss code, is ".infoLable" inheriting from "appraisal"?
.appraisal { height: 50%; padding: 10px; background-color: #1d5882; border-radius: 3px; } .appraisal .infoLabel { color: #FFFFFF; font-weight: normal; min-height: 24px; } .appraisal .infoLabel.big { font-weight: bold; min-height: 30px; }
Hi Xarzu
A3020 is correct. Your code is just plain css. No inheritance is going on in your example. .infoLabel class is a child of .apprasial class.
If you were you are using scss techniques you could rewrite your sass like this.
A3020 is correct. Your code is just plain css. No inheritance is going on in your example. .infoLabel class is a child of .apprasial class.
If you were you are using scss techniques you could rewrite your sass like this.
.appraisal { height: 50%; padding: 10px; background-color: #1d5882; border-radius: 3px; .infoLabel { color: #FFFFFF; font-weight: normal; min-height: 24px; } .infoLabel.big { font-weight: bold; min-height: 30px; } }
'.infoLabel' doesn't inherit from '.appraisal'. It's a child selector. So all children of .appraisal with the .infoLabel class are targeted.
The HTML could look like this: