colorffy

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Colorffy

Colorffy

Complete framework for building Vue 3 and Nuxt 3 applications with Colorffy UI (component library) and Colorffy CSS (utility framework).
借助Colorffy UI(组件库)与Colorffy CSS(工具类框架)构建Vue 3和Nuxt 3应用的完整框架。

Quick Reference Index

快速参考索引

CategoryGuideDescription
Getting StartedInstallation & SetupInstall packages, configure Vue 3/Nuxt 3
Component Selection GuideChoose the right components for your needs
Styling GuideColorffy CSS integration, custom styling approaches
ThemingTheming SystemCustomize colors, typography, spacing, dark mode
ReferenceComponents APIFull reference for 70+ components
CSS UtilitiesComplete utility class reference
Layout SystemsGrid and Flexbox layout utilities
PatternsBest PracticesCommon patterns, workflows, tips
分类指南描述
快速入门安装与配置安装包,配置Vue 3/Nuxt 3
组件选择指南根据需求选择合适的组件
样式指南Colorffy CSS集成、自定义样式方案
主题定制主题系统自定义颜色、排版、间距、深色模式
参考文档组件API70+组件完整参考
CSS工具类完整工具类参考
布局系统网格与弹性布局工具
实践模式最佳实践常见模式、工作流程、技巧

Framework Overview

框架概述

Colorffy UI (@colorffy/ui)
  • 70+ Vue 3 components (buttons, forms, cards, dialogs, navigation, tables, etc.)
  • Unstyled/headless by default - full control over styling
  • TypeScript support, tree-shakeable
  • Works with any styling approach
Colorffy CSS (@colorffy/css)
  • Expressive SCSS framework with tonal color system
  • Complete utility class library
  • Flexible grid and flexbox layouts
  • Dark mode support, customizable via SCSS variables
Key Insight: Colorffy UI components are unstyled by default. Style with Colorffy CSS, custom CSS, or any CSS framework.
Colorffy UI (@colorffy/ui)
  • 70+ Vue 3组件(按钮、表单、卡片、对话框、导航、表格等)
  • 默认无样式/无头设计,完全掌控样式
  • 支持TypeScript,可摇树优化
  • 兼容任意样式方案
Colorffy CSS (@colorffy/css)
  • 具备色调色彩系统的表现力SCSS框架
  • 完整的工具类库
  • 灵活的网格与弹性布局
  • 支持深色模式,可通过SCSS变量自定义
核心要点: Colorffy UI组件默认无样式。可使用Colorffy CSS、自定义CSS或任意CSS框架进行样式定制。

Quick Start

快速开始

Vue 3

Vue 3

bash
npm install @colorffy/ui @colorffy/css
npm install @vueuse/components floating-vue
typescript
// main.ts
import { createApp } from 'vue'
import ColorffyUI from '@colorffy/ui'
import '@colorffy/css'

const app = createApp(App)
app.use(ColorffyUI)
app.mount('#app')
bash
npm install @colorffy/ui @colorffy/css
npm install @vueuse/components floating-vue
typescript
// main.ts
import { createApp } from 'vue'
import ColorffyUI from '@colorffy/ui'
import '@colorffy/css'

const app = createApp(App)
app.use(ColorffyUI)
app.mount('#app')

Nuxt 3

Nuxt 3

typescript
// nuxt.config.ts
export default defineNuxtConfig({
  css: ['@colorffy/css']
})

// plugins/colorffy-ui.ts
export default defineNuxtPlugin((nuxtApp) => {
  nuxtApp.vueApp.use(ColorffyUI)
})
See complete installation guide →
typescript
// nuxt.config.ts
export default defineNuxtConfig({
  css: ['@colorffy/css']
})

// plugins/colorffy-ui.ts
export default defineNuxtPlugin((nuxtApp) => {
  nuxtApp.vueApp.use(ColorffyUI)
})
查看完整安装指南 →

Usage Example

使用示例

vue
<script setup lang="ts">
import { ref } from 'vue'
import { UiButton, UiCard, UiInputText, UiModal } from '@colorffy/ui'

const isOpen = ref(false)
const name = ref('')
</script>

<template>
  <!-- Components with Colorffy CSS styling -->
  <UiCard class="shadow-lg rounded-lg">
    <template #body>
      <h2 class="text-primary fw-bold mb-3">Welcome</h2>
      <UiInputText 
        v-model="name" 
        label="Name"
        placeholder="Enter your name"
        class="mb-3"
      />
      <UiButton 
        variant="filled" 
        color="primary"
        text="Open Modal"
        @click="isOpen = true"
      />
    </template>
  </UiCard>

  <UiModal v-model="isOpen" title="Hello">
    <template #body>
      <p>Hello, {{ name }}!</p>
    </template>
  </UiModal>
</template>
vue
<script setup lang="ts">
import { ref } from 'vue'
import { UiButton, UiCard, UiInputText, UiModal } from '@colorffy/ui'

const isOpen = ref(false)
const name = ref('')
</script>

<template>
  <!-- 使用Colorffy CSS样式的组件 -->
  <UiCard class="shadow-lg rounded-lg">
    <template #body>
      <h2 class="text-primary fw-bold mb-3">欢迎</h2>
      <UiInputText 
        v-model="name" 
        label="姓名"
        placeholder="请输入您的姓名"
        class="mb-3"
      />
      <UiButton 
        variant="filled" 
        color="primary"
        text="打开模态框"
        @click="isOpen = true"
      />
    </template>
  </UiCard>

  <UiModal v-model="isOpen" title="你好">
    <template #body>
      <p>你好,{{ name }}!</p>
    </template>
  </UiModal>
</template>

When to Read Each Guide

各指南适用场景

Installation & Setup - When you need to:
  • Install Colorffy in Vue 3 or Nuxt 3
  • Configure SCSS customization
  • Setup auto-imports
  • Troubleshoot installation issues
Component Selection Guide - When you need to:
  • Choose the right component for a UI pattern
  • Understand when to use one component vs another
  • Find components by use case (forms, navigation, feedback, etc.)
  • See component decision trees
Styling Guide - When you need to:
  • Understand styling approaches (Colorffy CSS, custom, hybrid)
  • Style components with Colorffy CSS utilities
  • Write custom CSS for components
  • Integrate with Tailwind, UnoCSS, or other frameworks
Theming System - When you need to:
  • Customize colors, typography, spacing
  • Setup dark mode
  • Override SCSS variables
  • Configure design tokens
Components API - When you need to:
  • Complete component API reference
  • Specific props, slots, events documentation
  • Component-specific features and options
CSS Utilities - When you need to:
  • Specific utility class names
  • Class patterns for spacing, colors, typography
  • Responsive utility variants
Layout Systems - When you need to:
  • Build responsive layouts with grid or flexbox
  • Understand column configurations
  • Create complex layouts with alignment and gap utilities
Best Practices - When you need to:
  • Common patterns (forms, modals, tables, toasts)
  • Code examples for typical use cases
  • Performance tips and anti-patterns to avoid
安装与配置 - 当你需要:
  • 在Vue 3或Nuxt 3中安装Colorffy
  • 配置SCSS自定义项
  • 设置自动导入
  • 排查安装问题
组件选择指南 - 当你需要:
  • 为UI模式选择合适的组件
  • 理解何时使用某一组件而非其他组件
  • 按使用场景查找组件(表单、导航、反馈等)
  • 查看组件决策树
样式指南 - 当你需要:
  • 理解样式方案(Colorffy CSS、自定义、混合模式)
  • 使用Colorffy CSS工具类为组件设置样式
  • 为组件编写自定义CSS
  • 与Tailwind、UnoCSS或其他框架集成
主题系统 - 当你需要:
  • 自定义颜色、排版、间距
  • 配置深色模式
  • 覆盖SCSS变量
  • 配置设计令牌
组件API - 当你需要:
  • 完整的组件API参考
  • 特定属性、插槽、事件的文档
  • 组件专属功能与选项
CSS工具类 - 当你需要:
  • 特定工具类名称
  • 间距、颜色、排版的类模式
  • 响应式工具类变体
布局系统 - 当你需要:
  • 使用网格或弹性布局构建响应式布局
  • 理解列配置
  • 借助对齐与间距工具类创建复杂布局
最佳实践 - 当你需要:
  • 常见模式(表单、模态框、表格、提示框)
  • 典型使用场景的代码示例
  • 性能技巧与需避免的反模式

Component Categories Quick Reference

组件分类快速参考

Layout: UiHeaderContent, UiPaneContent, UiCard Navigation: UiTabs, UiNavigationBar, UiDrawerLink, UiSegmentedControls Buttons: UiButton, UiButtonMenu, UiButtonToggleGroup, UiButtonTooltip Forms: UiInputText, UiInputTextarea, UiInputSelect, UiInputCheck, UiInputRadio, UiInputRange, UiInputFile Dialogs: UiModal, UiConfirmModal Feedback: UiAlert, UiAlertToast, UiLoading, UiEmpty Data: UiDatatable, UiListGroup, UiAccordion Media: UiAvatar, UiIconMaterial
See complete component list →
布局: UiHeaderContent, UiPaneContent, UiCard 导航: UiTabs, UiNavigationBar, UiDrawerLink, UiSegmentedControls 按钮: UiButton, UiButtonMenu, UiButtonToggleGroup, UiButtonTooltip 表单: UiInputText, UiInputTextarea, UiInputSelect, UiInputCheck, UiInputRadio, UiInputRange, UiInputFile 对话框: UiModal, UiConfirmModal 反馈: UiAlert, UiAlertToast, UiLoading, UiEmpty 数据: UiDatatable, UiListGroup, UiAccordion 媒体: UiAvatar, UiIconMaterial
查看完整组件列表 →

Utility Class Categories Quick Reference

工具类分类快速参考

Spacing:
m-*
,
p-*
,
gap-*
(0-5, responsive) Colors:
text-*
,
bg-*
,
border-*
(primary, success, danger, etc.) Typography:
fs-*
(100-600),
fw-*
(400-800),
text-{align}
Layout:
d-flex
,
d-grid
,
justify-content-*
,
align-items-*
Borders:
border
,
rounded-{size}
Effects:
shadow-*
,
opacity-*
,
filter-*
See complete utilities reference →
间距:
m-*
,
p-*
,
gap-*
(0-5,支持响应式) 颜色:
text-*
,
bg-*
,
border-*
(primary、success、danger等) 排版:
fs-*
(100-600),
fw-*
(400-800),
text-{align}
布局:
d-flex
,
d-grid
,
justify-content-*
,
align-items-*
边框:
border
,
rounded-{size}
效果:
shadow-*
,
opacity-*
,
filter-*
查看完整工具类参考 →

Support

支持