Starting from v15, the theme system was refactored from SCSS precompilation to CSS Variables: at runtime you only need to load
themes/{主题}/theme.cssto override color variables, with no need for sass.
When to Use
- Set the site-wide global theme
- Let users switch themes at runtime (dropdown/wall of images)
- Apply an already generated custom theme; when creating a new color scheme use fineui-custom-theme
Built-in Themes
Theme enum (use Pascal names in configuration, lowercase in F.js):
- Pure series:
Pure_Black(default),Pure_Green、Pure_Blue、Pure_Purple、Pure_Orange - jQuery UI series:
Cupertino、Start、Dark_Hive、Flick、South_Street - Also
chinese_redetc.; dark themes such asDark_Hive。
Set the Global Theme (Quick Overview)
// ① F.js —— F.init 里设初始主题(小写)
F.init({ theme: 'pure_black' });
<!-- ② Pro(WebForms)—— Web.config 的 <FineUI.Pro> 段 -->
<FineUI.Pro DebugMode="false" Theme="Pure_Black" EnableAnimation="true" />
// ③ Core(MVC / RazorForms / RazorPages 三套一致)—— appsettings.json
"FineUI": { "Theme": "Pure_Black", "EnableAnimation": true }
# ④ FineUI.Java(Spring Boot)—— application.properties 的 fineui.* 键(键名 kebab-case、主题名小写)
fineui.theme=pure_black
fineui.enable-animation=true
The Java global default is in
application.properties; for page-level/per-user switching implementFineUIPageManagerInitializerbean(pm.theme(...)), see references/set-theme.md。Theme CSS variables are fully consistent with F.js(the same set ofthemes/{主题}/theme.css)。
Reference Documentation
| File | When to Read |
|---|---|
| references/set-theme.md | Global default, PageManager override, runtime switching (Cookie + refresh) |
| references/custom-theme.md | Files, directories, and integration entry points for custom themes |
Related Skills
fineui-foundation: page skeleton (_Layout/ PageManager location)- fineui-custom-theme: create, generate, validate, and deliver custom themes
Constraints and Rules
- Theme name casing: C# configuration/enum uses
Pure_Black(Pascal + underscore); F.jsF.init({ theme: 'pure_black' })uses lowercase;Javaapplication.propertiesuses lowercasefineui.theme=pure_black(themes/directory names are lowercase, casing is insensitive). - Global default entry point: Pro goes through
Web.configof<FineUI.Pro Theme=".."/>; the three Core sets go throughappsettings.jsonof"FineUI":{"Theme":".."};Java goes throughapplication.propertiesoffineui.theme=..(fineui.*key, kebab-case)。 - There is no
F.setThemepublic method: examples commonly usewriteThemeCookie → refresh the page → the server reads the Cookie and sets PageManager. Applications need to distinguish between built-in and custom themes; the Java example's current Cookie handling only callspm.theme(...), and when using custom themes the existing initializer needs to be extended. See references/set-theme.md。 - Do not manually modify
theme.cssfor custom themes: after modifyingtheme.config, use the application'sres/themesbuilt-ingenerate-theme.mjsto generate. The public examples for Pro, Core, and Java all provide generators. Java custom themes are referenced throughpm.customTheme(...), and cannot be replaced byfineui.themeorpm.theme(...). - Dark theme:
is-dark-background = truecontrols the derived styles at generation time, is not equivalent to the client-sideF.isDarkTheme, and does not guarantee automatic addition of thef-theme-darkbgclass.
Official Resources
- Online documentation and theme preview:https://www.fineui.com/
- Application-side generation command: in the
res/themesdirectory with the generator, executenode generate-theme.mjs 主题名