Template:CD: Difference between revisions

From Looney Pyramid Games Wiki
Content added Content deleted
(Taking out some line breaks to fix some unintentional spacing)
(Adding vertical-align 4th parameter)
Line 1: Line 1:
<includeonly><span style='font: {{{3|2em}}}/1 "Cards-and-Dice"; color: {{{2|black}}}; white-space: nowrap; overflow: hidden; word-break: keep-all;'>{{{1}}}</span></includeonly><noinclude>
<includeonly><span style='font: {{{3|2em}}}/1 "Cards-and-Dice"; color: {{{2|black}}}; vertical-align: {{{4|unset}}}; white-space: nowrap; overflow: hidden; word-break: keep-all;'>{{{1}}}</span></includeonly><noinclude>
This template allows you to easily use the Cards and Dice font to include simple diagrams of pyramids and other components in pages.
This template allows you to easily use the Cards and Dice font to include simple diagrams of pyramids and other components in pages.


Line 47: Line 47:
|<nowiki>{{</nowiki>CD<nowiki>|</nowiki>:d20-20<nowiki>|</nowiki>navy<nowiki>|</nowiki>3em<nowiki>}}</nowiki>
|<nowiki>{{</nowiki>CD<nowiki>|</nowiki>:d20-20<nowiki>|</nowiki>navy<nowiki>|</nowiki>3em<nowiki>}}</nowiki>
|}
|}

text{{CD|:d8-3}}{{CD|:d8-3|red|2em|text-bottom}}text
</noinclude>
</noinclude>

Revision as of 19:44, 21 April 2024

This template allows you to easily use the Cards and Dice font to include simple diagrams of pyramids and other components in pages.

Usage

{{CD
| Text Cards-and-Dice format
| color
| size
}}

The only required parameter is the text; the other two are optional.

The text will be rendered with the Cards-and-Dice font, which uses ligatures starting with : to refer to the different images that are available. For instance :d20-20 will be interpreted as a "twenty-sided die, face 20". See page How to Use Cards and Dice font for more details.

The color is any CSS color, which will be applied to the pyramid. For instance, red, green, blue, #FFD22A, etc. The default if unspecified is black.

The size is a CSS font size, such as 3em to make it three times the font height of the surrounding text, or 25px to make it exactly 25 CSS pixels high. The default is 2em, which makes it twice the height of surrounding text, which is about right to be visible without affecting line spacing within text. In diagrams you may want to increase this for extra visibility.

Examples

:d4-4 :d6-6 :d6n-6
{{CD|:d4-4|coral|3em}} {{CD|:d6-6|goldenrod|3em}} {{CD|:d6n-6|gold|3em}}
:d8-8 :d10-10 :d10p-70
{{CD|:d8-8|teal|3em}} {{CD|:d10-10|seagreen|3em}} {{CD|:d10p-70|green|3em}}
:d12-12 :d20-17 :d20-20
{{CD|:d12-12|cornflowerblue|3em}} {{CD|:d20-17|royalblue|3em}} {{CD|:d20-20|navy|3em}}

text:d8-3:d8-3text