MusicFree Desktop Theme Pack Development
Core Concepts
The essence of MusicFree theme packs is CSS Custom Properties override layer.
The application has a built-in default dark theme (defined in
of
, with more than 150 CSS variables). The theme pack selectively overrides these variables through
in
to implement skin replacement. Uncovered variables automatically inherit the default dark values.
Code of Conduct
The following rules are always effective throughout the theme development process:
- Visual products cannot be previewed: AI cannot see the actual rendering effect of the theme, so every important decision must be confirmed with the user, do not judge whether it is "good-looking" by yourself
- Confirm before implementation: Key decisions such as color palette, variable coverage range, and background style must be clearly described and approved by the user before generating code
- Explain technical terms: Users may be zero-based community contributors, all professional concepts must be explained in plain language
- Minimum coverage principle: Only cover CSS variables that need to be changed, do not cover all variables for the sake of "completeness"
- Light theme exception: Light themes must cover all Background / Fill / Text / Border variables, otherwise dark color residues will appear
- Resource volume priority: Images must be compressed (WebP is recommended), avoid unnecessary large files
Roles and Collaboration Mode
- AI (you): Provide color scheme suggestions, write CSS/HTML code, generate config.json, package the theme
- User: Provide creative direction, select solutions, install and test the theme, provide visual feedback
Difference from plugin-dev
Theme packs are visual products, unlike plugins that can verify correctness through test scripts. Therefore, this Skill adopts the cyclic mode of "AI suggestion → user judgment → iterative fine-tuning", instead of the "AI-led" mode of plugin-dev. 2-3 rounds of iteration are expected.
User Interaction Principles
- Provide 2-3 solution options each time for users to choose or mix
- Describe colors with both color values and intuitive descriptions (e.g. "rgb(52, 211, 153) — emerald green, similar to Spotify's green")
- Provide precise step-by-step instructions when user operation is required
- Ask first before acting when you are unsure of the user's intention
Workflow
1. Demand Collection → 2. Style Determination → 3. Palette Generation → 4. CSS Variable Mapping
→ 5. Enhancement Layer (Optional) → 6. Packaging and Testing → 7. Iterative Optimization
→ 8. (Optional) Submit to Theme Market
Phase 1: Demand Collection
Collect the following information (ask all at once, do not ask in multiple fragmented rounds):
Must collect:
- Theme name
- Basic direction: Dark / Light / AMOLED pure black / Other
- User's creative intention (any of the following forms is acceptable):
- Emotion/atmosphere keywords (e.g. "warm", "cyberpunk", "fresh and natural")
- Reference color values (e.g. "I want pink series")
- Reference application/website (e.g. "Similar to Spotify's dark green")
- Reference image (users post images directly)
- Fully customized detailed description
Optional collection:
- Author name
- Description
- Whether dynamic iframe background is required
- Whether there are custom image materials (e.g. background image, preview image)
Phase 2: Style Determination
Based on user input, provide 2-3 style directions in text description (no code writing at this stage).
Each direction includes:
- Brand color value + intuitive description
- Light and dark tone
- Atmosphere keywords
- Background style (solid color / gradient / image / dynamic)
The user chooses one direction, or mixes elements from multiple directions.
If the user is already very clear — for example, directly gave the color value, gave a complete description, you can skip this phase and go directly to Phase 3.
Phase 3: Palette Generation
Derive the complete palette according to the selected direction. Refer to the color paradigm in references/color-paradigms.md.
Show the derivation results to the user, grouped by category:
- Brand color (brand)
- Background color hierarchy (base → sidebar → player → surface → ...)
- Text color hierarchy (primary → secondary → muted → ...)
- Border color hierarchy
- Status color (if customization is required)
Wait for user confirmation before entering the next phase.
Phase 4: CSS Variable Mapping
Map the confirmed palette to MusicFree's semantic CSS variables.
Refer to references/css-variable-reference.md for the complete variable list and override rules.
Three-level classification of variable coverage:
| Category | Description |
|---|
| Must Cover | Variables that define the core visual identity of the theme, no coverage means no skin replacement |
| Recommended to Cover | The theme is complete after coverage; light themes will have dark residues if not covered |
| Prohibited to Cover | Structural tokens (z-index / typography / spacing / layout / control sizes / icon sizes / motion), modification will damage the layout or function |
Special Categories:
- Shadow / Blur: Stylish tokens. Flat/AMOLED themes can be set to ; glass morphism themes can increase the blur value
- Radius: Not covered by default. It can be adjusted only when the user explicitly requires extreme styles (e.g. pure angular cyberpunk), and the user should be informed that it may cause visual abnormalities of some components
- Background Image (): Belongs to the enhancement layer, decide whether to cover according to the theme style
Generate
file, the format refers to the built-in theme:
css
/*
* Theme Name
*/
:root {
/* ── Background ── */
--color-bg-base: ...;
/* ... */
/* ── Fill ── */
--color-fill-brand: ...;
/* ... */
}
Phase 5: Enhancement Layer (Optional)
According to the theme style, you can selectively add enhancement effects:
5a. Background Gradient ()
Use CSS
/
combination. It is recommended to use
color-mix(in srgb, var(--color-fill-brand) X%, transparent)
to reference the brand color to avoid hard coding.
5b. Shadow Style Adjustment
- Soft shadow (default): Keep the default value
- Hard shadow: Reduce blur-radius, increase spread
- No shadow (AMOLED/flat): All set to
5c. Custom Image Resources
If the user provides materials such as background images/preview images:
- Guide to compress images (WebP format is recommended)
- Single image ≤ 500 KB
- Reference through path in CSS (e.g. )
- is a path alias, which will be replaced with the absolute path of the theme pack directory at runtime
5d. iframe Dynamic Background
See references/iframe-guide.md for details.
Suitable scenarios: particle effects, dynamic gradient animation, etc.
Additional preparation required:
- : Dynamic background entry file
- Add
"iframe": { "app": "@/iframes/app.html" }
in config.json
- It is recommended to provide field as a loading placeholder (optional but recommended)
Phase 6: Packaging and Testing
See references/packaging-checklist.md for details.
Step Overview:
- Confirm the file structure is complete
- Generate
- Check resource volume
- Package as (ZIP format, change the extension)
- Guide users to install and test
Installation Test Guide (tell the user):
- Open MusicFree desktop version
- Enter the「Themes」page
- Click the「Install Theme Pack」button
- Select the generated file
- Click the theme card to apply
- Check whether each page is displayed normally
Phase 7: Iterative Optimization
Fine-tune according to user test feedback. Common feedback and corresponding processing:
| User Feedback | Possible Cause | Adjustment Direction |
|---|
| "The text in a certain area is unclear" | Insufficient contrast between text color and background color | Increase the brightness difference between text color and background color |
| "The button is unclear" | Insufficient contrast between brand fill color and on-brand text color | Adjust |
| "The sidebar is too dark/too bright" | is inappropriate | Adjust the brightness or transparency of this variable |
| "The whole is too dazzling" | The light theme background is too white or the brand color is too saturated | Reduce the background brightness or brand color saturation |
| "The pop-up window is not obvious" | The distinction between overlay/modal background color and main background is not enough | Adjust the transparency of |
| "The selected state cannot be seen" | brand-muted is too close to surface | Increase the transparency of |
Repackage after each modification, let the user reinstall and test.
Phase 8 (Optional): Submit to Theme Market
If the user wants to publish the theme to the MusicFree theme market:
- Fork the repository: Guide the user to Fork MusicFreeThemePacks
- Switch branches: Create a development branch based on the branch
- Create a folder: Create a theme folder under
- Naming rules: Only letters, numbers, hyphens (), and underscores () are allowed
- Add tags: Add field in config.json (1-5 tags, selected from the predefined list)
- Do not add the field in config.json (ID is automatically managed by the system)
- Dynamic themes must include the tag
- Local verification:
bash
npm install
npm run validate:theme your-theme-name
- Submit PR: Submit a Pull Request to the branch
Predefined Tag List:
| key | label | Description |
|---|
| 暗色 | Dark color / dark style |
| 亮色 | Light color / bright style |
| 渐变 | Gradient background |
| 简约 | Simple style |
| 动漫 | Anime / two-dimensional style |
| 风景 | Natural landscape background |
| 插画 | Illustration style background |
| 赛博 | Cyberpunk / sense of technology |
| 像素 | Pixel style |
| 抽象 | Abstract art style |
| 动态 | Contains animation effects (must be added if there is an iframe) |
| 可爱 | Cute / moe style |
| 游戏 | Game related |
| 影视 | Movie / animated movie related |
| 季节 | Season related |
| 自然 | Natural elements such as flowers, cherry blossoms, starry sky, etc. |
Theme Pack File Structure
my-theme/
├── config.json # Required — Theme meta information
├── index.css # Required — CSS variable override
├── imgs/ # Optional — Image resources
│ ├── preview.webp # Preview image (WebP recommended)
│ └── ...
└── iframes/ # Only required for dynamic themes
├── app.html # Dynamic background entry
└── ...
config.json Field Description
jsonc
{
"name": "Theme Name", // Required
"preview": "@/imgs/preview.webp", // Recommended — Image path or "#hex" color value
"description": "Theme Description", // Recommended
"author": "Author", // Recommended
"authorUrl": "https://...", // Optional
"version": "0.0.1", // Recommended — Must be incremented when updating
"tags": ["暗色"], // Required when submitting to the theme market, 1-5
"blurHash": "...", // Recommended when there is an iframe (loading placeholder)
"iframe": { // Only for dynamic themes
"app": "@/iframes/app.html"
}
}
Note:
- can be an image path (e.g. ) or a CSS color value (e.g. )
- can be omitted in the local development phase, and supplemented when submitting to the theme market
- Do not add the field manually, it is automatically managed by the theme market system
Path Alias
in CSS and config.json is a path alias pointing to the root directory of the theme pack. It will be replaced with the
absolute path at runtime.
For example:
- →
file:///C:/Users/.../themes/my-theme/imgs/bg.webp
- can reference local images in CSS
Resource Limits
| Constraint Item | Limit |
|---|
| Single image | ≤ 500 KB |
| Single video | ≤ 5 MB |
| Entire theme pack | ≤ 10 MB |
Optimization Suggestions:
- Prioritize using WebP format (25-35% smaller than PNG/JPG)
- Compress images with tools such as TinyPNG
- Prioritize using CSS gradients instead of image textures
- Try to use lower resolution or frame rate for videos