- Define class names in camel-case.
- For the styling purpose, prefer class names to IDs.
- Prefer defining variables for all CSS values describing a certain presentational behavior and used in multiple places (We use ‘css-next’ variables. Read this for more information).
- There is common css file in app component and if you use a class Name in more than one components, Add it to this file (don’t use this for child and depend components).
- Vendor prefixes are not needed since autoprefixer performs this. Read docs for more information.
- Please ensure cross browser compatibility for all major browsers.
- Use ‘:global’ before any global classes because we use css modules and it adds a hash to non global class names.
- SVG is the preferred format for all the images.
- Avoid storing images in directories other than setup/react/assets/images.
- Try restricting CSS nesting feature to no more than three levels.
- Flexbox is the exploited layout and hence it’s preferred project wide (check docs for more information).
- Use kebab-case for naming the assets.
- Try to encapsulate global variables with another variable in the component specific stylesheet.
- Use kebab-case to define variables.
- We should use cascading css for semantic elements (h1, h2, ul, li,...) but not for generic elements (
div
andspan
) - if you need to modify their styles, add a new className to them.