Difference between revisions of "Template:Ribbon2"

From Geohashing
m (Less padding for mini ribbons)
(mess with style)
Line 1: Line 1:
 
{{#css:
 
{{#css:
 
.xkcd-ribbon2 {
 
.xkcd-ribbon2 {
   display: grid;
+
   display: inline-grid;
 
   padding: 5px 5px 5px 0;
 
   padding: 5px 5px 5px 0;
 
   margin: 2px 0;
 
   margin: 2px 0;
  width:max-content;
 
 
   max-width: 100%;
 
   max-width: 100%;
 
   border: 1px solid lightgray;
 
   border: 1px solid lightgray;
Line 58: Line 57:
 
}
 
}
  
}}<div class="xkcd-ribbon2 xkcd-ribbon2-theme-{{#var:ribbontheme|default}}" style="border-left-color: {{{color|#bada55}}}">
+
}}<div class="xkcd-ribbon2-wrapper">
  <div class="xkcd-ribbon2-icon">{{{iconcode|[[File:{{{icon|Landgeohash.png}}}|70px]]}}}</div>
+
  <div class="xkcd-ribbon2 xkcd-ribbon2-theme-{{#var:ribbontheme|default}}" style="border-left-color: {{{color|#bada55}}}">
  <div class="xkcd-ribbon2-achv">{{{achievement}}}</div>
+
    <div class="xkcd-ribbon2-icon">{{{iconcode|[[File:{{{icon|Landgeohash.png}}}|70px]]}}}</div>
  <div class="xkcd-ribbon2-actn">{{{action}}}</div>
+
    <div class="xkcd-ribbon2-achv">{{{achievement}}}</div>
{{#if:{{{image|}}}|<div class="xkcd-ribbon2-imag">[[File:{{{image}}}|44px]]</div>|}}
+
    <div class="xkcd-ribbon2-actn">{{{action}}}</div>
{{#if:{{{extra|}}}|<div class="xkcd-ribbon2-xtra">{{{extra}}}</div>|}}
+
    {{#if:{{{image|}}}|<div class="xkcd-ribbon2-imag">[[File:{{{image}}}|44px]]</div>|}}
</div>
+
    {{#if:{{{extra|}}}|<div class="xkcd-ribbon2-xtra">{{{extra}}}</div>|}}
 +
  </div>
 +
</div><noinclude>
 +
 
 +
== Tests ==
 +
 
 +
{{Ribbon2|achievement=foo|action=bar}}
 +
{{Ribbon2|achievement=foo|action=bar}}
 +
{{#vardefine:ribbontheme|mini}}
 +
{{Ribbon2|achievement=foo|action=bar}}
 +
{{Ribbon2|achievement=foo|action=bar}}

Revision as of 02:34, 15 February 2020

Landgeohash.png
{{{achievement}}}
{{{action}}}


Tests

Landgeohash.png
foo
bar
Landgeohash.png
foo
bar


Landgeohash.png
foo
bar
Landgeohash.png
foo
bar