imported>DualPlay1 (from PCBA (Questions And Help)) |
imported>DualPlay1 No edit summary |
||
Line 68: | Line 68: | ||
</pre> | </pre> | ||
</div> | </div> | ||
{{#css: | |||
.example{ | |||
border: 2px solid; | |||
border-radius: 10px; | |||
padding: 10px; | |||
margin: 20px; | |||
text-align: center; | |||
} | |||
.example div { | |||
margin: auto; | |||
max-width: 100% | |||
} | |||
.example pre { | |||
border-radius: 8px; | |||
line-height: 30px; | |||
margin: 10px; | |||
text-align: start; | |||
} | |||
}} |
Revision as of 17:56, 4 December 2022
Module:Repeat contains several utilities to avoid having to repeat code in multiple templates, these are:
big
This utility adds one or several <big> tags around an element to increase its size. Its syntax only takes 2 arguments, the first is the text you want to increase the size of and the 2nd is the number of big tags to add.
Example usage:
This text is going to be big
{{#invoke:Repeat|big|This text is going to be big|5}}
This text not so much
{{#invoke:Repeat|big|This text not so much|1}}
same
This utility simply repeats a given segment of wikitext the provided times, it takes 2 arguments, the first is the text to repeat and the second is the number of times to do so
Example usage:
Hello Hello Hello Hello Hello
{{#invoke:Repeat|same|Hello |5}}
Goodbye Goodbye Goodbye Goodbye Goodbye Goodbye Goodbye Goodbye Goodbye Goodbye Goodbye Goodbye Goodbye Goodbye Goodbye Goodbye Goodbye Goodbye Goodbye Goodbye
{{#invoke:Repeat|same|Goodbye |20}}
gradient
This utility creates a linear gradient with hard cutoffs, it takes 3 or more arguments, the first is the direction towards which the gradient should be and the following arguments are the colors of the gradient.
Example usage:
<div style="background: {{#invoke:Repeat|gradient|right|#E50000|#FF8D00|#FFEE00|#008121|#004CFF|#760188}}; width:500px;height:50px;"></div>
<div style="background: {{#invoke:Repeat|gradient|bottom left|#018E71|#21CFAB|#9AE9C3|#FFFFFF|#7CAFE4|#4F47CC|#3C1379}}; width:500px;height:50px;"></div>
shadow
This utility creates a text shadow of a specific color all around the text, it takes a single argument, the color of the shadow
Example usage:
<div style="text-shadow:{{#invoke:Repeat|shadow|#F00}}">Hello, Red World!</div>
<div style="text-shadow:{{#invoke:Repeat|shadow|#7851a9}}">Hello, Royal Purple!</div>