webhubworks/mvb-design-system 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

webhubworks/mvb-design-system

Composer 安装命令:

composer require webhubworks/mvb-design-system

包简介

MVB Design System for Craft CMS

README 文档

README

This is a Storybook based design system packaged as a Craft CMS module for integrating with any Craft CMS project. Built on:

  • Twig 3
  • Vanilla JS
  • Tailwind CSS 4
  • Vite 5

With this module you can:

  • Use the MVB Design System components in your Craft CMS templates.
  • Use the provided Vite build script (You don't need to set up a build script yourself).
  • Use the provided Storybook for discovering and testing the components.

Setup

Install the Craft module

composer require webhubworks/mvb-design-system
# or
ddev composer require webhubworks/mvb-design-system

Load the module

// config/app.php

'modules' => [
    // other modules...
    'mvbdesignsystem' => [
        'class' => \webhubworks\mvbdesignsystem\MvbDesignSystem::class
    ]
],
// ...
'bootstrap' => ['mvbdesignsystem']

Enable Vite and Freeform

craft plugin/enable vite
craft plugin/enable freeform

Add the Craft Vite plugin config

Copy the Craft Vite plugin config with this command:

cp vendor/webhubworks/mvb-design-system/stubs/vite.php ./config/vite.php

Add your theme.css

Copy the default theme.css file from the webhubworks/mvb-design-system module to the root directory of your Craft CMS project. This file is required to define your primary color and can be used to override the default styles of the design system.

cp vendor/webhubworks/mvb-design-system/stubs/theme.css ./theme.css

Required env variables

Make sure that your .env file contains the following variables:

CRAFT_ENVIRONMENT
PRIMARY_SITE_URL

Untrack dist files in .gitignore

/web/dist/**/*

Usage

Include the design system in your templates

{# In the <head> of your layout template #}
{{ craft.vite.script('js/app.js', false) }}

Render your first component

{{ render('atoms.button', {
    label: 'Click me',
}) }}

Build for production

There are two CLI commands ready to build the project for production:

# use this to build the assets of the design system and your own templates
craft mvbdesignsystem/vite/build

# use this to build the storybook for static hosting
craft mvbdesignsystem/storybook/build

Develop

Configure DDEV & Change Node Version

The dev servers run within DDEV, so you need to ensure that your DDEV project is set up correctly. Make sure you have the following in your .ddev/config.yaml:

# ...
nodejs_version: 22
web_extra_exposed_ports:
  - name: node-vite
    container_port: 5173
    http_port: 5172
    https_port: 5173
  - name: storybook
    container_port: 6006
    http_port: 6005
    https_port: 6006
# ...

Run dev servers

To develop the design system, you can use the following command, which you typically run at the same time in two terminal windows:

Note: These commands must be run from within the DDEV container, not from the host.

# use this to start the development server for the design system: watches and builds the components
ddev exec craft mvbdesignsystem/vite/dev

# use this to start the storybook for the design system: provides the Storybook UI
ddev exec craft mvbdesignsystem/storybook/dev

Note

If you run the designystem for the first time, go to vendor/webhubworks/mvb-design-system and run nvm install.

Fix icon classes

All projects use prefixed Font Awesome icon classes. To make them compatible with the new Icons Atom, we’ve added a command that handles the necessary adjustments. After using the command, all "icon fields" needs to be converted to native icon fields via the CP:

craft mvbdesignsystem/fix-icons

webhubworks/mvb-design-system 适用场景与选型建议

webhubworks/mvb-design-system 是一款 基于 CSS 开发的 Composer 扩展包,目前已累计 458 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 06 月 11 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 webhubworks/mvb-design-system 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 webhubworks/mvb-design-system 我们能提供哪些服务?
定制开发 / 二次开发

基于 webhubworks/mvb-design-system 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 458
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 11
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: CSS

其他信息

  • 授权协议: proprietary
  • 更新时间: 2025-06-11