elad2412/the-new-css-reset

Add "position: relative" to all elements

Preciel opened this issue · 1 comments

By default, all elements are set to position: static.

position: static and position:relative are the same thing, except for the fact that prosition: static render the z-index property innefective.

Suggested changes :

replace ▼

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

By ▼

* {
    box-sizing: border-box;
    position: relative;
}
*::before,
*::after {
    box-sizing: border-box;
}

Too opinionated for my perspective. It can cause a problem if you want to create states not according to the parent element. Besides, it isn't being used in most cases on most components.

In the same way, web developers decide to put all elements with flexbox. (similar to React Native)