Template:Box-shadow/doc: Difference between revisions
More actions
added doc |
m this remark is pointless; every modern browser has supported the property for years now |
||
| (9 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
{{ | {{TemplateBox | ||
<!-- | |1 = 1 | ||
|1label = X-offset | |||
|1d-en = Specify the offset of the shadow to the right of the element. Use negative value for a shadow to the left. | |||
|1aliases = <!-- List of aliases, separated by / (a slash) --> | |||
|1type = line | |||
|1def = 4px | |||
|1stat = optional | |||
|2 = 2 | |||
|2label = Y-offset | |||
|2d-en = Specify the offset of the shadow below the element. Use negative value for a shadow above. | |||
|2aliases = | |||
|2type = line | |||
|2def = 4px | |||
|2stat = optional | |||
=== | |3 = 3 | ||
|3label = blur radius | |||
|3d-en = The width of blurring added to the shadow border | |||
|3aliases = | |||
|3type = line | |||
|3def = 4px | |||
|3stat = optional | |||
|4 = 4 | |||
|4label = color | |||
|4d-en = CSS color of the shadow | |||
|4aliases = | |||
|4type = line | |||
|4def = #CCC | |||
|4stat = optional | |||
|name = box-shadow | |||
|desc = This template is a shortcut for producing shadows. It should be used in the style attribute of an HTML element (or wiki table etc.). | |||
|usage-notes = | |||
|namespace = | |||
|usergroup = | |||
|shorthand = | |||
|mustbesubst = | |||
|setscats = | |||
|placement = | |||
|example = | |||
|example-value = | |||
|relieson = | |||
|seealso = | |||
* {{tl|border-radius}} | |||
* {{tl|linear-gradient}} | |||
* {{tl|radial-gradient}} | |||
|print = | |||
|type = | |||
|i18n-method = - | |||
|i18n-desc = | |||
|i18n-subpage = | |||
|i18n-mediawiki-msg = | |||
|useTemplateData = only | |||
}} | |||
== Example == | |||
* <code><div style="background-color: #FFFFDD; border: 1px solid #808000; padding: 5px; '''<nowiki>{{box-shadow}}</nowiki>'''">Lorem ipsum...</div></code> will produce a box with the default border shadow: | |||
* < | |||
<div style="background-color: #FFFFDD; border: 1px solid #808000; padding: 5px; {{box-shadow}}">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div> | <div style="background-color: #FFFFDD; border: 1px solid #808000; padding: 5px; {{box-shadow}}">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div> | ||
* < | * <code><div style="background-color: #FFFFDD; border: 1px solid #808000; padding: 5px; '''<nowiki>{{box-shadow|4px|4px|8px|#A0A080}}</nowiki>'''">Lorem ipsum...</div></code> will produce a more pronounced and colored shadow: | ||
<div style="background-color: #FFFFDD; border: 1px solid #808000; padding: 5px; {{box-shadow|4px|4px|8px|#A0A080}}">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div> | <div style="background-color: #FFFFDD; border: 1px solid #808000; padding: 5px; {{box-shadow|4px|4px|8px|#A0A080}}">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div> | ||
<includeonly> | <includeonly> | ||
<!-- CATEGORIES | <!-- CATEGORIES HERE, THANKS --> | ||
[[Category:Cross-browser compatibility templates]] | [[Category:Cross-browser compatibility templates]] | ||
</includeonly> | </includeonly> | ||
Latest revision as of 16:58, 1 August 2022
This template is a shortcut for producing shadows. It should be used in the style attribute of an HTML element (or wiki table etc.).
Usage
{{box-shadow |1= |2= |3= |4= }}
Template parameters
- TemplateData
TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard.
Existing template documentation
At Wikimedia Commons, it is recommended to use {{TemplateBox}} with either useTemplateData=1 or useTemplateData=only on the /doc subpage and transcluding it with {{Documentation}} into the template. <nowiki>-tags can be wrapped around the arguments, if required, to avoid templates being expanded.
Newly created template documentation and imports
Another option, especially for imported templates, or for users with JSON experience, is placing raw <templatedata>-tags into the Wikitext of the template, as described in various Wikipediae.
Wikipedia's help about TemplateData • Commons-specific information
This template is a shortcut for producing shadows. It should be used in the style attribute of an HTML element (or wiki table etc.).
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| X-offset | 1 | Specify the offset of the shadow to the right of the element. Use negative value for a shadow to the left.
| Line | optional |
| Y-offset | 2 | Specify the offset of the shadow below the element. Use negative value for a shadow above.
| Line | optional |
| blur radius | 3 | The width of blurring added to the shadow border
| Line | optional |
| color | 4 | CSS color of the shadow
| Line | optional |
Additional information
The template is intended to be used in the following namespaces: no namespace specified
The template is intended to be used by the following user groups: no user group specified
See also
Localization
This template is not intended to be localized.
Example
<div style="background-color: #FFFFDD; border: 1px solid #808000; padding: 5px; {{box-shadow}}">Lorem ipsum...</div>will produce a box with the default border shadow:
<div style="background-color: #FFFFDD; border: 1px solid #808000; padding: 5px; {{box-shadow|4px|4px|8px|#A0A080}}">Lorem ipsum...</div>will produce a more pronounced and colored shadow: