Skip to main content

Venkatraman Dhamodaran

Venkatraman Dhamodaran's Public Library

    • If the "exists" check suffices, use that
    •  
    • Don't overqualify using a tag name
    • Tag Names

        

      Tag names in selectors follow a few rules.

        
         
      • Application level styles that are only overridden in a few places are okay to use tag name selectors
      •  
      •  Not semantic. Avoid where possible, use class names instead
      •  
      • Fine to use when there's a ton of elements under the same namespace that need a small tweak
      •  
      •  Don't overqualify (a.foo)
    • If a component needs to be different within another component, these rules apply.

        
         
      • Where possible, give a class name using the parent namespace to the child component
      •  
      • If that's not possible, then use a nested selector

8 more annotations...

    • If the "exists" check suffices, use that
    •  
    • Don't overqualify using a tag name
    • Application level styles that are only overridden in a few places are okay to use tag name selectors
    •  
    •  Not semantic. Avoid where possible, use class names instead
    •  
    • Fine to use when there's a ton of elements under the same namespace that need a small tweak
    •  
    •  Don't overqualify (a.foo)
    • If a component needs to be different within another component, these rules apply.

        
         
      • Where possible, give a class name using the parent namespace to the child component
      •  
      • If that's not possible, then use a nested selector
      •  

      Suppose you have a User List component .ul-* and a User Card component .uc-*.

1 more annotation...

1 - 20 of 1342 Next › Last »
20 items/page

Diigo is about better ways to research, share and collaborate on information. Learn more »

Join Diigo