Top Related Projects
A lightweight and modular front-end framework for developing fast and powerful web interfaces
A utility-first CSS framework for rapid UI development.
Modern CSS framework based on Flexbox
Materialize, a CSS Framework based on Material Design
The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.
A minimalist CSS framework.
Quick Overview
ColorUI CSS is a lightweight, flexible CSS framework designed for rapid UI development. It offers a wide range of pre-designed components and utility classes, making it easy to create visually appealing and responsive interfaces without writing extensive custom CSS.
Pros
- Lightweight and fast-loading, improving overall performance
- Extensive collection of pre-designed components and utility classes
- Easy to customize and extend
- Suitable for both small and large-scale projects
Cons
- Limited documentation, which may pose challenges for beginners
- Less popular compared to other CSS frameworks, resulting in a smaller community and fewer resources
- Some components may require additional JavaScript for full functionality
Code Examples
- Creating a button with ColorUI CSS:
<button class="cu-btn bg-blue shadow">Click me</button>
- Implementing a card component:
<div class="cu-card case">
<div class="cu-item shadow">
<div class="image">
<img src="https://example.com/image.jpg" mode="widthFix">
</div>
<div class="cu-list menu-avatar">
<div class="cu-item">
<div class="content flex-sub">
<div class="text-grey">Card Title</div>
<div class="text-gray text-sm flex justify-between">
Card description goes here
</div>
</div>
</div>
</div>
</div>
</div>
- Creating a responsive grid layout:
<div class="cu-row">
<div class="cu-col-xs-12 cu-col-sm-6 cu-col-md-4">
Column 1
</div>
<div class="cu-col-xs-12 cu-col-sm-6 cu-col-md-4">
Column 2
</div>
<div class="cu-col-xs-12 cu-col-sm-12 cu-col-md-4">
Column 3
</div>
</div>
Getting Started
To start using ColorUI CSS in your project, follow these steps:
- Download the ColorUI CSS files from the GitHub repository.
- Include the CSS file in your HTML:
<link rel="stylesheet" href="path/to/colorui.css">
- Start using ColorUI classes in your HTML elements:
<div class="cu-bar bg-white">
<div class="content">ColorUI Header</div>
</div>
<div class="cu-card">
<div class="cu-item bg-cyan shadow">
<div class="cardTitle">
Card Title
</div>
<div class="content">
Card content goes here
</div>
</div>
</div>
For more advanced usage and customization, refer to the documentation and examples provided in the GitHub repository.
Competitor Comparisons
A lightweight and modular front-end framework for developing fast and powerful web interfaces
Pros of UIkit
- More comprehensive and feature-rich UI framework
- Extensive documentation and community support
- Responsive grid system and flexible layout options
Cons of UIkit
- Larger file size and potentially slower load times
- Steeper learning curve due to more complex components
- Less focus on vibrant, colorful designs
Code Comparison
ColorUI CSS:
.bg-red {
background-color: #e54d42;
color: #ffffff;
}
UIkit:
<div class="uk-background-primary uk-light uk-padding">
Primary background with light text
</div>
ColorUI CSS focuses on simple, predefined color classes, while UIkit offers more structured and semantic HTML with utility classes for styling.
UIkit provides a more robust framework with advanced features like JavaScript components and a flexible grid system. It's suitable for larger, more complex projects. ColorUI CSS, on the other hand, is lighter and easier to implement, making it ideal for smaller projects or quick prototyping with a focus on colorful, modern designs.
UIkit's extensive documentation and community support make it easier to troubleshoot and extend, but it may be overkill for simple projects. ColorUI CSS offers a more straightforward approach to styling, but may require more custom code for complex layouts or interactions.
A utility-first CSS framework for rapid UI development.
Pros of Tailwind CSS
- Highly customizable with a robust configuration system
- Extensive documentation and large community support
- Utility-first approach allows for rapid development and easy maintenance
Cons of Tailwind CSS
- Steeper learning curve due to its utility-first nature
- Can lead to longer class names and potentially cluttered HTML
- Requires additional setup and build process for optimal use
Code Comparison
Tailwind CSS:
<button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
Button
</button>
ColorUI:
<button class="cu-btn bg-blue lg">
Button
</button>
Summary
Tailwind CSS offers more flexibility and customization options, making it suitable for larger projects with specific design requirements. It has a larger community and more comprehensive documentation. However, it can be more complex to set up and learn initially.
ColorUI provides a simpler, more straightforward approach with pre-designed components and a smaller footprint. It's easier to get started with but may offer less customization options compared to Tailwind CSS.
The choice between the two depends on project requirements, team expertise, and desired level of customization.
Modern CSS framework based on Flexbox
Pros of Bulma
- More comprehensive and feature-rich CSS framework
- Better documentation and community support
- Modular architecture allowing for easy customization
Cons of Bulma
- Larger file size, potentially impacting page load times
- Steeper learning curve for beginners
- Less focus on vibrant, colorful UI elements
Code Comparison
Bulma button example:
<button class="button is-primary">
Button
</button>
ColorUI button example:
<button class="cu-btn bg-blue shadow-blur round">
Button
</button>
Summary
Bulma is a more robust and widely-used CSS framework, offering a comprehensive set of components and utilities. It provides better documentation and community support, making it easier for developers to find solutions and resources. However, this comes at the cost of a larger file size and potentially slower load times.
ColorUI, on the other hand, focuses on providing a vibrant and colorful UI toolkit, which may be more suitable for projects requiring a modern and eye-catching design. It has a smaller footprint and may be easier for beginners to grasp quickly, but lacks the extensive documentation and community support that Bulma offers.
The choice between these two frameworks ultimately depends on the specific needs of your project, your design preferences, and your development experience.
Materialize, a CSS Framework based on Material Design
Pros of Materialize
- More comprehensive framework with a wider range of UI components
- Better documentation and community support
- Follows Material Design principles, offering a cohesive and modern look
Cons of Materialize
- Larger file size, potentially impacting page load times
- Less customizable out-of-the-box compared to ColorUI
- Steeper learning curve for beginners
Code Comparison
ColorUI CSS:
.bg-red {
background-color: #e54d42;
color: #ffffff;
}
Materialize:
.red {
background-color: #F44336 !important;
}
.white-text {
color: #FFFFFF !important;
}
ColorUI focuses on simplicity and ease of use, with predefined classes for quick styling. Materialize offers more granular control but requires combining multiple classes for similar effects.
Both frameworks aim to simplify UI development, but Materialize provides a more robust set of tools and follows established design guidelines. ColorUI, on the other hand, offers a lighter-weight solution with a focus on rapid prototyping and customization.
The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.
Pros of Bootstrap
- Extensive documentation and large community support
- Comprehensive set of components and utilities
- Highly customizable with Sass variables and mixins
Cons of Bootstrap
- Larger file size, potentially impacting page load times
- Steeper learning curve for advanced customization
- More opinionated design, which may require overriding styles
Code Comparison
Bootstrap:
<div class="container">
<div class="row">
<div class="col-md-6">Column 1</div>
<div class="col-md-6">Column 2</div>
</div>
</div>
ColorUI:
<view class="cu-bar bg-white">
<view class="action">
<text class="cuIcon-title text-blue"></text>Title
</view>
</view>
Bootstrap uses a grid system with classes like container
, row
, and col-*
, while ColorUI employs custom classes like cu-bar
and cuIcon-*
for layout and icons.
Bootstrap offers a more comprehensive framework with extensive JavaScript components, while ColorUI focuses on providing a lightweight CSS solution with a vibrant color palette. ColorUI is specifically designed for mobile-first development, particularly for WeChat Mini Programs, whereas Bootstrap is a more general-purpose framework suitable for various web projects.
A minimalist CSS framework.
Pros of Milligram
- Lightweight and minimalist design, with a smaller file size
- Better documentation and examples provided in the repository
- More active development and community support
Cons of Milligram
- Less extensive UI component library compared to ColorUI
- Limited color palette and customization options out of the box
- Fewer pre-built layouts and templates
Code Comparison
Milligram:
.button,
button,
input[type='button'],
input[type='reset'],
input[type='submit'] {
background-color: #9b4dca;
border: 0.1rem solid #9b4dca;
border-radius: .4rem;
color: #fff;
cursor: pointer;
}
ColorUI:
.cu-btn {
position: relative;
border: 0rpx;
display: inline-flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
padding: 0 30rpx;
font-size: 28rpx;
height: 64rpx;
line-height: 1;
text-align: center;
text-decoration: none;
overflow: visible;
margin-left: initial;
transform: translate(0rpx, 0rpx);
margin-right: initial;
}
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
V3 æµè¯çï¼https://github.com/weilanwl/coloruiBeta
ç´ æ
ColorUIå¨è¯éæ个群åå ±åå¨ç»´æ¤çç¥è¯åºï¼éé¢æä¸äºç¾¤åæ¹ç模æ¿åUIç´ æä¾å¼å使ç¨å¦ï¼ è¯é-ColorUI群èµæº
åè¨
ColorUIæ¯ä¸ä¸ªcssåºï¼ï¼ï¼å¨ä½ å¼å ¥æ ·å¼åå¯ä»¥æ ¹æ®classæ¥è°ç¨ç»ä»¶ï¼ä¸äºå«æ交äºçæä½æä¹æç®ååï¼å¯ä»¥ä¸ºä½ å¼åæä¾ä¸äºæè·¯ã
交æµ
微信群ï¼å å ¥å¾®ä¿¡ç¾¤è¯·å æ·»å å¼åè 微信ï¼å¤æ³¨UniAppæ件å¸åºãQQ群ï¼240787041 ææ«æäºç»´ç ã
使ç¨UniAppå¼å
å¼å§
ä¸è½½æºç 解åè·å¾/Colorui-UniApp
æ件夹ï¼å¤å¶ç®å½ä¸ç /colorui
æ件夹å°ä½ ç项ç®æ ¹ç®å½
App.vue
å¼å
¥å
³é®Css main.css
icon.css
<style>
@import "colorui/main.css";
@import "colorui/icon.css";
@import "app.css"; /* ä½ ç项ç®css */
....
</style>
使ç¨èªå®ä¹å¯¼èªæ
导èªæ ä½ä¸ºå¸¸ç¨ç»ä»¶æåç®åå°è£ ï¼å½ç¶ä½ ä¹å¯ä»¥ç´æ¥å¤å¶ä»£ç ç»æèªå·±ä¿®æ¹ï¼è¾¾å°ä¸ªæ§åç®çã
App.vue
è·å¾ç³»ç»ä¿¡æ¯
onLaunch: function() {
uni.getSystemInfo({
success: function(e) {
// #ifndef MP
Vue.prototype.StatusBar = e.statusBarHeight;
if (e.platform == 'android') {
Vue.prototype.CustomBar = e.statusBarHeight + 50;
} else {
Vue.prototype.CustomBar = e.statusBarHeight + 45;
};
// #endif
// #ifdef MP-WEIXIN
Vue.prototype.StatusBar = e.statusBarHeight;
let custom = wx.getMenuButtonBoundingClientRect();
Vue.prototype.Custom = custom;
Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
// #endif
// #ifdef MP-ALIPAY
Vue.prototype.StatusBar = e.statusBarHeight;
Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
// #endif
}
})
},
pages.json
é
ç½®åæ¶ç³»ç»å¯¼èªæ
"globalStyle": {
"navigationStyle": "custom"
},
å¤å¶ä»£ç ç»æå¯ä»¥ç´æ¥ä½¿ç¨ï¼æ³¨æå ¨å±åéçè·åã
使ç¨å°è£
,å¨main.js
å¼å
¥ cu-custom
ç»ä»¶ã
import cuCustom from './colorui/components/cu-custom.vue'
Vue.component('cu-custom',cuCustom)
page.vue
页é¢å¯ä»¥ç´æ¥è°ç¨äº
<cu-custom bgColor="bg-gradual-blue" :isBack="true">
<block slot="backText">è¿å</block>
<block slot="content">导èªæ </block>
</cu-custom>
åæ° | ä½ç¨ | ç±»å | é»è®¤å¼ |
---|---|---|---|
bgColor | èæ¯é¢è²ç±»å | String | '' |
isBack | æ¯å¦å¼å¯è¿å | Boolean | false |
bgImage | èæ¯å¾çè·¯å¾ | String | '' |
slotå | ä½ç¨ |
---|---|
backText | è¿åæ¶çæå |
content | ä¸é´åºå |
right | å³ä¾§åºå(å°ç¨åºç«¯å¯ä½¿ç¨èå´å¾çªï¼) |
使ç¨åçå°ç¨åºå¼å
ä»ç°æ项ç®å¼å§
ä¸è½½æºç 解åè·å¾/demo
ï¼å¤å¶ç®å½ä¸ç /colorui
æ件夹å°ä½ ç项ç®æ ¹ç®å½
App.wxss
å¼å
¥å
³é®Css main.wxss
icon.wxss
@import "colorui/main.wxss";
@import "colorui/icon.wxss";
@import "app.css"; /* ä½ ç项ç®css */
....
ä»æ°é¡¹ç®å¼å§
ä¸è½½æºç 解åè·å¾/template
ï¼å¤å¶/template
并éå½åä¸ºä½ ç项ç®ï¼å¯¼å
¥å°å°ç¨åºå¼åå·¥å
·æ¢å¯ä»¥å¼å§ä½ çæ°é¡¹ç®äº
使ç¨èªå®ä¹å¯¼èªæ
导èªæ ä½ä¸ºå¸¸ç¨ç»ä»¶æåç®åå°è£ ï¼å½ç¶ä½ ä¹å¯ä»¥ç´æ¥å¤å¶ä»£ç ç»æèªå·±ä¿®æ¹ï¼è¾¾å°ä¸ªæ§åç®çã
App.js
è·å¾ç³»ç»ä¿¡æ¯
onLaunch: function() {
wx.getSystemInfo({
success: e => {
this.globalData.StatusBar = e.statusBarHeight;
let custom = wx.getMenuButtonBoundingClientRect();
this.globalData.Custom = custom;
this.globalData.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
}
})
},
App.json
é
ç½®åæ¶ç³»ç»å¯¼èªæ ,并å
¨å±å¼å
¥ç»ä»¶
"window": {
"navigationStyle": "custom"
},
"usingComponents": {
"cu-custom":"/colorui/components/cu-custom"
}
page.wxml
页é¢å¯ä»¥ç´æ¥è°ç¨äº
<cu-custom bgColor="bg-gradual-pink" isBack="{{true}}">
<view slot="backText">è¿å</view>
<view slot="content">导èªæ </view>
</cu-custom>
åæ° | ä½ç¨ | ç±»å | é»è®¤å¼ |
---|---|---|---|
bgColor | èæ¯é¢è²ç±»å | String | '' |
isBack | æ¯å¦å¼å¯è¿å | Boolean | false |
isCustom | æ¯å¦å¼å¯å·¦ä¾§è¶å | Boolean | false |
bgImage | èæ¯å¾çè·¯å¾ | String | '' |
slotå | ä½ç¨ |
---|---|
backText | è¿åæ¶çæå |
content | ä¸é´åºå |
right | å³ä¾§åºå(å°ç¨åºç«¯å¯ä½¿ç¨èå´å¾çªï¼) |
èµèµ
License
Copyright (c) 2020-present, XiaoGang Wen
Top Related Projects
A lightweight and modular front-end framework for developing fast and powerful web interfaces
A utility-first CSS framework for rapid UI development.
Modern CSS framework based on Flexbox
Materialize, a CSS Framework based on Material Design
The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.
A minimalist CSS framework.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot