2024 css reset

Is that actually a good practice๐Ÿคซ
No description
10 Replies
clevermissfox
clevermissfoxโ€ข10mo ago
I have the text-wrap: balance and box-sizing: border-box in my reset. I like to use svh vs dvh if Iโ€™m needing to declare a min-height in the body. I do wonder โ€œwhy the position: relative?โ€ On the *selector. The only think that comes to mind is to be able to use z-index on an element without giving them a position themselves. If thatโ€™s the reason I think itโ€™s a bit overkill. Curious what the actual reason is. ๐Ÿค”
Chooโ™š๐•‚๐•š๐•Ÿ๐•˜
This code doesn't reset margins and padding. Also, dvh should be used in combination with vh, because it is still too new to use alone. The 100vh should come before 100dvh. This allows the 100vh to be overridden by the 100dvh in browsers that understand it. This also allows the 100vh to be used on browsers that don't understand dvh. They will just ignore the dvh. Without the 100vh, browsers that don't understand dvh will not have the height set at all. I forgot to also add that the universal selector does not select pseudo elements.
GHOST ๐Ÿ‘ป
GHOST ๐Ÿ‘ปโ€ข10mo ago
That's the annotations that the creator add fr ๐Ÿ˜
No description
GHOST ๐Ÿ‘ป
GHOST ๐Ÿ‘ปโ€ข10mo ago
@hartโค๐Ÿ”ฅ have a look a the comments of the creator๐Ÿ˜…
Chooโ™š๐•‚๐•š๐•Ÿ๐•˜
I disagree with this. It is not common enough that you would need to anticipate the use of top, left, right, and bottom. When you want to use them, add the postion: relative. You don't need it on all elements.
GHOST ๐Ÿ‘ป
GHOST ๐Ÿ‘ปโ€ข10mo ago
@ChooKing yep absolutely true Kevin said that before the vh comes first than the dvh cause like you said its totally new but i think we can include both of them at the same time than the browser chose the dvh if supported if not its gonna go with vh only ๐Ÿ˜‹ @ChooKing me too absolutely cause position relative could be problematic if you want to position a nested child ๐Ÿ’ฏ
Jochem
Jochemโ€ข10mo ago
if you put the dvh below the vh, yes
althepal78
althepal78โ€ข10mo ago
why would you want to make every element relative? It looks like it will mess up when you trying to use absolute
Coder_Carl
Coder_Carlโ€ข10mo ago
I would not use the position relative. this can lead to creating stacking contexts too easily by mistake which causes lots of problems
clevermissfox
clevermissfoxโ€ข10mo ago
Echoing to def not include the position relative, itโ€™s unnecessary and could (and prob will) lead to issues.
Want results from more Discord servers?
Add your server