News for hackers. Stuff that matters.
Re:The right tag for the job: why you should use semantic HTML by extra88 on Monday June 07, 2021 @08:57AM (#27421994)
> I wish there was a way to tell the browser to add more default styles to my document.

Non-Chrome browsers still have modifiable user stylesheets (though I think only Safari for Mac still has a GUI option to do it) but more realistically, you can use a browser extension like Stylus to apply your own styles, even defining them on a per-domain basis.

Enabling the user to change the appearance of your site is much easier if you heed the advice of this article and use the appropriate semantic HTML.

> "clean" mode with no default borders, margins, padding, sizes, styles

Web developers have been starting projects with "reset" stylesheets for decades.

Re:The right tag for the job: why you should use semantic HTML by kevincox on Monday June 07, 2021 @09:14AM (#27422169)
> Non-Chrome browsers still have modifiable user stylesheets

This doesn't solve the problem I describe because it breaks websites (unless you are very minimal with your usage). I am talking about an opt-in feature where you concede control to the browser so that it can apply "aggressive" styles such as it would for reader mode. For example changing the current usage-agent style sheet to a "dark theme" is completely infeasible to ship as it would break way too many sites.

Furthermore just being possible isn't enough. It would also need to provide nice defaults to make this a feasible proposition at all. I can't have my blog being barely readable for 99% of viewers.

> even defining them on a per-domain basis.

I also don't want to fix specific websites. I'm talking about something that works by default. (Of course site-specific tweaks are nice, but that is nearly orthogonal to what I am looking for here.)

> Web developers have been starting projects with "reset" stylesheets for decades.

Yes, and this is an unfortunate hack. It would be nice to remove the necessity to remove the need for these and remove the maintenance required (even if the cost of both is small).

Re:The right tag for the job: why you should use semantic HTML by extra88 on Monday June 07, 2021 @11:01AM (#27423371)
>> Web developers have been starting projects with "reset" stylesheets for decades.

> Yes, and this is an unfortunate hack. It would be nice to remove the necessity to remove the need for these and remove the maintenance required (even if the cost of both is small).

There are too many different opinions about what should or shouldn't be in base styles.

Re:The right tag for the job: why you should use semantic HTML by kevincox on Monday June 07, 2021 @11:08AM (#27423464)
That may be true, but I think that is what makes my idea work well.

- For "content" sections the discussion is entirely removed. Each browser can do whatever it wants so there is no need to argue in the standard.

- For "clean" sections nothing! Every element has no margin:0 padding:0 display:block size:1em color:inherit... This leaves no surprises and developers can do whatever they want.

Of course the third section "legacy" is what we have today and largely shouldn't be changed from the mostly-uniform thing that browsers do today.