打开/关闭搜索
搜索
打开/关闭菜单
1K
5.2K
4
8.2K
星砂岛百科
导航
首页
最近更改
随机页面
MediaWiki帮助
特殊页面
上传文件
打开/关闭外观设置菜单
通知
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。
user-interface-preferences
个人工具
创建账号
登录
本站正在进行早期测试,目前仍存在许多内容的缺失。
查看“︁模板:CSS/doc”︁的源代码
来自星砂岛百科
更多语言
查看
阅读
查看源代码
查看历史
associated-pages
模板
讨论
更多操作
←
模板:CSS/doc
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:已验证邮箱用户
您没有权限编辑
模板
命名空间内的页面。
您必须确认您的电子邮件地址才能编辑页面。请通过
参数设置
设置并确认您的电子邮件地址。
您可以查看和复制此页面的源代码。
== Overview == The {{tl|CSS}} template is a helper utility used to load [https://www.mediawiki.org/wiki/Help:TemplateStyles TemplateStyles] (CSS) from a specific subpage. Unlike a direct {{#tag:templatestyles}} call, this template uses the [[mw:Extension:Variables|Variables extension]] to **deduplicate** style tags. If the same stylesheet is requested multiple times on a single page, it will only be output once, preventing the accumulation of redundant `<link rel="mw-deduplicated-inline-style">` tags in the HTML source. == Usage == Insert this template at the top of a template or module page to load its associated `/styles.css` subpage. {{tl|CSS|PageName|NamespaceID}} * **1** (Optional): The base page name. Defaults to the current page name. * **2** (Optional): The Namespace ID. Defaults to 10 (Template). ** 0: Main/Root ** 4: Project (Starsand Island Wiki) ** 10: Template ** 828: Module == Technical Details == * **Deduplication Logic**: It defines a variable `ts_loaded_[path]` the first time a style is loaded. Subsequent calls to the same path are ignored. * **Dependency**: Requires the [https://www.mediawiki.org/wiki/Extension:Variables Variables] extension to be installed on the Wiki. == Examples == === Basic Usage === To load styles from the current template's `/styles.css` subpage: * {{tl|CSS}} === Specific Page === To load styles from a specific template: * {{tl|CSS|Infobox Item}} === Specific Namespace === To load styles for a module: * {{tl|CSS|Common|828}} (Loads `Module:Common/styles.css`) == TemplateData == <templatedata> { "params": { "1": { "label": "Page Name", "description": "The name of the page containing the /styles.css subpage. Defaults to the current page.", "type": "string", "suggested": true }, "2": { "label": "Namespace ID", "description": "The ID of the namespace (e.g., 10 for Template, 828 for Module). Defaults to 10.", "type": "number", "default": "10" } }, "description": "Loads TemplateStyles for a given page and namespace with automatic deduplication.", "format": "inline" } </templatedata> [[Category:Template documentation]]
该页面嵌入的页面:
模板:Tl
(
查看源代码
)
模块:ArgsUtil
(
查看源代码
)
模块:Template link
(
查看源代码
)
返回
模板:CSS/doc
。
查看“︁模板:CSS/doc”︁的源代码
来自星砂岛百科