Jump to content
Toggle menu
  • 1 articles
  • 7 files
  • 3 users
  • 102 edits
Shroudforge
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Revision as of 22:22, 4 November 2026 by Bonsaibauer (talk | contribs) (1 revision imported: Import Star Citizen Modules)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This is the documentation page for Module:ButtonLua

Documentation subpage
<details class="t-mbox t-mbox--notice navigation-not-searchable noexcerpt t-dependencies" open="no"><summary class="t-mbox__header">Technical detailswiki-tools · uses 2</summary>
Source
Synced with wiki-tools on GitHub
Used by
Unavailable: looking up the pages that use it failed on this render. Purge the page to retry.
Uses
Requires1
Styles1
</details>
{{#seo:

|type = website |description = Module:ButtonLua/doc is a template page used on the Star Citizen Wiki. Templates are pages that are embedded (transcluded) into other pages to allow for the repetition of information. |site_name = Star Citizen Wiki |locale = en-gb }}

Renders a Codex button as a link: a fake-button <span> wrapping a wikilink or external link, with optional icon, action, weight, and size variants.

Required by Module:CardLua, Module:Mainpage/Community, Module:Mainpage/Editing, Module:Entity/Infobox, Module:Company, and Module:Documentation; not invoked from templates.

For module editors

API

p.render(props) returns an HTML string with <templatestyles> for Module:ButtonLua/styles.css included.

Field Type Required Default Description
label string Yes Button text; becomes the aria-label when iconOnly is set.
link string one of link/url Wiki page, rendered as [[link|…]].
url string one of link/url External URL, rendered as [url …].
action string No default default, progressive, or destructive.
weight string No normal normal, primary, or quiet (no fill until hover).
size string No medium small, medium, or large.
icon string No Icon file name. MediaWiki disallows <img> inside <a>, so it renders as a currentColor mask instead of an <img>.
iconOnly boolean No false Hide the label; requires icon.
disabled boolean No false Disabled visual style.
class string No Extra CSS class(es) on the button.

p.main(frame) is the #invoke entry point, reading arguments via Module:Arguments.

Gotchas

  • render errors only when both link and url are absent; passing both is not rejected and renders two separate links (wikilink then external link) concatenated in the same span.
  • Codex exposes only small and medium icon sizes: a size = 'large' button still gets a medium icon.
  • The icon is a CSS mask stashed as a custom property (--t-button-icon-url) and consumed bare in styles.css, because the sanitizer rejects url(var()) inline but allows image-set() and a bare var().

Styles

A brand button opts in with class = 't-button--branded t-button--<brand>'; the brand block sets --t-button-ground (and color), and hover/active shades derive from it via color-mix. Module:ButtonLua/styles.css declares wiki-api, rsi, galactapedia/starmap (shared, same mark), verseguide, scmdb, patreon, kofi, and discord; a consumer can declare its own brand block in its own stylesheet instead of adding one here.