News for hackers. Stuff that matters.
Re:New.css – A classless CSS framework to write modern websi... by amanzi on Monday May 18, 2020 @06:27AM (#23220614)
This Github repository tracks a whole bunch of these drop-in CSS files: https://github.com/dohliam/dropin-minimal-css

And you can use this demo site to switch between them all on the fly: https://dohliam.github.io/dropin-minimal-css/

Re:New.css – A classless CSS framework to write modern websi... by networked on Monday May 18, 2020 @07:16AM (#23220966)
This is really useful! Thanks for linking to it.

I also have a related repository. It is a gallery of screenshots of classless CSS themes: https://github.com/dbohdan/classless-css. I've just added a link to the drop-in CSS switcher there.

Re:New.css – A classless CSS framework to write modern websi... by fouc on Monday May 18, 2020 @11:09AM (#23223287)
Re:New.css – A classless CSS framework to write modern websi... by elefantastisch on Monday May 18, 2020 @09:53AM (#23222312)
It's a shame how few of these prevent horizontal scroll on mobile. Usually the table and/or video are not probably handled. My take away from this: Simple does not mean easy; check edge cases.
Re:New.css – A classless CSS framework to write modern websi... by _bxg1 on Monday May 18, 2020 @11:00AM (#23223179)
As suggested by a sibling comment the key isn't to prevent horizontal scrolling, but to prevent content from overflowing a single screen width. Which isn't hard per se but doesn't have a one-size-fits-all solution.
Re:New.css – A classless CSS framework to write modern websi... by chongli on Monday May 18, 2020 @11:18AM (#23223385)
So many websites overflow a single screen width by a trivial amount. This is just enough to cause accidental horizontal scrolling which disrupts the flow of scrolling the page. Very frustrating!
Re:New.css – A classless CSS framework to write modern websi... by _bxg1 on Monday May 18, 2020 @11:22AM (#23223461)
Yep. The offenders are usually really long un-line-breakable words, images, or videos. In this case we have:

  href="https://newcss.net/theme/terminal.css">
Which is not being allowed to break to a new line because it doesn't contain whitespace. A CSS rule can be used to allow it to break, though that can also have other, unwanted ramifications.
Re:New.css – A classless CSS framework to write modern websi... by thaumaturgy on Monday May 18, 2020 @12:25PM (#23224517)
It's not super easy either. I ran into this also (https://doc.sscaffold-css.com/ysk/tables/) and the root cause is that the <table> element is not considered to be either a block-level or an inline element. It's special, and because it's special, some browsers support setting max-width on it and some don't. So tables need a container element or some other kind of special handling. It's an easy bug to overlook because the cause is so unexpected.
Re:New.css – A classless CSS framework to write modern websi... by awb on Monday May 18, 2020 @02:28PM (#23226451)
It's a tricky problem. I've been battling with it on MVP.css (https://andybrewer.github.io/mvp/) but I think I found a good solution for responsive tables with some help from the community.
Re:New.css – A classless CSS framework to write modern websi... by tpoindex on Monday May 18, 2020 @07:28PM (#23229596)
I'm also interested in your tables solution. Also, is there an organized MVP.css community somewhere?
Re:New.css – A classless CSS framework to write modern websi... by awb on Monday May 18, 2020 @11:20PM (#23231000)
Feel free to ask questions or contribute on GitHub: https://github.com/andybrewer/mvp
Re:New.css – A classless CSS framework to write modern websi... by iagovar on Monday May 18, 2020 @07:02PM (#23229385)
I'm probably gonna use your solution. Thanks.
Re:New.css – A classless CSS framework to write modern websi... by petee on Monday May 18, 2020 @10:10AM (#23222513)
As someone who constantly runs into mobile pages with poorly fitting content yet are still scroll-limited, I see this as a welcome feature.

Most mobile browsers seem to lock the scroll direction while moving anyway, so atleast it isn't sloppy in practice, imho

Re:New.css – A classless CSS framework to write modern websi... by saagarjha on Monday May 18, 2020 @08:53PM (#23230168)
I use a browser that locks the scroll direction and pages which overflow horizontally drive me mad. If your website does that, I will search for the reading mode button immediately because I cannot really work with handling scrolling in two directions.
Re:New.css – A classless CSS framework to write modern websi... by bjarneh on Monday May 18, 2020 @08:21AM (#23221404)
That's excellent. It would be funny if that 'LaTeX CSS' moved all images to the end of the web page..
Re:New.css – A classless CSS framework to write modern websi... by jacobush on Monday May 18, 2020 @10:13AM (#23222536)
With references, of course. ;-)
Re:New.css – A classless CSS framework to write modern websi... by bjarneh on Monday May 18, 2020 @12:51PM (#23224901)
Of course :-)
Re:New.css – A classless CSS framework to write modern websi... by hanniabu on Monday May 18, 2020 @05:36PM (#23228662)
It's a shame that none of these (as far as I can tell with the 60% I clicked though) restrict the page width to 100% to prevent horizontal scrolling on mobile. Simple enough to add yourself, but still.
Re:New.css – A classless CSS framework to write modern websi... by tudorw on Monday May 18, 2020 @07:45AM (#23221134)
Pity I cannot just receive vanilla mark up and pick a client side theme.
Re:New.css – A classless CSS framework to write modern websi... by _ZeD_ on Monday May 18, 2020 @08:44AM (#23221602)
I'm pretty sure firefox has this feature.

the problem is no website offer custom css.

for an example: https://stackoverflow.com/questions/48227413/what-is-the-pur...

Re:New.css – A classless CSS framework to write modern websi... by ancarda on Monday May 18, 2020 @12:50PM (#23224895)
Seems Firefox doesn't remember the CSS you have selected (i.e. per page? per domain?)

I can think of some uses for this if it were sticky - high contrast and dark mode versions for websites

Re:New.css – A classless CSS framework to write modern websi... by 6510 on Tuesday May 19, 2020 @03:11AM (#23232144)
You can detect css changes and remember/enforce it yourself but yeah, it does remember permission per page so adding this should have been/be easy.
Re:New.css – A classless CSS framework to write modern websi... by andai on Monday May 18, 2020 @12:40PM (#23224735)
Oh wow. Does this only work on FF?
Re:New.css – A classless CSS framework to write modern websi... by pbhjpbhj on Monday May 18, 2020 @08:24AM (#23221424)
I doubt it would work well but you could put a theme in user.css (on Firefox) and block all .css files (with uBlock, say). Not sure if uBlock will block <style> tags, but I think it can.
Re:New.css – A classless CSS framework to write modern websi... by JadeNB on Monday May 18, 2020 @08:21PM (#23229946)
I think user.css automatically overrides any remote CSS, doesn't it?—so no need for blocking.
Re:New.css – A classless CSS framework to write modern websi... by pbhjpbhj on Wednesday May 20, 2020 @09:34AM (#23246613)
Yes, I suppose if you use a css reset then you wouldn't need to block .css files; but you could save a little bandwidth if you did.
Re:New.css – A classless CSS framework to write modern websi... by 6510 on Tuesday May 19, 2020 @03:07AM (#23232120)
Yeah, that is how it should have worked.

HN is pretty vanilla. I use it with https://userstyles.org/styles/92693/dark-hacker-news-solariz...

Not the standardized approach that we should have had long ago but better than nothing.

Re:New.css – A classless CSS framework to write modern websi... by spyckie2 on Monday May 18, 2020 @06:45AM (#23220755)
Seeing all these styles, I can't help but get the feeling that we're heading towards the aesthetic minimalist ideal of mixed text media.
Re:New.css – A classless CSS framework to write modern websi... by ComodoHacker on Monday May 18, 2020 @07:10AM (#23220924)
It's modern MSWord templates.
Re:New.css – A classless CSS framework to write modern websi... by metalliqaz on Monday May 18, 2020 @09:03AM (#23221771)
shh
Re:New.css – A classless CSS framework to write modern websi... by hotwire on Monday May 18, 2020 @08:19AM (#23221388)
hah, reminds me of http://www.csszengarden.com but simpler.
Re:New.css – A classless CSS framework to write modern websi... by mathnmusic on Monday May 18, 2020 @11:13AM (#23223326)
I would like these themes to go beyond a simple article view. We have tags like <header>, <nav>, <main>, <aside>, <section> and <footer> now. Should be possible to build a complete app-shell with classless CSS.
Re:New.css – A classless CSS framework to write modern websi... by mlok on Monday May 18, 2020 @11:23AM (#23223489)
This is what I expected too. This one has nav, aside : http://classless.de/#extra

Plus a couple bootstrap classes where HTML5 has no elements : grid and card.

Re:New.css – A classless CSS framework to write modern websi... by philistine on Monday May 18, 2020 @05:28PM (#23228585)
As an exercice, I’m building my neighborhood newspaper website without any classes. It is surprisingly easy. With Grid and min(), I don’t even need media queries. CSS and HTML in 2020 is great, if you take the time to choose only the latest solutions.
Re:New.css – A classless CSS framework to write modern websi... by heavyset_go on Tuesday May 19, 2020 @01:15AM (#23231460)
Have a link to it?
Re:New.css – A classless CSS framework to write modern websi... by awb on Monday May 18, 2020 @02:34PM (#23226535)
I style those elements in MVP.css (https://github.com/andybrewer/mvp/)
Re:New.css – A classless CSS framework to write modern websi... by niyazpk on Monday May 18, 2020 @07:34PM (#23229628)
Thanks! Does anyone know how these stylesheets interact with other frameworks like bootstrap? If I want to use bootstrap in a website, can I still start with one of the above as the base style?
Re:New.css – A classless CSS framework to write modern websi... by dstroot on Monday May 18, 2020 @11:23PM (#23231011)
It might be an interesting question to ask why bootstrap couldn’t be mostly classless. I remember learning Bootstrap and thinking it was silly I had to add class=table to a table.
Re:New.css – A classless CSS framework to write modern websi... by louismerlin on Monday May 18, 2020 @04:19PM (#23227852)
That's very cool ! My microframework is on there and I wasn't even aware.
Re:New.css – A classless CSS framework to write modern websi... by lostmsu on Friday May 22, 2020 @05:20PM (#23277198)
Do any of them support Dark/Light?