CSS BEST PRACTICES
1- Avoid Code Duplication : Keeping Your CSS Code Dry Will Help You Minimizing The Amount Of Edits To Make Change To A component
2- Don't Use Absolute Lengths : Use Relative Units For Scallable Size On Larger & Smaller Viewports
Example :
font-size : 24px
Use :
font-size : 75%
3- Use Inheritance : Use Inheritance To Copy A Specific Parameter From The Parent Element
Example :
input , select , button { font:inherit; }
4- Use Viewport Relative Units : Use Viewport Relative Units , To Reduce The Amount Of Media Queries For Every Viewport And Keep Your Code Clean
Example :
vh (viewHeight) vw(viewWidth) vmin , vmax
4- Set max-width For Replaced Elements : Set Max Width For Replaced Elements Such As : img - object - video - iframe
Hit The Like Button If You Like The Content
Thanks For Reading
Top comments (0)