Color
After extensive debugging and research, wu-ui has developed a proprietary color palette that uses a unified color scheme within each component to bring a unified and distinct visual effect to your product.
DANGER
In order to better write CSS, wuui has used the scss preprocessor. Before using wuui, please confirm that your Hbuilder X has installed the scss preprocessor. Generally, I believe you have already installed it. If it is not installed, please find "scss/sass compilation" and install it in Hbuilder X ->Tools ->Plugin Installation. If the installation is not effective, please restart Hbuilder X.
平台兼容性
App(vue) | App(nvue) | H5 | 小程序 | VUE2 | VUE3 |
---|---|---|---|---|---|
√ | √ | √ | √ | √ | √ |
Theme color
primary
, success
, error
, warning
, and information
are the theme colors of wu ui, which visually correspond to blue, green, red, yellow, and gray. And they also have corresponding disabled, dark, and light states, representing the corresponding prohibited, deepened, and lightened colors. For example, the button
component of wu-ui:
- When the
type
parameter is set toprimary
, the button displays in blue. - When the button is pressed, the deepened color of
primary
, also known as thedark
state, is used. - When the button is set to a hollow state (with
plain
beingtrue
), the background color becomes lighter than theprimary
color, which is also thelight
state. When the button is in a disabled state, it uses a slightly lighter color ofprimary
, which is also thedisabled
state.
Main color
Blue, as the main color tone of wu-ui, represents a distinct and positive attitude.
#2979ff
#2b85e4
#a0cfff
#ecf5ff
We provide corresponding color variable names in the global style through scss
, making it easy for you to call these variables anywhere you can write CSS, as follows:
/*The definition of variables, which has been globally introduced, does not require your writing*/
$wu-primary: #3c9cff;
$wu-warning: #f9ae3d;
$wu-success: #5ac725;
$wu-error: #f56c6c;
$wu-info: #909399;
/*Use these variables where you write CSS*/
. title{
color: $wu-primary;
}
/*The definition of variables, which has been globally introduced, does not require your writing*/
$wu-primary: #3c9cff;
$wu-warning: #f9ae3d;
$wu-success: #5ac725;
$wu-error: #f56c6c;
$wu-info: #909399;
/*Use these variables where you write CSS*/
. title{
color: $wu-primary;
}
Auxiliary color
Scene colors other than the main color need to be used in different scenarios, such as green representing success, red representing error, and yellow representing warning.
#fa3534
#dd6161
#fab6b6
#fef0f0
#ff9900
#f29100
#fcbd71
#fdf6ec
#19be6b
#18b566
#71d5a1
#dbf1e1
#909399
#82848a
#c8c9cc
#f4f4f5
We provide corresponding color variable names in the global style through scss, making it convenient for you to call these variables anywhere you can write css, as follows:
/* The definition of variables, which has been globally introduced, does not require your writing */
$wu-primary: #3c9cff;
$wu-primary-dark: #398ade;
$wu-primary-disabled: #9acafc;
$wu-primary-light: #ecf5ff;
$wu-warning: #f9ae3d;
$wu-warning-dark: #f1a532;
$wu-warning-disabled: #f9d39b;
$wu-warning-light: #fdf6ec;
$wu-success: #5ac725;
$wu-success-dark: #53c21d;
$wu-success-disabled: #a9e08f;
$wu-success-light: #f5fff0;
$wu-error: #f56c6c;
$wu-error-dark: #e45656;
$wu-error-disabled: #f7b2b2;
$wu-error-light: #fef0f0;
$wu-info: #909399;
$wu-info-dark: #767a82;
$wu-info-disabled: #c4c6c9;
$wu-info-light: #f4f4f5;
/* Use these variables where you write CSS */
.title {
color: $wu-type-info;
......
}
/* The definition of variables, which has been globally introduced, does not require your writing */
$wu-primary: #3c9cff;
$wu-primary-dark: #398ade;
$wu-primary-disabled: #9acafc;
$wu-primary-light: #ecf5ff;
$wu-warning: #f9ae3d;
$wu-warning-dark: #f1a532;
$wu-warning-disabled: #f9d39b;
$wu-warning-light: #fdf6ec;
$wu-success: #5ac725;
$wu-success-dark: #53c21d;
$wu-success-disabled: #a9e08f;
$wu-success-light: #f5fff0;
$wu-error: #f56c6c;
$wu-error-dark: #e45656;
$wu-error-disabled: #f7b2b2;
$wu-error-light: #fef0f0;
$wu-info: #909399;
$wu-info-dark: #767a82;
$wu-info-disabled: #c4c6c9;
$wu-info-light: #f4f4f5;
/* Use these variables where you write CSS */
.title {
color: $wu-type-info;
......
}
Text color
In wu-ui, four types of text colors have been extracted, namely: main text, regular text, secondary text, and placeholder text colors.
- The main text color is generally used for the title of content, such as the title of a news list
- Conventional text colors are generally used for the main body of content, such as the summary of news lists
- The secondary text color is generally used for the prompt part of the content, such as the time at the bottom of the news list and the prompt text for the number of comments
- The color of the placeholder text belongs to a lighter gray color, which can be selected according to the scene
#303133
#606266
#909399
#c0c4cc
/* The definition of variables, which has been globally introduced, does not require your writing */
$wu-main-color: #303133;
$wu-content-color: #606266;
$wu-tips-color: #909193;
$wu-light-color: #c0c4cc;
$wu-border-color: #dadbde;
$wu-bg-color: #f3f4f6;
$wu-disabled-color: #c8c9cc;
/* Use these variables where you write CSS */
.title {
color: $wu-main-color;
}
/* The definition of variables, which has been globally introduced, does not require your writing */
$wu-main-color: #303133;
$wu-content-color: #606266;
$wu-tips-color: #909193;
$wu-light-color: #c0c4cc;
$wu-border-color: #dadbde;
$wu-bg-color: #f3f4f6;
$wu-disabled-color: #c8c9cc;
/* Use these variables where you write CSS */
.title {
color: $wu-main-color;
}
Background color
In wu-ui, a background color is defined as follows:
#f3f4f6
In the global style, we provide the corresponding color variable name through scss
, which is convenient for you to call this variable anywhere you can write CSS, as follows:
/* The definition of variables, which has been globally introduced, does not require your writing */
$wu-bg-color: #f3f4f6;
/* Use these variables where you write CSS */
.title {
color: $wu-bg-color;
}
/* The definition of variables, which has been globally introduced, does not require your writing */
$wu-bg-color: #f3f4f6;
/* Use these variables where you write CSS */
.title {
color: $wu-bg-color;
}
Border Color
wu-ui has customized a border color with a value of #e4e7ed
. If you want to use it, it is as follows:
/* The definition of variables, which has been globally introduced, does not require your writing */
$wu-border-color: #e4e7ed;
/* Use these variables where you write CSS */
.item {
border: 1px solid $wu-border-color;
}
/* The definition of variables, which has been globally introduced, does not require your writing */
$wu-border-color: #e4e7ed;
/* Use these variables where you write CSS */
.item {
border: 1px solid $wu-border-color;
}