style.ini模板
style.ini
文件是一个ini文件,存在于每个模板目录下 1) ,用于配置和生成 CSS 样式. 它通常包含: [stylesheets] 和 [replacements] 两节, 具体描述如下:
[stylesheets]
此处定义哪些CSS文件需要被加载, 每行如下定义:
cssfile.css = mode
cssfile.css
为你实际的文件名称,mode
为mode中支持的一种输出模式.
该样式表文件通常也可以定义成.less
(See LESS).
[replacements]
DokuWiki的CSS调度程序能够自动替换模板文件style.ini
加载进来的样式表中[replacements]
这段中的占位符,这对于定义一个字体颜色方案并能够在所有文件中反复利用特别有用;
replacements可以查看 LESS变量.
颜色占位符
下面的占位符是用于插件唯一需要包含的,所有模板应该至少包含这些占位符,当然你也可以添加更多。
占位符变量 | 解释 |
---|---|
__background__ | 主体背景色 |
__background_alt__ | 备选背景色 |
__background_neu__ | 中性背景色 |
__border__ | 边框颜色 |
__text__ | 主体文本字体颜色 |
__text_alt__ | 备选文本字体颜色 |
__text_neu__ | 中性文本字体颜色 |
__highlight__ | 高亮文本字体颜色 (new since Adora Belle) |
示例
查看开始(Starter)模板文件中的预览示例style.ini
本地style.ini
你可以在style.local.ini
文件中覆盖style.ini
的值,Since Binky that file location has moved to the more farm-friendly conf/tpl/<tpl>/style.ini
(where <tpl>
needs to be substituted with the name of the template folder). (Just create it if it doesn't exist.) This prevents losing those changes after an upgrade. The file still needs to include each section (i.e. [stylesheets]
or [replacements]
) and paths are relative to the added ini file.
例如:
- conf/tpl/dokuwiki/style.ini
[stylesheets] extra.css = all [replacements] __text__ = "#000" __site_width__ = "100%"