sass - Simplify matching elements in SCSS -
the html dom structure have is, sort of, repetitive. there practice refactor sass rules?
html:
<div name="opportunitydetailview" class="actor-wrapper"><div name="opportunitydetailview" class="detail-view expansion-bottom-normal">...</div></div> <div name="applicationdetailview" class="actor-wrapper"><div name="applicationdetailview" class="detail-view expansion-bottom-normal">...</div></div> <div name="profiledetailview" class="actor-wrapper"><div name="profiledetailview" class="detail-view expansion-bottom-normal">...</div></div>
scss case 1:
div[name="opportunitydetailview"] > div[name="opportunitydetailview"], div[name="applicationdetailview"] > div[name="applicationdetailview"], div[name="profiledetailview"] > div[name="profiledetailview"], { css rules... }
scss case 2:
.section { div[name="business_image_url__c"], div[name="name"], div[name="account_name__c"], div[name="business_type__c"], div[name="region_province__c"] { .label{ display: none !important; } }
if i'm not missing something, seems can use classes assigned elements achieve want:
for case 1:
.actor-wrapper { .detail-view { //css code goes here } }
and please provide markup case 2.
if div[name]
elements share same class, can group them class, done above example.
wiki
Comments
Post a Comment