SLDS and lightning component documentation regularly uses CSS classes in example code without reference in accompanying documentation. So, for example, I'm trying to understand .slds-hint-parent
, which is included in SLDS's example code for Data Tables... but isn't included in the 'Overview of CSS Classes' section. Searching the web/SE/SLDS didn't provide answers either.
I'm not sure if the core issue here is me not knowing CSS well enough to find an answer that is readily available... or if Salesforce's notorious lack of documentation is biting me again.
I started digging in the downloadable design system zip, in /assets/styles/salesforce-lightning-design-system.css
. It appears that slds-hint-parent
has no defintion on its own - it's only when it's used as a parent class to other css classes that it has an effect, specifically, classes having to do with button icons.
The comment above one group of CSS classes offers some clarity:
* @summary A parent class must be put on anything that contains a
.slds-button__icon_inverse-hint so that the child reacts
when the parent is hovered. This is for a dark background.
* @selector .slds-button__icon_inverse-hint
* @restrict .slds-button_icon .slds-button__icon
*/
.slds-button__icon_inverse-hint,
.slds-button__icon--inverse-hint {
fill: rgba(255, 255, 255, 0.5); }
.slds-hint-parent .slds-button_icon-border-inverse,
.slds-hint-parent .slds-button--icon-border-inverse {
border-color: rgba(255, 255, 255, 0.5); }
So my best guess so far is that slds-hint-parent
is a parent class used so that a child button element would have the necessary visual reaction to being hovered over. Feels like a pretty flimsy understanding though, is there something I'm missing?
And what's really confusing me... what role is slds-hint-parent
playing applied to the elment in the standard Data Table example provided on SLDS, if the only child class is slds-truncate
?:
<tr class="slds-hint-parent">
<th data-label="Opportunity Name" scope="row">
<div class="slds-truncate" title="Cloudhub"><a href="javascript:void(0);" tabindex="-1">Cloudhub</a></div>
</th>
<td data-label="Account Name">
<div class="slds-truncate" title="Cloudhub">Cloudhub</div>
</td>
</tr>