Lurker News

Comments (91) 32 threads

myfonj5 replies#
Isn't this the exact usage CSS was intended for?

Also for reference, behold W3C Core Styles (since 1997): https://www.w3.org/StyleSheets/Core/

    https://www.w3.org/StyleSheets/Core/Oldstyle.css
    https://www.w3.org/StyleSheets/Core/Modernist.css
    https://www.w3.org/StyleSheets/Core/Midnight.css
    https://www.w3.org/StyleSheets/Core/Ultramarine.css
    https://www.w3.org/StyleSheets/Core/Swiss.css
    https://www.w3.org/StyleSheets/Core/Chocolate.css
    https://www.w3.org/StyleSheets/Core/Traditional.css
    https://www.w3.org/StyleSheets/Core/Steely.css
rident1 reply#
Classics right there! We've got a long linage of this kinda stuff now from browser resets to full stylesheets to well specified content just for testing any of the above on. I love it! Simple. Consistent. And now more powerful than ever with the help of variables.

Might be fun to take all the w3 core styles rebuild them with modern CSS features. Maybe add some HTML5 elements to the test docs as well.

myfonj#
Yes, it feels somewhat natural to craft this kind of style sheet. As I've just found out [1], there is even more of those than I'd expect.

[1] @dohliam's excellent "Drop-in Minimal CSS" collection mentioned here https://news.ycombinator.com/item?id=22683281

danielvaughn1 reply#
It never fails to amaze me that I've been doing this for a decade, and I keep learning things that seem basic at first glance. I have literally never heard of this at all.
rhizome#
Right? All of the starting from scratch I've done! All of the projects I've put off because style is one of the first things I've have to decide on (e.g. blogs).
romellem#
Little snippet that inserts buttons at the top of the page so you can toggle the stylesheet there between these w3.org sheets:

  (function() {
    const sheets = [
      'https://www.w3.org/StyleSheets/Core/Oldstyle.css',
      'https://www.w3.org/StyleSheets/Core/Modernist.css',
      'https://www.w3.org/StyleSheets/Core/Midnight.css',
      'https://www.w3.org/StyleSheets/Core/Ultramarine.css',
      'https://www.w3.org/StyleSheets/Core/Swiss.css',
      'https://www.w3.org/StyleSheets/Core/Chocolate.css',
      'https://www.w3.org/StyleSheets/Core/Traditional.css',
      'https://www.w3.org/StyleSheets/Core/Steely.css',
      './mvp.css',
    ];

    const div = document.createElement('div');
    const head = document.querySelector('head');
    sheets.forEach(url => {
      let button = document.createElement('button');
      button.onclick = () => {
        // Remove all stylesheets
        let stylesheets = document.querySelectorAll('link[rel="stylesheet"]');
        stylesheets.forEach(el => el.parentNode.removeChild(el));

        // Insert our new sheet ()
        let link = document.createElement('link');
        link.setAttribute('rel', 'stylesheet');
        link.setAttribute('href', url);
        head.appendChild(link);
      };

      button.innerText =
        url === './mvp.css'
          ? 'Original MVP.css'
          : url.replace('https://www.w3.org/StyleSheets/Core/', '');
      button.setAttribute('style', 'cursor: pointer');
      div.appendChild(button);
      div.appendChild(document.createTextNode(' '));
    });

    // Insert buttons into DOM
    document.body.insertAdjacentElement('afterbegin', div);
  })();
sebazzz1 reply#
I remember, when Firefox still had a menu bar, you could actually select a different named stylesheet from within the browser! It was in the edit menu.
myfonj1 reply#
Firefox (on Windows) never lost the menu bar: if you press F10 or Alt (or Alt+some letter from menu) it will pop from top. Style switcher you are referring to is located in View > Page Style, in English localization quickly accessible by Alt+V,Y. You can choose from "No style" (effectively disabling all author level styles) and "Basic Page Style" (enabled author styles). If you are lucky and stumble upon page with linked alternate style, you can still switch to it.

https://developer.mozilla.org/en-US/docs/Web/CSS/Alternative... https://developer.mozilla.org/samples/cssref/altstyles/index...
The last detail this nice feature lacks to this day and that presumably doomed it to current obsolescence is that your choice does not persist during navigation and even page reloads. Never understood why this native switcher stuck half way to be usable. Back in day alternative style sheets were (at least a bit) "hype" author had to recede to JavaScript solutions to provide persistence, so it lost much of its charm.

myfonj#
Speaking of ancient CSS features that looked overwhelmingly promising but never caught up as successfully as they deserved, it is probably worth mentioning User Styles. CSS was initially meant as a "dialogue" among User Agent, User, and content Author, with styles as a tool to express individual preferences. User agent sets some "browser defaults", Author sets their styles and User can participate with their own sets of preferences that can be "weak" like those defaults or even stronger than author's. It is the (or at least mayor part of) "THE 'C' for 'Cascade' in CSS".

Browsers to this days are required by specs to give user a way to participate in the cascade, but it never wasn't easy or even pleasant experience - it mostly involved editing some magic file and restarting browser (for "native" user styles) or using some extension, what feels like a poor excuse to not support it natively and mostly is implemented an a way that does not comply with specs anyway - because it mostly just spams author origin level and does not create user origin level. (I miss the old days when web was young and "userstyles" and "userscripts" seemed like natural development of tech what every user will use daily.)

d3sandoval5 replies#
This is a great idea but the sentence on the demo / example page really irks me, "cross design off your list and get back to working on the hard stuff"

I think I know what you mean but I can't help but feel like that sentence is denigrating the work of an entire discipline that _also_ works on "hard stuff" like figuring out how to address user need with usable interfaces.

nkozyra#
I think that's inherently covered by the name 'mvp.'

Now that of course depends heavily on what you consider to be minimally viable but there's generally not an expectation of professional design work.
If you're the kind of person who reached for bootstrap or material UI or other not semantic, boilerplate frameworks this might be appealing.

danso1 reply#
I don’t even know what the author means. Design is hard stuff.
throwaway555541 reply#
Exactly. Every time I have to do UI work for personal projects (I almost never do it for pro projects), they look like a-ess-ess. Design is very hard. I try to copy the looks of things I like and I get the rough feel of it, but the details, man. The detail and the subtle things. That's where the pros who know how to do UI earn their worth.
mosselman#
We are talking about MVPs here though...
awb1 reply#
Author here. I'm a designer and it wasn't meant to be denigrating, but more of a statement that launching is hard and that it's OK to be embarrassed by the design of your MVP so you should ideally put very little time into it and more time on the core value of your product.

I can see how that doesn't come across the way I worded it though. I'll try to wordsmith that line. Thanks for the feedback!

defrex#
Perhaps simply

> cross _visual_ design off your list and get back to working on the hard stuff

mhd#
> cross design off your list and get back to working on the hard stuff

That sentence made me consider Poe's Law for a while, considering the weird fruits HustleSpeak is bearing quite often. Going by the author's bio, I'm most likely wrong.

Griffinsauce#
That's because this is styling. Not design.
jake-low2 replies#
The markup for the callout buttons/links on the example page [0] is just Button text (for outlined) and Button text (for filled). That's a pretty creative solution that I definitely haven't seen before.

Giving opinionated styles to unclassed HTML elements is definitely not the right fit for every website. But, given this project's goal of being a minimalist, quick-start stylesheet that requires no classes, I think this use of `a em` and `a strong` selectors to create button-y links is pretty ingenious.
[0]: https://andybrewer.github.io/mvp/

oxalorg1 reply#
That is indeed truly creative. Props to the author.

I wanted to solve a similar problem when creating sakura.css [0], but I decided to not implement it and keep it even simpler.
[0]: https://github.com/oxalorg/sakura

awb1 reply#
I wasn't aware of Sakura until now, but several people here and Reddit mentioned it. I love it's simplicity as well. Great job!
oxalorg#
Thanks! I'm loving MVP.css as well and might just end up using it for my next site. ^_^
mrec1 reply#
I think it undermines the semanticity of the markup though. A hyperlink isn't supposed to render as a button, or vice versa. If this was just a bolded word in normal inline link text, the button presentation would be very unwelcome.
bigmanwalter#
Semantics has less to do with style and more to do with the fact that an element can be clicked in order to navigate somewhere else.
gyrgtyn#
sorry! i did cmd-f search the readme. guess i messed up somehow.
mstade#
This is perfect, I've been looking for something like this – thank you!
jypepin#
This is awesome thanks for doing that!

Load more comments