Borders define edges, emphasis, and component boundaries. Keep border system consistent for visual rhythm.
Border building blocks
border-width: 1px;\nborder-style: solid;\nborder-color: #cbd5e1;
Production checklist
- Use shared border color tokens.
- Match focus border contrast with accessibility requirements.
- Avoid random one-off border radii.
Important interview questions and answers
- Q: Why can borders shift layout?
A: Border width contributes to element box size unless managed with box sizing. - Q: Border vs outline for focus?
A: Outline is preferred for focus rings because it does not affect layout flow. - Q: How to avoid inconsistent card borders?
A: Use a shared component class or tokenized utility set.
Pitfall: Check cascade order—author stylesheet loses to inline styles and !important surprises.