All Articles

How I set up my default CSS styles in index.css for React projects.

I use this simple snippet for styles in the root index.css for most React projects as a default start point:

* {
    margin: 0;
    padding: 0;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

html {
    box-sizing: border-box;
    font-size: 62.5%;
}

body {
    font-family: sans-serif;
    font-size: 1.6rem;
    line-height: 1.6;
}