This is my current html structure, I've checked on other sources and some have different opinions and wanted to ask specifically for my situation.
Is the naming correct? Having domainname
as the main block then on the domainname__pricelist
I would create pricelist
class so the child under than element would be pricelist__headers
only and not domainname__pricelist__headers
<div class="domainname container">
Main
<div class="domainname__pricelist pricelist">
<div class="col-md-3">
<div class="pricelist__headers">
<span>.com</span>
</div>
<div>content</div>
</div>
<div class="col-md-3">
<div class="pricelist__headers">
<span>.com</span>
</div>
<div>content</div>
</div>
<div class="col-md-3">
<div class="pricelist__headers">
<span>.com</span>
</div>
<div>content</div>
</div>
<div class="col-md-3">
<div class="pricelist__headers">
<span>.com</span>
</div>
<div>content</div>
</div>
</div>
</div>
However with this currect set-up I'm having issues with my sass rules in targeting pricelist__headers
as it will target domainname__pricelist__headers
can anyone recommend me a solution or comments, if I should just go with domainname__pricelist__headers
or pricelist__headers
or Is there any sass rule that will remove the main domainname
and leave me with pricelist__headers
.domainname{
&__pricelist{
&__headers{
background: red;
}
}
}