Open jehoshua02 opened 9 years ago
Think of it as a comment describing what the code block is doing. We're naming our classes so they are reusable and as a result you may not know exactly when looking at the code that the block you're editing is the main nav. By adding a comment to your code, you can immediately know what you're looking at.
@deseretdigital-ui/front-end-developers
@deseretdigital-ui/front-end-developers
@janiv Is there harm in using a class for that?
Your classes should be broad enough to be reused. You should never really have a main-nav class as that instantly becomes un-reusable.
So ALL classes should be reusable. I missed that principle.
@jehoshua02 even if the class name did not need to be reusable, why would putting the name there be better than in the data-ui-component attribute?
My opinions aren't strong enough to argue either way quite yet.
FTFY! Also, If there's not a strong opinion, then I would recommend going with what someone else has already decided.
In CSS Selectors: Naming UI Components, I thought it strange to use a
data-ui-component
attribute that has no effect other than to communicate something not conveyed already in the code. I struggle to understand when we would use this.Before Closing Issue: