From 369ad66f953b0d46119dba6003123cd200961d51 Mon Sep 17 00:00:00 2001 From: Alexander Skvortsov Date: Wed, 14 Apr 2021 10:41:38 -0400 Subject: [PATCH] Add a short stub page for themes Start of https://github.com/flarum/docs/issues/173 --- docs/.vuepress/config/locales/en/sidebar.js | 3 ++- docs/extend/theme.md | 27 ++++++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/docs/.vuepress/config/locales/en/sidebar.js b/docs/.vuepress/config/locales/en/sidebar.js index 27f2d0ba9..ef0d86d0a 100644 --- a/docs/.vuepress/config/locales/en/sidebar.js +++ b/docs/.vuepress/config/locales/en/sidebar.js @@ -25,7 +25,8 @@ module.exports = { 'forms', 'permissions', 'settings', - 'testing' + 'testing', + 'theme' ] }, { diff --git a/docs/extend/theme.md b/docs/extend/theme.md index 1d2e85258..d1eab9559 100644 --- a/docs/extend/theme.md +++ b/docs/extend/theme.md @@ -1 +1,26 @@ -# Quick Start \ No newline at end of file +# Themes + +Flarum "themes" are just extensions. Typically, you'll want to use the `Frontend` extender to register custom LESS and JS. +Of course, you can use other extenders too: for example, you might want to support settings to allow configuring your theme. + +You can indicate that your extension is a theme by setting the "extra.flarum-extension.category" key to "theme". For example: + +```json +{ + // other fields + "extra": { + "flarum-extension": { + "category": "theme", + // other fields +} +``` + +All this will do is show your extension in the "theme" section in the admin dashboard extension list. + +## LESS Variable Customization + +You can define new LESS variables in your extension's LESS files. There currently isn't an extender to modify LESS variable values in the PHP layer, but this is planned for future releases. + +## Switching Between Themes + +Flarum doesn't currently have a comprehensive system that would support switching between themes. This is planned for future releases. \ No newline at end of file