Not Your Typical Horizontal Rules
sarasoueidan.com
sarasoueidan.com
One thing that would add to this post is to point out that you can define an SVG once in a document and then reference it everywhere else. That way you aren't inlining the actual SVG markup over and over and over.
1. Place your SVG inline anywhere in the document. I usually put all of them in a `<div>` I do `display: none` on.
2. Make sure you assigned each SVG an ID: `<svg id="foobar"><!-- SVG markup --></svg>`
3. Reference that SVG anywhere in your document using `<svg><use xlink:href='#foobar'></svg>`
I use it extensively in a Github project (shameless plug) I've been working on lately. https://github.com/pseudosavant/player.html/blob/master/src/...
Edit: The author does link to her great post digging into the details of using `<use>`, but it didn't seem prominent enough that people would check it out. https://tympanus.net/codrops/2015/07/16/styling-svg-use-cont...
Why? Because the icons are really nice-looking, especially in dark mode, compared to a boring line, and I felt the astronomical touch added some class, combined with the moons in the footer.
(HNers know how useless "it doesn't work" is as feedback when there are so many ways for something to not work, and when it obviously works fine for most people who use it and the developers responding to the feedback, or it would've been fixed already.)
Edit: like that: (sorry in advance, mobile users)
@counter-style rulestyle {
symbols: "*" ")" "+"; /* Symbols go here, images work too. */
system: cyclic;
}
body { /* Initialize counter somewhere. */
counter-reset: rules;
}
hr { /* Style <hr/> as wanted. */
border: none;
text-align: center;
}
hr:before {
counter-increment: rules;
content: counter(rules, rulestyle);
}
Edit 2: according to caniuse.com this seems to be only properly supported in Firefox so far."Text mode" isn't the issue, as screen readers are also "text mode".