Template:Button: Difference between revisions
From Space Station 14 Wiki
(added a theme option) |
(state stuff wip) |
||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly><!-- | <includeonly><!-- | ||
--><templatestyles src="Button/styles.css" /><!-- | |||
-->{{#vardefine: button_bg_clip_pixels|5}}<!-- | -->{{#vardefine: button_bg_clip_pixels|5}}<!-- | ||
--> | --><kbd class="template-button {{lc: {{{state|normal}}}}}" style=" | ||
padding: .2em calc({{#var:button_bg_clip_pixels}}px + .3em); | |||
clip-path: polygon( | |||
0 0, | |||
clip-path: polygon( | |||
0 0, | |||
calc(100% - {{#var:button_bg_clip_pixels}}px) 0, | calc(100% - {{#var:button_bg_clip_pixels}}px) 0, | ||
100% {{#var:button_bg_clip_pixels}}px, | 100% {{#var:button_bg_clip_pixels}}px, | ||
100% 100%, | 100% 100%, | ||
{{#var:button_bg_clip_pixels}}px 100%, | {{#var:button_bg_clip_pixels}}px 100%, | ||
0 calc(100% - {{#var:button_bg_clip_pixels}}px) | 0 calc(100% - {{#var:button_bg_clip_pixels}}px) | ||
); | ); | ||
">{{{1}}}</kbd></includeonly><noinclude> | ">{{{1}}}</kbd></includeonly><noinclude> | ||
{{documentation}} | {{documentation|bb= | ||
{{uses template styles}} | |||
}} | |||
[[Category: | [[Category:Button templates]] | ||
<templatedata> | <templatedata> | ||
{ | { | ||
Line 147: | Line 143: | ||
"label": "Theme", | "label": "Theme", | ||
"description": "Theme of the button. Any casing is allowed, including lowercase.", | "description": "Theme of the button. Any casing is allowed, including lowercase.", | ||
"type": "line", | |||
"suggestedvalues": [ | |||
"Regular" | |||
], | |||
"default": "Regular", | |||
"suggested": true | |||
}, | |||
"state": { | |||
"label": "State", | |||
"description": "State of the button. Any casing is allowed, including lowercase.", | |||
"type": "line", | "type": "line", | ||
"suggestedvalues": [ | "suggestedvalues": [ | ||
"Normal", | "Normal", | ||
" | "Pressed" | ||
], | ], | ||
"default": "Normal" | "default": "Normal" | ||
} | } | ||
}, | }, | ||
Line 159: | Line 164: | ||
"paramOrder": [ | "paramOrder": [ | ||
"1", | "1", | ||
"2" | "2", | ||
"state" | |||
] | ] | ||
} | } | ||
</templatedata></noinclude> | </templatedata></noinclude> |
Latest revision as of 23:14, 18 August 2024
Uses template styles
This template uses template styles found in:
Examples
{{button
↓
Server List
Theming
Not implemented yet.
Button state
Normal
The default.
Pressed
{{button
↓
EnabledFor representing a keyboard or other buttons.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Key | 1 | Select from the list, or use your own.
| Line | required |
Theme | 2 | Theme of the button. Any casing is allowed, including lowercase.
| Line | suggested |
State | state | State of the button. Any casing is allowed, including lowercase.
| Line | optional |