User:C.Ezra.M/Template:Tt

From Bulbapedia, the community-driven Pokémon encyclopedia.
Jump to navigationJump to search
Bulbapedia bulb.png This template is intended to be moved into one of Bulbapedia's main content spaces.
Be mindful that it is still part of a personal userspace. Any content changes should be brought up on the talk page for this template.

{{{1}}}{{{2}}}

Notes

Before mainspacing it, consider it requires a custom CSS, which is best possible with the TemplateStyles extension, which is not on Bulbapedia yet. TemplateStyles can reduce load in some cases, as the sitewide CSS is not always loaded for templates that are not used on the page.

This version of the "tt" template has several advantages over the old one:

  • Support for mobile devices. (On them, a single tap is needed to show the tooltip. To hide it, one must tap once somewhere else.)
  • Now supports wikitext for the second parameter, not just plain text. The ASCII quote mark (") is also supported.

Because of the way it works, display is set to inline-block. If it were inline, then there would be a line break-related quirk when it comes to positioning the tooltip, and it's not really apparent in Gecko. I actually don't care anymore, except that the text in a different line is placed where the element begins. It's impossible to fix unless JavaScript is in the mix. If you find the solution, notify me on my talk page.

The CSS is located at User:C.Ezra.M/tooltip.css. To test it, copy-paste @import url(//bulbapedia.bulbagarden.net/w/index.php?title=User:C.Ezra.M/tooltip.css&action=raw&ctype=text/css); to your custom CSS. If you want to test how different CSS formatting would look like, put selectors AFTER the @import rule.