7 ms·
“58 bytes of CSS to look great nearly everywhere” mkws theme
- neogodless 4y agoAs per the linked content, this is based on a recent submission 6 days ago (242 comments) https://news.ycombinator.com/item?id=32972004 https://news.ycombinator.com/item?id=32972004 (gist.github.com) This older submission with the same title links to a 404[0]! https://news.ycombinator.com/item?id=19607169 https://news.ycombinator.com/item?id=19607169 (jrl.ninja) 3 years ago (255 comments) [0] Web Archive link https://web.archive.org/web/20210318102514/https://jrl.ninja/etc/1/ https://web.archive.org/web/20210318102514/https://jrl.ninja...
- gennarro 4y agoI’m getting a lot of side to side scroll on mobile. That kills it for me
- Waterluvian 4y agoSame. Nothing makes a webpage uglier than when it is irritating to perform basic navigation. I have to imagine the majority of websites are visited on mobile these days.
- adriangrigore 4y agoThat's just the <pre> tags, the original CSS doesn't cover <pre> tags. I kept the original intact! You could simply do a pre { overflow-x: auto; } to solve the side scroll.
- e12e 4y agoSeems this could use a hyphenation-fix - it's pretty terrible ragged right as is. This should now be possible to fix reasonably with plain css3. https://stackoverflow.com/questions/8937591/is-it-possible-to-enable-auto-hyphenation-in-html-css#8937764 https://stackoverflow.com/questions/8937591/is-it-possible-t...
- selfmodruntime 4y agoNothing about this looks great. Margins and Paddings feel "off". Heading 6 is too small to read comfortably on desktop (even worse on mobile). The text font is too thin and the entire site feels tiring to read in contrast with the white background. The entire content column is only 600 pixels wide on my 1080p monitor, so you'd need to scroll a lot for long texts. It's also weirdly off-center. This entire idea is about size first and second, accessibility and look go dead last. There is no advantage to using 58 bytes only. Just use 14KB if you care that much, which is the size the first 10 TCP packets that your server sends to the client before the first ACK anyway [1]. [1]: https://www.tunetheweb.com/blog/critical-resources-and-the-first-14kb/ https://www.tunetheweb.com/blog/critical-resources-and-the-f...
- markdown 4y ago> It's also weirdly off-center. It isn't. Just looks that way because the first few sentences are short.
- tomjakubowski 4y ago(and contain long words without smart hyphenation, so they wrap weirdly)
- nmilo 4y agoIf it's 58 bytes it can fit inline into your 14kB HTML file.
- peanut_worm 4y agoyoud be better off using default browser styling than this
- TheRealPomax 4y agoYou're arguing over 58 bytes. If someone just wants a minimalistic page, setting a centered body with max-width is step 1. If you stop after step 1, cool. If not: your page is probably going to look better. However, there is a marked difference between "the content is centered in the browser with whitespace on the sides" and the browser default "it's on the left with all the whitespace on the right". The first one wins. That _should_ have been the browser default in absence of a stylesheet rel, but CSS was born when screens were majestically tiny and the idea of a 24" widescreen was literally a vapourware joke, so it wasn't, and so it never will.
- denton-scratch 4y agoTitle is misleading. There is zero CSS in the article, which is about a static site generator based on shell script. The CSS fragment referred to can be found here: https://gist.github.com/JoeyBurzynski/617fb6201335779f8424ad9528b72c41 https://gist.github.com/JoeyBurzynski/617fb6201335779f8424ad...
- throw_m239339 4y agoIt reminds me the whole "you don't need jquery/vanilla.js". 10+ years after that, it seems that movement went nowhere given how framework heavy webpages have become.
- adriangrigore 4y agoIt says "mkws theme" in the title.
- denton-scratch 4y agoI had no idea what "mkws" is; I did know what CSS is. I was expecting a CSS "theme".
- chrismorgan 4y ago<link rel=stylesheet href=s.css?2020-12-12T18:42:29Z> Um… did you really just spend 53 bytes on loading a 62-byte (plus HTTP overhead) external stylesheet? Here, let me fix that with these 61 bytes: <style>main{max-width:38rem;padding:2rem;margin:auto}</style>
- adriangrigore 4y agoYeah, I'm considering inlining styles by default in `mkws`. Currently, they're not.
- peanut_worm 4y agolooks terrible and scrolling is broken on mobile lol what is this?
- yieldcrv 4y agojunior developers with a megaphone
- marssaxman 4y agoLooks great to me - it's a lot like reader mode, where I do most of my reading. I might not bother to reader-mode-ify a page formatted this way, as it is already comfortable to read.
- deleted 4y ago[deleted]
- tipsytoad 4y agoAnyone got recommendations for a "minimal" CSS template?
- yoyohello13 4y agoMVP.css: https://andybrewer.github.io/mvp/ https://andybrewer.github.io/mvp/
- adriangrigore 4y agoI personally would go with https://oxal.org/projects/sakura/ https://oxal.org/projects/sakura/
- sphars 4y agoI've come to enjoy using Simple.css: https://simplecss.org/ https://simplecss.org/
- antics9 4y agoI played around with this the last time it was posted here and this is my take. 50 bytes and looks great everywhere: html{margin:0 auto;max-width:80ch;line-height:1.6} Example: https://chai.guru/www/ https://chai.guru/www/
- bArray 4y agoHere you go: https://coffeespace.org.uk/tools/css-64.htm https://coffeespace.org.uk/tools/css-64.htm A 64 byte CSS dark theme with a monospace font based on the 58 byte CSS theme [1] and a page that could be an entry for the 1kB club [2]. [1] https://gist.github.com/JoeyBurzynski/617fb6201335779f8424ad9528b72c41 https://gist.github.com/JoeyBurzynski/617fb6201335779f8424ad... [2] https://1kb.club/ https://1kb.club/
- sphars 4y agoJust took a look at your site, doesn't seem to be working (on Bromite, with dark theme on device enabled): https://ibb.co/YfLzzLs https://ibb.co/YfLzzLs
- bArray 4y agoInteresting. The CSS is just: html{filter:invert();font:2em monospace;max-width:32em;margin:auto;} The "dark theme" is just an inversion of the HTML colours. It assumes the HTML page will be loaded with the default black on white. It seems as though the browser doesn't correctly apply inversion across the the background and foreground, or applies its implementation of the dark theme incorrectly after. Either way I believe this is weirdness caused by Bromite. I saw on Netscape and Dillo that it just ignores the inversion as it doesn't support it, but I don't know what Chrome/Chromium (desktop) does. If you have Chrome/Chromium desktop would you mind testing it? (My local Chromium is borked for complicated reasons.)
- sphars 4y agoSorry for the late response, but I've tested this in all my Chromium-based desktop browsers (including Chrome, Vivaldi and Edge) and they all fail to render it properly, including forcing prefers-color-scheme to light: https://ibb.co/XjNFY2G https://ibb.co/XjNFY2G Works in Firefox though. Edit: upon some further investigation, the CSS is inverting the elements correctly, except the html (or maybe body) background from white to black. Chromium seems to not want to do that. Now I'm curious and gonna find out why tomorrow