Theme Color Variables
1. Introduction
MiniApp theme colors refer to the primary tones used in a MiniApp, mainly for background colors, text colors, button colors, etc. Theme colors change with App configuration, and support both light and dark themes. Developers do not need to worry about changes in theme colors.
2. Theme Colors
Theme color values are provided through CSS variables. Developers can use these variables in CSS, and the variable values will automatically change under different themes.
3. Theme Color Variables
4. Text Color Extensions
Under the corresponding theme color, text colors are extended into 8 types. Developers can use them as needed. The format is --app-${key}-N${level}, where level is a number from 1 to 8.
Using in Style Files
Using in Configuration
src/global.config.tsglobal configuration filesrc/routers.config.tsrouter configuration filesrc/pages/${pageId}/index.config.tspage configuration file, all can use theme color variables.
src/global.config.ts
5. Theme Color MiniApp
Scan the code to experience the theme color MiniApp: