Topic: Coloring links in the wiki

Posted under Tag/Wiki Projects and Questions

Since I've finally drawn two pictures of Rhubarb I went ahead and wrote her page (see link), taking reference from a few others.

However, the ability to color text - which includes convenient options to auto-match tag colors - does not work on wiki links, which kind of blows.

I can't demonstrate the color in this post, because non-privileged are not able to use colored text outside of wiki pages.

Is there any way to create a link that is colored appropriately to its tag type?

Updated

Wiki colors are supposed to work for any member, however you cannot apply color to a link because the standard link color takes precedence, due to CSS rules, this could always be solved by detecting [color=...] dtext that is immediately preceding links and apply a color rule to the anchor's style attribute, but that might be a bit messy to implement if not careful.

AFAIK the only other alternative would be a new feature to allow custom colors on links, i.e. [[wiki_page|displayed name|color]]. E.g. something like [[guild_wars|GW|copyright]] would make a link colored like GW and linked as GW.

However, e621 could always always color wiki links according to their type automatically, as you mention. But I'm not sure if one always want to do this, so an alternative for custom colors would be nice either way, and an ability to blank it i.e. [[guild_wars||]] would output guild_wars with no extra color.

Updated by anonymous

Chessax said:
Wiki colors are supposed to work for any member, however you cannot apply color to a link because the standard link color takes precedence, due to CSS rules, this could always be solved by detecting [color=...] dtext that is immediately preceding links and apply a color rule to the anchor's style attribute, but that might be a bit messy to implement if not careful.

AFAIK the only other alternative would be a new feature to allow custom colors on links, i.e. [[wiki_page|displayed name|color]]. E.g. something like [[guild_wars|GW|copyright]] would make a link colored like GW and linked as GW.

However, e621 could always always color wiki links according to their type automatically, as you mention. But I'm not sure if one always want to do this, so an alternative for custom colors would be nice either way, and an ability to blank it i.e. [[guild_wars||]] would output guild_wars with no extra color.

I had tried using the colors as an alt text:

[[wishdragon|[color=species]wishdragon[/color]]]

But as I somewhat expected, this did not parse properly.

My ideal would be to follow Mediawiki's template convention, which would allow users to specify a color as an associative parameter without having to type the link name twice:

[[wishdragon|color=species]]

Alternately, the color declaration could manifest as a span, and the CSS could be adjusted so that whatever was inside of that span followed the proper coloration:

a.link{
  color: [normal color];
}



span.colorSpecies *{
  color: [species color];
  font-weight: bold;
}

Updated by anonymous

  • 1