Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
July 19, 2021 11:01 pm GMT

Tips to organize well your Css

HOW TO ORGANIZE YOUR CSS

Organizing your Cascading Style Sheet(s) it is a pretty cool way to start developing on writing clean code if you are beginner and if you are pro means you must deal with huge of Css file then its important to organize well your Css to reduce errors and to make code human readable.

WHY! ORGANIZING WELL YOUR CSS
To increase your productivity
Make easier to maintain when it comes in solving some errors
To produce clean code.

Some steps to ensure that your css is well organized

  • Use external CSS.
    This is the most helpful way to to organize your css rather than use internal css or inline css so use external way to organize your css

  • Define variables.
    Custom properties (sometimes referred to as CSS variables or cascading variables) are entities defined by CSS authors that contain specific values to be reused throughout a document. Complex websites have very large amounts of CSS, often with a lot of repeated values.Declare a variable in global zone,global variables are generic variables that will be used to keep the consistency between all our
    Components.

  • Comment your css.
    Adding comments to your CSS will help any future developer work with your CSS file, but will also help you when you come back to the project after a break.

  • Prefer to use class instead of ids
    When your are creating a selector that can be reusable most of times it is better to use a class selector and in styling it is highly recommended to use class.

Thanks if you reach out to the end

It is my first post please
show love
follow me in IG @paschal_maxillian


Original Link: https://dev.to/pascal488/tips-to-organize-well-your-css-32d6

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To