So I suck at CSS, but I decided to take on a challenge but I believe it to be impossible without altering the markup (or using JavaScript).
So here are the rules (for whoever is interested)
You can’t change the markup
You can alter the CSS
You can use JavaScript (if you must, but I’m really looking for a CSS only solution – if one exists)
Color must be expanded on load. (not hover/click)
The challenge:
Take the color bar on the left and make it cover the background of the text as well. When there are two color bars, expand the one further on the right (closer to the text).
So far I’ve been unsuccessful, but I admittedly suck at CSS.
Markup for those behind proxies/firewalls:
HTML
<span class="badge-wrapper"><a class="badge-category-parent" style="background-color: #5F497A;" href="/c/ux"></a><a href="/c/ux" data-drop-close="true" class="badge-category clear-badge" title="Discussion about the user interface of Discourse, how features are presented to the user in the client, including language and UI elements.">ux</a></span>
<br /><br />
<span class="badge-wrapper"><a class="badge-category-parent" style="background-color: #FE8432;" href="/c/extensibility"></a><a href="/c/extensibility" data-drop-close="true" class="badge-category clear-badge" title="Topics about extending the functionality of Discourse with plugins, themes, add-ons, or other mechanisms for extensibility. ">extensibility</a></span>
<br /><br />
<span class="badge-wrapper"><a class="badge-category-parent" style="background-color: #FE8432;" href="/c/extensibility/sso"></a><a class="badge-category-parent" style="background-color: #92278F;" href="/c/extensibility/sso"></a><a href="/c/extensibility/sso" data-drop-close="true" class="badge-category clear-badge" title="Only include actual maintained SSO (single sign on) implementations in this category. See the official documentation on Discourse's SSO support.">sso</a></span>
My above code assumes there are at least ONE text element (e.g. “ux”) and one color. As long as you keep the structure the same for all your needs, then my code will not break. Just FYI.
Yeah, structure won’t change (at least not at this point in time). I’m looking into one potential problem, it has a slight bug with the two color bars in Firefox.
FF/Chrome tested. I saw this wouldn’t take long so I just did it real fast. Gotta get back though. Test in other browsers and let me know what you find.
I still won’t look at this till I get home but… I didn’t think that you wanted to have those elements in the same line,… although I guess that it is logical to think that you wouldn’t mind since you’re using spans… Are you trying to do what I think you’re trying to do?
Eh; Discourse relies on Javascript a lot anyway so they might not even use CSS for this fix. Wouldn’t put it past them. It would be a lot easier to do this in Javascript (albeit the CSS solution isn’t that hard if you know some pseudo classes.)