Selector usage that does not meet NEC specifications
. class{}
Do not use a no-category style as the primary selector, such selectors can only be used as descendant selectors, such as. m-xxx. class{}.
. M-xxx div{}
Do not use a label without semantics as a selector, which can cause a large area of pollution unless you can conclude that your selector will not contaminate the other species now or in the future.
. g-xxx. class{}
Do not use descendant selectors in page layouts, because this descendant selector may contaminate the elements inside.
. g-xxx. m-yyy{}.g-xxx. u-yyy{}
Do not use layouts to control modules or components, modules and components should be separate from the layout.
. m-xxx. f-xxx{}.m-xxx. s-xxx{}
Do not redefine or modify or add functional class selectors and skin class selectors that are already defined through modules or other classes.
. m-xxx. Class. class. class{}
Do not write the selector too lengthy, this will increase the file size and limit the selection of too small range, so that the tree structure too strict application scope is too limited, it is recommended that 3-4 of the length of the finished.
Selectors do not need to fully reflect the structure nesting order, but instead, they can contributors Jane.
. m-xxx. m-yyy. zzz{}
Do not leapfrog control, if. ZZZ is a descendant selector for. M-yyy, then it is not allowed. Selectors other than m-yyy control or modify. zzz.
You can use the. m-yyy extension to modify. zzz, such as. m-yyy-1. zzz{}.
Extension Class Usage Error
An extension class must be used at the same time as its base class for the same node.
Error: class= "g-xxx g-yyy-1" class= "m-xxx-1" class= "u-xxx u-yyy-1" class= "xxx-yyy".
Correct: class= "g-xxx g-xxx-1" class= "m-xxx m-xxx-1" class= "u-yyy u-yyy-1" class= "xxx xxx-yyy".
CSS specification-Typical errors