11 ms·
Show HN: A simple, plain, minimal, classless CSS for simple, plain HTML pages
- nailer 6y agoIs there a demo online?
- fermienrico 6y agohttps://susam.github.io/spcss/ https://susam.github.io/spcss/ It boggles my mind how people keep forgetting to show what their visitors have come to their page to see. No one gives a fuck about a list of features until you explain what the damn thing is and show it. I feel like having this sense of conciousness already gives you an edge over millions of landing pages that confuse the visitor. There isn't a better time to start a venture!
- susam 6y agoThank you sharing the demo link from README. By the way, there is a "view demo" badge right at the top of the README that points to the URL you have shared, i.e., https://susam.github.io/spcss/ https://susam.github.io/spcss/. However, this comment by @nailer is not the first one that asks about a demo. Others have asked for the demo link too despite the very first badge on the README being a "view demo" badge. That made me think that perhaps the "view demo" badge is not an optimal way to draw the reader's attention to an important link. I guess, the readers ignore these badge-based links either because they associate badges with status displays (build status, coverage status, etc.), not links or because these badges are overused in many projects which could cause our minds to ignore them as noise. In any case, I have added a text note to the README now, that says, "Note: A demo page is available [here][Demo URL]", to ensure that it becomes harder to miss the link to the demo page.
- warpech 6y ago> I guess, the readers are ignoring the these badge-based links either because they associate badges with a status display This, at least for me.
- oneeyedpigeon 6y agoMe too - I expect those badges to provide dynamic status information, not just be static links. However, I found the "example" link just when I wanted it, as I'd finished reading the list of features. There are enough demo links now, imo.
- JimDabell 6y ago> I guess, the readers ignore these badge-based links either because they associate badges with status displays (build status, coverage status, etc.), not links I think that’s very likely; it will be a form of banner blindness: https://www.nngroup.com/articles/banner-blindness-old-and-new-findings/ https://www.nngroup.com/articles/banner-blindness-old-and-ne...
- fermienrico 6y agoI honestly didn't see it at the top of the page, but only at the bottom. Thanks for responding and correcting the page, despite of my somewhat snarky comment.
- cipher_system 6y agoMany projects place the demo link in the top right About box. Thats the first place I look at, demo first, readme second.
- susam 6y agoThank you for the suggestion. Added the demo link in the About field too.
- quickthrower2 6y agoThe lesson is you can’t communicate too much the “selling” part of the pitch which in this case is the demo. Screenshots in addition to the demo which are links to the demo and have a caption underneath that is a link to the demo might be helpful. Demo demo demo!
- nailer 6y agoThanks for adding a link. Yes badges are for status. Tests: passed downloads: 500k The link is better but you could also fix the link to be on 'demo page' not 'here'.
- susam 6y agoDone. Great suggestion. Thank you!
- throwaway201103 6y agoPeople don't read.
- BorisMelnik 6y agoTBF I saw the demo right away, it is normally at the top of all github repo readme's
- tannhaeuser 6y agoHuh? It says what it is and what it does on top of browser styles right there in the linked gh page, doesn't it? The question is more, like, why do we need to discuss those CSS "tricks" at all on a forum for "hackers"? I mean setting contrast and handling overflow of preformatted code text are as basic as it gets when it comes to text formatting. And come on, "prefer-color-scheme" as media query, really (when we have "the cascade" and user stylesheets, adding lots of overhead to CSS)? It appears CSS is made about as unhelpful and undiscoverable as possible.
- netol 6y agoCool. Maybe adding prefers-color-scheme would be useful?
- susam 6y agoDone. See https://github.com/susam/spcss/commit/bf90ecc788030897b18941505d235d9c5f4f0c8f https://github.com/susam/spcss/commit/bf90ecc788030897b18941... for details. Thank you for the suggestion!
- unicornporn 6y agoThere are more than a few of these classless CSS "frameworks" (couldn't we just call them stylesheets?). https://github.com/dbohdan/classless-css https://github.com/dbohdan/classless-css These lists all seem to leave out Element though, which is OG enough (and made by the Neocities guy). https://elementcss.neocities.org/ https://elementcss.neocities.org/
- swyx 6y agoplenty more here! I collect these https://github.com/sw-yx/spark-joy/blob/master/README.md#drop-in-css-frameworks https://github.com/sw-yx/spark-joy/blob/master/README.md#dro...
- Moru 6y agoNice collection! How come the TOC links don't work? Nothing happens when I click them except the URL changing.
- quickthrower2 6y agoYou got me at the digger picture!
- abhinav22 6y agoThis is just another version of a reset style sheet no? Very, very basic stuff and there are many online. From memory I used to use normalize.css. I think if you want to really add value, create a version that also works for responsive web sites. That is an area that is not covered that well. There are some default usage patterns that work well for responsive web so I think it can be done. In any case, making it easy for others to use with the cdn links is a good step and your documentation is very clean - good work on that. But again, this is exceptionally basic stuff. Not sure why it’s on the front page of HN.
- susam 6y ago> This is just another version of a reset style sheet no? This is not a reset stylesheet. Here is what a reset stylesheet like normalize.css does: https://i.imgur.com/DEVtCXp.png https://i.imgur.com/DEVtCXp.png . Here is what sp.css does: https://i.imgur.com/5DB8cq7.png https://i.imgur.com/5DB8cq7.png (light mode), https://i.imgur.com/uSaKCfv.png https://i.imgur.com/uSaKCfv.png (dark mode). This is just my personal boilerplate CSS that I find myself writing on multiple text-based websites I create for fun. > I think if you want to really add value, create a version that also works for responsive web sites. Did you find any specific problems with this CSS with respect to responsiveness? I believe the minimal stylesheet changes that this CSS introduces should work well for any web page design, regardless of whether it is responsive or not. On a general note, advising me on how I should spend my leisure time, while may be well-intentioned, is still a little unsolicited, don't you think? :-) > In any case, making it easy for others to use with the cdn links is a good step and your documentation is very clean - good work on that. But again, this is exceptionally basic stuff. Not sure why it’s on the front page of HN. Thank you. This is very basic stuff indeed. I am by no means a frontend developer or a fullstack developer and I know there are plenty of other classless stylesheets that work better, in general. This is just a small stylesheet that works well for me. If it works well for others like me who develop text-based websites, that's a bonus.
- abhinav22 6y agoAs you are sharing your work online, I was just giving you ideas on what is currently missing / not done well in other online resources, in an area that is quite close to what you have done. There is a real need for a good style sheet for responsive web. If you were to create it, and I’m sure it will be easy for you to do, you could get a very popular product. Sorry if it is unsolicited, no need to listen to it, it is given with good intentions after spending over 50 hours myself on getting up to speed on doing a responsive web site from scratch. Reset / normalize may not be the best terms to use, but effectively that is what you are doing. I’m not going to go into more depth on this. Sorry if I’m being harsh, but I rather be honest than give some cursory congratulations. As I said earlier, your documentation is very well done but there isn’t much this style sheet does otherwise.
- bertylicious 6y agoI'm confused. Why does this get to the front page and why does it have over 200 stars on github? I'm not a webdev at all, but this just looks like 100 lines of trivial CSS to me. What am I missing?
- dirtnugget 6y agoThese classless CSS frameworks are insanely popular on HN. There’s one on the front page every other week.
- susam 6y ago> I'm not a webdev at all, but this just looks like 100 lines of trivial CSS to me. What am I missing? I am not a webdev either. This is a trivial CSS indeed. I don't think you are missing anything. When I posted this on Hacker News, I was hoping some people would like it because they might find it useful. Like I said, I am not really a front-end developer. But I do hack up simple HTML pages together for simple text-based websites from time to time. While doing so, I find myself using this minimal (and trivial) CSS frequently to make the page appear slightly more pleasing compared to what it looks like with the browser defaults, so I moved all that CSS out to a separate repository and shared it here. It is useful to me. If it is useful to someone else, that's a bonus!
- wruza 6y agoYour demo looks nice. This is what I’d expect from browsers’ default stylesheets if these were not a tasteless disaster that nobody can stand.
- enriquto 6y ago> default stylesheets if these were not a tasteless disaster that nobody can stand. I beg to disagree. Having browsed quite a few sites with css disabled over the years, I can assess that default stylesheets tend to grow in you and that you may end up liking them. In a saner world, all sites would use default stylesheets (with empty css), and individual users would set up whatever css they deem beautiful each day.
- chrismorgan 6y agoSome feedback: • Don’t kill link underlines. They’re a very important affordance. If you’re not fond of the æsthetics of a strong underline, one technique I consider reasonable (and use on my own website) is to reduce the opacity of the underline with something like `text-decoration-color: #03c5` (unfortunately you’ll have to write it out each time you change the colour of a link; I really want color-mix(currentColor transparent 33%) from the CSS Color Module Level 5 draft). • When styling :hover and :active, consider :focus as well. For example, where you’ve hidden link underlines, you’ve shown them on :hover and :active, but you should probably show them on :focus as well. (If you want to get fancy and recent, you could consider using :focus-visible instead of :focus; if you do, just make sure it’s in a separate rule set from the others so it doesn’t break older browsers.) • On something like this, killing the purple colouring of visited links makes me sad. Please consider restoring it, it’s useful on content websites. • The markup you use for heading anchors (<h2 id="foo"><a href="#foo">Foo</a></h2>) isn’t great, and precludes putting actual links in headings (which is normally not a good idea, but there are definitely cases where I’ve reckoned it worthwhile and done it). If you want heading anchor links, go for something like <h2 id="foo">Foo <a href="#foo" aria-hidden="true" tabindex="-1" title="Link to this heading">§</a></h2> (some of the most common characters used for this: # NUMBER SIGN, § SECTION SIGN, ¶ PILCROW SIGN, U+1F517 LINK SYMBOL), and show the anchor on hover only (but make sure it’s part of layout either the whole time (e.g. `visibility: hidden` when not hovered) or none of the time (e.g. `position: absolute`) in order to avoid layout flap). This will make life better for users of screen readers especially (so they’re not getting a spurious link). If anyone else has opinions on heading anchors, I’d be interested to hear them; don’t think I’ve ever seen a detailed analysis of all the techniques and their implications. • One of your headings has a typo: <h2 id="Blockquote"><a href="#blockquote">Blockquote</a></h2>, id needs to be lower case (IDs are case sensitive). • Good job on appropriate use of pre, code, samp and kbd.
- giantrobot 6y agoWhy are you suggesting the #foo header have a link to itself? That doesn't make sense. An id attribute value is supposed to be unique to a document, they also act like anchors. Your <h2 id="foo"> is already the #foo anchor target. You can add arbitrary anchors with the "<a name>" tag but if you've got elements with id attributes you're already good for anchors. This is true of all elements with an id attribute, not just headers. They're unique in the document so they can be unique selectors in the DOM.
- deleted 6y ago[deleted]
- etherio 6y agohttps://andybrewer.github.io/mvp/ https://andybrewer.github.io/mvp/ is also a nice classless css library.
- chris_st 6y agoI like Sakura[1] for this use case -- it's opinionated, but I like its opinions! Doesn't appear to recognize dark mode, though. [1] https://oxal.org/projects/sakura/ https://oxal.org/projects/sakura/
- SippinLean 6y agoLOTS of competition with "why did we ever stop using nested element selectors?!" projects like these. Baseline is you have to be better than Normalize, and this isn't. Was anything but personal preference the reason for changing the link color, the body font to specific typefaces, the font-size to a little smaller than normal, etc? Links are much worse, no focus, no text-decoration, confusing colors. You have to nail this stuff.
- deleted 6y ago[deleted]
- susam 6y agoNormalize.css is a general CSS normalizer that caters to all web developers whereas SPCSS is merely my personal stylesheet that does not try to normalize anything at all. So indeed it is just my personal preference that is the reason for changing the link color and the body font. I believe when you say "font-size to a little smaller than normal", you are talking about "font-size: 0.9em" for pre, code, etc. I have removed it now, so that they now have a font-size of 1em. Thank you for highlighting this issue.
- johnisgood 6y agoThere was something about avoiding CDNs, what was it exactly? (The README mentions the use of it).
- lenkite 6y agoCan someone explain to me why would one choose this over a markdown -> html generator ?
- rmetzler 6y agoYou are comparing apples and oranges. This is a CSS Stylesheet. Your html generator either brings its own css or relies on the browser default.