Comments on: An Interview With Elad Shechter on “The New CSS Reset” https://css-tricks.com/an-interview-with-elad-shechter-on-the-new-css-reset/ Tips, Tricks, and Techniques on using Cascading Style Sheets. Mon, 22 Aug 2022 12:08:02 +0000 hourly 1 https://wordpress.org/?v=6.1.1 By: Jeff Nyman https://css-tricks.com/an-interview-with-elad-shechter-on-the-new-css-reset/#comment-1796801 Mon, 22 Aug 2022 12:08:02 +0000 https://css-tricks.com/?p=353462#comment-1796801 In the article Elad states:

“The second case, :not(svg *) is done with a separate :not() only because it is for a different issue. Touching the inner elements of an SVG can break the visual image, and this is one of those things that there isn’t any reasonable cause to interrupt the browser.”

It is entirely unclear to me what that means. Further, in the actual GitHub file, that latter clause is given as:

:not(svg *, symbol *))

And the comment is the “symbol *” part is to solve a “Firefox SVG sprite bug.” But it’s hard to determine what the bug being referred to actually is. In looking things up, it looks like Firefox has had SVG sprite issues for awhile.

I feel like resets or even normalize type stuff should reference specific bug numbers or at least some reference that says exactly what’s being solved by the inclusion. I say this because I feel like a lot of stuff in various resets is taken on faith and then propagates for a long time.

I’m not saying that’s the case here. I just have no way to know. Case in point is I see a lot sources quoting this reset but none of them actually seem to know exactly why that particular bit is in there.

]]>
By: Jeff Nyman https://css-tricks.com/an-interview-with-elad-shechter-on-the-new-css-reset/#comment-1796797 Mon, 22 Aug 2022 09:25:55 +0000 https://css-tricks.com/?p=353462#comment-1796797 I think this is an interesting approach but it still leaves me wondering why I would do this over just using say Normalize or Sanitize. (The latter actually includes Normalize as part of it.)

I understand the purpose of the hard reset for sure. But I just wonder how necessary that truly is with modern browsers and why the more opinionated approaches of Normalize or Sanitize aren’t better.

I feel like that’s one question that would be worth asking but wasn’t really asked here. I do see Elad’s description of how he prefers the hard and gentle approach. But what’s not clear is why the hard approach is really needed at all if you’re going to use the gentle approach anyway.

I think part of this is my natural inclination, not always well-founded, to avoid things that do “all” or “never” style blanket changes to everything.

Elad says: “The CSS resets we have are built on old CSS features. But in the last several years, we’ve gotten new features built specifically for resetting things in CSS…”

This would imply that clearly the CSS maintainers feel that the resets are necessary if we’re getting new features specifically to reset things. But then why are so many people conflicted on whether to use resets at all?

All this said, I do agree that if the goal is to do a hard reset of everything, this definitely seems like the most concise way to do it.

As a final point, if I was using Normalize or Sanitize with this approach, it’s very unclear to my why I would put those BEFORE the hard reset. It seems the hard reset would just then remove whatever Normalize/Sanitize puts in place that isn’t just Shadow DOM related.

]]>
By: Elad Shechter https://css-tricks.com/an-interview-with-elad-shechter-on-the-new-css-reset/#comment-1796494 Sun, 24 Jul 2022 10:00:15 +0000 https://css-tricks.com/?p=353462#comment-1796494 In reply to Ilyas Seisov.

The all:unset is already removing the padding and margin from all other elements.

]]>
By: Ilyas Seisov https://css-tricks.com/an-interview-with-elad-shechter-on-the-new-css-reset/#comment-1796459 Fri, 22 Jul 2022 10:54:20 +0000 https://css-tricks.com/?p=353462#comment-1796459 Thanks!
And what about

margin:0
padding: 0

here

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

?

]]>
By: Adam https://css-tricks.com/an-interview-with-elad-shechter-on-the-new-css-reset/#comment-1788498 Sat, 22 Jan 2022 06:51:15 +0000 https://css-tricks.com/?p=353462#comment-1788498 In reply to Adam.

Oh, right, it wasn’t in the original version that I had copied (and is not in this article).

Here’s the replication of my original issue: https://codepen.io/hyvyys/pen/poWMgMj. The hyphenation is off in Chrome.

I wonder how you go about fixing these things! Since DevTools don’t list all the properties overridden by all (and don’t list all vendor-prefixed properties in the Computed tab), do you just go with an index of all properties and check them one by one, or just are a genius like that? :)

]]>
By: Elad Shechter https://css-tricks.com/an-interview-with-elad-shechter-on-the-new-css-reset/#comment-1788480 Fri, 21 Jan 2022 20:50:39 +0000 https://css-tricks.com/?p=353462#comment-1788480 In reply to Adam.

Hi Adam,
You kind of resetting my CSS reset, if you put all:revert; for every DIV.

If you add all:revert; without my CSS reset the contenteditable won’t work.

The contenteditable specific getting separate fix to bring it back, as you can see in the CSS reset:

/* revert for bug in Chromium browsers
– fix for the content editable attribute will work properly. */
:where([contenteditable]){
-moz-user-modify: read-write;
-webkit-user-modify: read-write;
overflow-wrap: break-word;
-webkit-line-break: after-white-space;
}

]]>
By: Adam https://css-tricks.com/an-interview-with-elad-shechter-on-the-new-css-reset/#comment-1788470 Fri, 21 Jan 2022 19:28:57 +0000 https://css-tricks.com/?p=353462#comment-1788470 Here’s an example that all: revert doesn’t work as expected: https://codepen.io/hyvyys/pen/GRMbbev
A contenteditable div is no longer editable, at least in Chrome. In Firefox it is editable but no caret is visible.

]]>
By: Elad Shechter https://css-tricks.com/an-interview-with-elad-shechter-on-the-new-css-reset/#comment-1788275 Mon, 17 Jan 2022 16:38:35 +0000 https://css-tricks.com/?p=353462#comment-1788275 In reply to Adam.

Hi Adam,
Please add CodePen with the specific problem. Then, it will be easier to see the problem and play with the code to understand if there is a problem. And if there is to find a way to solve it :-).

]]>
By: Adam https://css-tricks.com/an-interview-with-elad-shechter-on-the-new-css-reset/#comment-1788237 Sat, 15 Jan 2022 15:31:53 +0000 https://css-tricks.com/?p=353462#comment-1788237 Seems Markdown is not all that supported :) Here’s the image link:

View post on imgur.com

]]>
By: Adam https://css-tricks.com/an-interview-with-elad-shechter-on-the-new-css-reset/#comment-1788236 Sat, 15 Jan 2022 15:30:14 +0000 https://css-tricks.com/?p=353462#comment-1788236 Fair warning,

all: unset;
all: revert;

is not the same as if there was nothing at all. I was making a font demo with features applied to <span>s sprinkled within text. The first rule messed up the hyphenation and positioning of some of these spans (see last line on the image). The second rule didn’t fix that, and I was unable to debug this as the issue was only present in Chrome, which no longer allows showing UA styles.

]]>
By: Chris J. Zähller https://css-tricks.com/an-interview-with-elad-shechter-on-the-new-css-reset/#comment-1787280 Thu, 23 Dec 2021 15:49:43 +0000 https://css-tricks.com/?p=353462#comment-1787280 In reply to Ian.

Ian, you might look at how Andy Bell approaches this. He targets lists that have the attribute role="list" explicitly set:

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role='list'],
ol[role='list'] {
list-style: none;
}

See https://piccalil.li/blog/a-modern-css-reset/

]]>
By: Brandtley McMinn https://css-tricks.com/an-interview-with-elad-shechter-on-the-new-css-reset/#comment-1785904 Thu, 18 Nov 2021 22:47:48 +0000 https://css-tricks.com/?p=353462#comment-1785904 Playing with this and found it obliterates standard <pre> white-space formatting, requiring an extra revert

pre { white-space: revert; }

OR

pre { white-space: pre; }

(white-space: pre sauce: https://webmasters.stackexchange.com/a/16597)

]]>
By: René A. Dippe https://css-tricks.com/an-interview-with-elad-shechter-on-the-new-css-reset/#comment-1785342 Mon, 08 Nov 2021 11:50:01 +0000 https://css-tricks.com/?p=353462#comment-1785342 I have to confess that I never thought to use all like the “normal” css property that it is.

The only situation where I used all was in transitions (and even there I only made rare use of it).

This article just changed my view on this property. I’m definitely gonna use this reset sheet along with Heydon Pickering’s Lobotomized Owl Selector in my next project :D

]]>
By: Ian https://css-tricks.com/an-interview-with-elad-shechter-on-the-new-css-reset/#comment-1785061 Wed, 03 Nov 2021 17:19:17 +0000 https://css-tricks.com/?p=353462#comment-1785061 In reply to Ian.

After a bit more testing, I found that font-size: 0 is needed as well otherwise markers would still take up spaces.

]]>
By: Elad Shechter https://css-tricks.com/an-interview-with-elad-shechter-on-the-new-css-reset/#comment-1784231 Mon, 25 Oct 2021 14:36:42 +0000 https://css-tricks.com/?p=353462#comment-1784231 Yes Jame, and this is part of the main idea, design your own styles even for radio and checkbox buttons.

You can design checkbox for example:

And if you don’t want the reset on them, you can revert the input element back, for example:

 input,
 textarea,
 select {
    all: revert;
 }
]]>