Appearance
CSS Style
Standards for consistent CSS style.
Follow Code Style Rules
All CSS must follow language-agnostic standards: 2-space indentation, 80-character line limit.
One Property Per Line
❌ DON'T
css
div { margin: 0; padding: 0; border: none; }✅ DO
css
div {
margin: 0;
padding: 0;
border: none;
}Check for multiple properties on one line:
sh
node checks/one-property-per-line.js file.cssOrder Properties by Logical Grouping
- Outer Layout:
position,top,right,bottom,left,z-index,display - Inner Layout:
flex,grid,width,height,margin,padding,border,overflow - Typography:
font,font-size,line-height,text-align,color - Visuals:
background,box-shadow,opacity - Motion:
transform,transition,animation - Interaction:
cursor,pointer-events
❌ DON'T order randomly
css
button {
color: white;
position: relative;
background: blue;
padding: 10px;
}✅ DO group logically
css
button {
position: relative;
padding: 10px;
color: white;
background: blue;
}Use CSS Custom Properties
css
:root {
--color-primary: #007bff;
--spacing-base: 8px;
}Use Lowercase Hex Colors
❌ DON'T: #FF0000, #FFFFFF
✅ DO: #ff0000, #ffffff
Check for uppercase hex colors:
sh
node checks/lowercase-hex.js file.css