Let’s say that I want to remove the background color of my tags and use it on their border instead. Is it possible with css alone ? If not, the tag-pill-styles macro in $:/core/macros/tag should set the border-color too :
If you’re satisfied with having to do it manually for each concerned tag, then you can use this dirty trick:
In the tag tiddler (because such is needed for non-default tag appearances) you can create a custom color field. If there already is one, you can override it by creating it again. In it, you “trick” the system by injecting also a border property, e.g like so:
Here you see how the background was previously set to red but you override that with a custom field that states it should be orange and with a beautifool border.
And if you want all tags to automatically not have a background colour and instead one-and-the-same border instead, then it should be simple to do so with a stylesheet. But I’m guessing already realized this and you want differently coloured borders, right?
@telumire - I read again your original post! It seems you do not want the background color and instead you want the tag color set by color field as border color! Am I right?
Oh wow, nice trick ! Thanks a lot @twMat ! This produce a color next to the title but it should be possible to get ride of this with CSS. That’s right, the goal here was to set different border color for multiple tags
With this trick I can use transparent;border:1px solid red;color:currentColor!important in the color field to get a transparent tag pill with a border color without need for more css. Neat !
@Mohammad the issue I was pointing out here is that I though there was no way to selectively customize tags pills since there is no content-based css selector (except for :empty) and the tags does not have data attributes … I was wrong thought ! By the way, your css selector is better than mine, thanks ! I tried to increase the specificity but didnt manage to make it work somehow.
@jeremyruston I already tried to use currentColor however it does not inherit color from the background and as far as I understand the color field set the background color Altough it may be possible to do this with pseudo element after/before or a colored box-shadow and a css mask, clip path or a filter to display the text underneath but I didnt managed to find how.
Sure, another field solely for the border color would work too. However, setting the default border color to the background color is great because it allows you to easily remove the fill color of a tag pill, and it doesnt require a new field. This is great for switching themes - and it still make sense because the field is called “color” and not “fill-color” or “background-color”.
You could ALSO specify another color for the border, nothing would prevent you to do that - but that’s a new feature and not a “fix”.