diff --git a/.stylelintrc.cjs b/.stylelintrc.cjs
index d531f98a..be5ecd15 100644
--- a/.stylelintrc.cjs
+++ b/.stylelintrc.cjs
@@ -27,5 +27,8 @@ module.exports = {
},
],
'media-feature-range-notation': 'prefix',
+ 'color-function-notation': 'legacy',
+ // 由于使用了Element UI组件库,修改组件样式时会出现`.tj-form-item__label``这种带有下划线的类名,stylelint就会报错。这里使用正则表达式允许选择器中出现短横线和下划线。
+ 'selector-class-pattern': '^[a-z][a-zA-Z0-9_-]+$',
},
}
diff --git a/.vscode/launch.json b/.vscode/launch.json
index 04a51fdd..38fbffcb 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -5,9 +5,9 @@
"version": "0.2.0",
"configurations": [
{
- "type": "msedge",
+ "type": "chrome",
"request": "launch",
- "name": "vuejs: edge",
+ "name": "vuejs: chrome",
"preLaunchTask": "vue: start",
"url": "http://localhost:9988",
"webRoot": "${workspaceFolder}/src"
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index 5b637d5d..5abcd3ad 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -7,7 +7,25 @@
"script": "dev",
"detail": "vite",
"isBackground": true,
- "problemMatcher": []
+ "problemMatcher": [
+ {
+ "owner": "typescript",
+ "fileLocation": "relative",
+ "pattern": {
+ "regexp": "^([^\\s].*)\\((\\d+|\\,\\d+|\\d+,\\d+,\\d+,\\d+)\\):\\s+(error|warning|info)\\s+(TS\\d+)\\s*:\\s*(.*)$",
+ "file": 1,
+ "location": 2,
+ "severity": 3,
+ "code": 4,
+ "message": 5
+ },
+ "background": {
+ "activeOnStart": true,
+ "beginsPattern": "mall-chat-web@0.0.0 dev",
+ "endsPattern": "ready in \\d+ ms"
+ }
+ }
+ ]
}
]
}
diff --git a/src/components/LoginBox/index.vue b/src/components/LoginBox/index.vue
index 61f4af79..cc998eae 100644
--- a/src/components/LoginBox/index.vue
+++ b/src/components/LoginBox/index.vue
@@ -41,7 +41,9 @@ watchEffect(() => {
-
+
扫码成功~,点击“登录”继续登录
diff --git a/src/components/LoginBox/styles.scss b/src/components/LoginBox/styles.scss
index f4fbe608..7441a66a 100644
--- a/src/components/LoginBox/styles.scss
+++ b/src/components/LoginBox/styles.scss
@@ -2,12 +2,10 @@
border-radius: 8px !important;
}
-/* stylelint-disable-next-line selector-class-pattern */
:global(.login-box-modal .el-dialog__header) {
padding: 0;
}
-/* stylelint-disable-next-line selector-class-pattern */
:global(.login-box-modal .el-dialog__headerbtn) {
z-index: 5;
}
@@ -32,7 +30,7 @@
margin-top: 12px;
margin-bottom: 16px;
font-size: 14px;
- color: rgb(0 0 0 / 45%);
+ color: var(--font-light);
}
.login-desc {
@@ -48,5 +46,5 @@
.login-desc-bold {
font-weight: bold;
- color: #2aae67;
+ color: var(--color-wechat);
}
diff --git a/src/components/RenderMsg.tsx b/src/components/RenderMsg.tsx
index 468503be..c66a9f7e 100644
--- a/src/components/RenderMsg.tsx
+++ b/src/components/RenderMsg.tsx
@@ -20,7 +20,7 @@ export default defineComponent({
result = result?.replace(
url,
`${sanitize(title as string)}`,
)
}
diff --git a/src/components/UserSettingBox/index.vue b/src/components/UserSettingBox/index.vue
index db74eb77..a370c1c8 100644
--- a/src/components/UserSettingBox/index.vue
+++ b/src/components/UserSettingBox/index.vue
@@ -109,7 +109,7 @@ const onCancelEditName = async () => {
/>
卸下 -->
-
+
diff --git a/src/components/UserSettingBox/styles.scss b/src/components/UserSettingBox/styles.scss
index 7c98ffc6..4c822038 100644
--- a/src/components/UserSettingBox/styles.scss
+++ b/src/components/UserSettingBox/styles.scss
@@ -1,4 +1,3 @@
-/* stylelint-disable selector-class-pattern */
:global(.setting-box-modal) {
border-radius: 8px !important;
}
@@ -39,7 +38,7 @@
z-index: 10;
padding: 2px;
background-color: var(--avatar-sex-bg-color);
- border: 1px solid #fff;
+ border: 1px solid var(--color-white);
border-radius: 50%;
--avatar-sex-bg-man: var(--color-primary);
@@ -91,7 +90,7 @@
align-items: center;
justify-content: center;
pointer-events: none;
- background-color: rgba($color: #000, $alpha: 20%);
+ background-color: var(--hover-bg-2);
border-radius: 50%;
opacity: 0;
}
@@ -102,7 +101,7 @@
align-items: center;
justify-content: center;
width: 30%;
- background-color: rgba($color: #000, $alpha: 20%);
+ background-color: var(--hover-bg-2);
border-radius: 50%;
&:hover {
diff --git a/src/styles/base.css b/src/styles/base.css
index 05d216e9..10426391 100644
--- a/src/styles/base.css
+++ b/src/styles/base.css
@@ -1,50 +1,52 @@
/* color palette from */
:root {
- --vt-c-white: #fff;
- --vt-c-white-soft: #f8f8f8;
- --vt-c-white-mute: #f2f2f2;
- --vt-c-black: #181818;
- --vt-c-black-soft: #222;
- --vt-c-black-mute: #282828;
- --vt-c-indigo: #2c3e50;
- --vt-c-divider-light-1: rgb(60 60 60 / 29%);
- --vt-c-divider-light-2: rgb(60 60 60 / 12%);
- --vt-c-divider-dark-1: rgb(84 84 84 / 65%);
- --vt-c-divider-dark-2: rgb(84 84 84 / 48%);
- --vt-c-text-light-1: var(--vt-c-indigo);
- --vt-c-text-light-2: rgb(60 60 60 / 66%);
- --vt-c-text-dark-1: var(--vt-c-white);
- --vt-c-text-dark-2: rgb(235 235 235 / 64%);
- --color-background: var(--vt-c-white);
- --color-background-soft: var(--vt-c-white-soft);
- --color-background-mute: var(--vt-c-white-mute);
- --color-background-black-mute: rgb(255 255 255 / 20%);
- --color-border: var(--vt-c-divider-light-2);
- --color-border-hover: var(--vt-c-divider-light-1);
- --color-heading: var(--vt-c-text-light-1);
- --color-text: var(--vt-c-text-light-1);
- --section-gap: 160px;
--color-primary: #1d90f5;
- --color-primary-hover: var(--el-color-primary);
- --color-dark-bg: #272a37;
- --color-gray-bg: #323644;
- --font-white: #fff;
+ --color-wechat: #2aae67;
+ --color-online: greenyellow;
+ --color-white: #fff;
+ --color-gold: #c59512;
+ --color-light-1: #bebebe;
+ --color-light-2: #dedfe0;
+ --color-light-3: #e9e9eb;
+ --color-light-4: #f5f5f5;
+
+ /* font */
+ --font-main: #fff;
--font-base: #333;
--font-gray: #666;
--font-light: #999;
+ --font-light-1: #eee;
+ --font-pink: #fe2c55;
+
+ /* 背景色 */
+ --background-indigo: #2c3e50;
+ --background-wrapper: #272a37;
+ --background-secondary: #323644;
+ --background-black-half: rgba(0, 0, 0, 50%);
+ --background-dark: rgba(39, 42, 55, 40%);
+ --background-mask: rgba(255, 255, 255, 20%);
+ --background-1: #2b2d31;
+ --background-2: #383c4b;
+ --background-3: #424656;
+ --background-4: #efe2bb;
+
+ /* hover */
+ --hover-primary: #2287e1;
+ --hover-bg-1: #484d5f;
+ --hover-bg-2: rgba(0, 0, 0, 20%);
+
+ /* border */
+ --border-base: var(--color-background-1);
+ --border-pink: #b52c47;
}
-@media (prefers-color-scheme: dark) {
+/* @media (prefers-color-scheme: dark) {
:root {
- --color-background: var(--vt-c-black);
- --color-background-soft: var(--vt-c-black-soft);
- --color-background-mute: var(--vt-c-black-mute);
- --color-border: var(--vt-c-divider-dark-2);
- --color-border-hover: var(--vt-c-divider-dark-1);
- --color-heading: var(--vt-c-text-dark-1);
- --color-text: var(--vt-c-text-dark-2);
+ --background-wrapper: var(--color-light-4);
+ --background-secondary: var(--color-light-3);
+ --font-main: var(--font-base);
}
-}
+} */
*,
*::before,
@@ -62,7 +64,6 @@ body {
Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 15px;
line-height: 1.5;
- color: var(--color-text);
background: var(--color-background);
transition: color 0.5s, background-color 0.5s;
text-rendering: optimizelegibility;
@@ -72,7 +73,7 @@ body {
a:link,
a:visited {
- color: #fff;
+ color: var(--color-white);
text-decoration: none;
cursor: pointer;
transition: color 0.3s ease;
diff --git a/src/styles/main.css b/src/styles/main.css
index 881df16d..d85f5448 100644
--- a/src/styles/main.css
+++ b/src/styles/main.css
@@ -2,16 +2,12 @@
#app {
min-height: 100vh;
-
- /* margin: 0 auto; */
font-weight: normal;
}
/* width */
::-webkit-scrollbar {
width: 4px;
-
- /* background-color: transparent; */
}
/* Track */
@@ -21,23 +17,15 @@
/* Handle */
::-webkit-scrollbar-thumb {
- background: #666;
+ background-color: var(--font-gray);
border-radius: 2px;
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
- background: #555;
+ background: var(--hover-bg-1);
}
-/*
-a,
-.green {
- text-decoration: none;
- color: hsla(160, 100%, 37%, 1);
- transition: 0.4s;
-} */
-
[hidden] {
display: none !important;
}
diff --git a/src/views/Home/components/ChatBox/index.vue b/src/views/Home/components/ChatBox/index.vue
index 7a30df4e..fc75de3d 100644
--- a/src/views/Home/components/ChatBox/index.vue
+++ b/src/views/Home/components/ChatBox/index.vue
@@ -94,7 +94,7 @@ const insertText = (emoji: string) => {
-
+
diff --git a/src/views/Home/components/ChatBox/styles.scss b/src/views/Home/components/ChatBox/styles.scss
index c594cae7..19876c76 100644
--- a/src/views/Home/components/ChatBox/styles.scss
+++ b/src/views/Home/components/ChatBox/styles.scss
@@ -1,4 +1,3 @@
-/* stylelint-disable selector-class-pattern */
.chat-box {
display: flex;
flex: 1;
@@ -20,7 +19,7 @@
flex: 1;
flex-direction: column;
height: 100%;
- background-color: var(--color-gray-bg);
+ background-color: var(--background-secondary);
border-radius: 8px;
}
@@ -39,7 +38,7 @@
color: var(--font-light);
word-wrap: break-all;
white-space: pre-wrap;
- background-color: #424656;
+ background-color: var(--background-3);
border-radius: 8px;
}
@@ -57,7 +56,7 @@
border-radius: 4px;
&:hover {
- background-color: var(--color-gray-bg);
+ background-color: var(--background-secondary);
}
}
@@ -95,16 +94,16 @@
width: 100%;
padding: 10px;
font-size: 14px;
- color: #fff;
+ color: var(--font-main);
resize: none;
- background-color: #424656;
+ background-color: var(--background-3);
border: none;
border-radius: 16px;
box-shadow: none;
transition: 0.2s;
&:focus {
- outline: 2px solid #2287e1;
+ outline: 2px solid var(--hover-primary);
}
}
}
@@ -120,16 +119,16 @@
padding: 0;
padding-top: 4px;
font-size: 24px;
- color: #fff;
+ color: var(--font-main);
cursor: pointer;
background-color: var(--color-primary);
border: 0;
border-radius: 12px;
- box-shadow: 0 0 5px 0 #08f;
+ box-shadow: 0 0 5px 0 var(--hover-primary);
transition: 0.3s;
&:hover {
- box-shadow: 0 0 10px 0 #08f;
+ box-shadow: 0 0 10px 0 var(--hover-primary);
}
&:disabled {
@@ -159,7 +158,7 @@
border-radius: 4px;
&:hover {
- background-color: #424656;
+ background-color: var(--background-3);
}
}
diff --git a/src/views/Home/components/ChatList/ContextMenu/styles.scss b/src/views/Home/components/ChatList/ContextMenu/styles.scss
index 321c0b79..8642a8c6 100644
--- a/src/views/Home/components/ChatList/ContextMenu/styles.scss
+++ b/src/views/Home/components/ChatList/ContextMenu/styles.scss
@@ -1,11 +1,11 @@
.mx-context-menu {
padding: 6px;
- background-color: #424656; // #292929
+ background-color: var(--background-3);
border-radius: 6px;
.mx-context-menu-item {
padding: 2px 4px;
- color: #e1e1e1;
+ color: var(--font-light-1);
border-radius: 4px;
.label {
@@ -15,7 +15,7 @@
}
.mx-context-menu-item:hover {
- background-color: #383c4b;
+ background-color: var(--background-2);
}
.mx-icon-placeholder {
@@ -29,10 +29,10 @@
}
.mx-context-menu-item-sperator {
- background-color: #424656;
+ background-color: var(--background-3);
}
.mx-context-menu-item-sperator::after {
- background-color: #383c4b;
+ background-color: var(--background-3);
}
}
diff --git a/src/views/Home/components/ChatList/MsgItem/index.vue b/src/views/Home/components/ChatList/MsgItem/index.vue
index 30721a69..128a343d 100644
--- a/src/views/Home/components/ChatList/MsgItem/index.vue
+++ b/src/views/Home/components/ChatList/MsgItem/index.vue
@@ -219,8 +219,8 @@ onMounted(() => {
z-index: 3;
padding: 0;
line-height: 12px;
- color: #fff;
- background-color: #383c4b !important;
+ color: var(--font-main);
+ background-color: var(--background-2) !important;
border: none !important;
}
diff --git a/src/views/Home/components/ChatList/MsgItem/styles.scss b/src/views/Home/components/ChatList/MsgItem/styles.scss
index 406c2121..fd8a6a2a 100644
--- a/src/views/Home/components/ChatList/MsgItem/styles.scss
+++ b/src/views/Home/components/ChatList/MsgItem/styles.scss
@@ -29,7 +29,7 @@
align-items: center;
margin-bottom: 8px;
font-size: 12px;
- color: #999;
+ color: var(--font-light);
white-space: nowrap;
.user-name:hover {
@@ -62,10 +62,10 @@
padding: 8px 12px;
font-size: 15px;
line-height: 22px;
- color: #fff;
+ color: var(--font-main);
word-break: break-word;
white-space: pre-line;
- background-color: #383c4b;
+ background-color: var(--background-2);
border-radius: 2px 18px 18px;
}
@@ -89,7 +89,7 @@
font-size: 12px;
color: var(--font-light);
word-break: break-all;
- background-color: #424656;
+ background-color: var(--background-3);
border-radius: 8px;
&.pointer {
@@ -115,8 +115,8 @@
padding: 0 6px;
margin-right: 4px;
cursor: pointer;
- background-color: #2b2d31;
- border: 1px solid #2b2d31;
+ background-color: var(--border-1);
+ border: 1px solid var(--border-base);
border-radius: 8px;
svg {
@@ -143,12 +143,12 @@
.active {
&.like {
- color: #fe2c55;
- border-color: #b52c47;
+ color: var(--font-pink);
+ border-color: var(--border-pink);
}
&.dlike {
- color: #989898;
+ color: var(--font-light);
border-color: var(--el-color-info);
}
}
diff --git a/src/views/Home/components/ChatList/MsgOption/styles.scss b/src/views/Home/components/ChatList/MsgOption/styles.scss
index 061d5867..172dd58e 100644
--- a/src/views/Home/components/ChatList/MsgOption/styles.scss
+++ b/src/views/Home/components/ChatList/MsgOption/styles.scss
@@ -13,19 +13,19 @@
}
&-item:hover {
- background-color: rgba($color: #272a37, $alpha: 40%);
+ background-color: var(--background-dark);
}
.icon {
display: inline-block;
width: 18px;
height: 18px;
- color: #fff;
+ color: var(--font-main);
border-radius: 50%;
}
.icon:hover {
- color: #165dff;
+ color: var(--color-primary);
}
.more,
@@ -35,10 +35,10 @@
}
.like-active {
- color: #fe2c55;
+ color: var(--font-pink);
}
.dislike-active {
- color: #bebebe;
+ color: var(--color-light-1);
}
}
diff --git a/src/views/Home/components/ChatList/styles.scss b/src/views/Home/components/ChatList/styles.scss
index ebe7fd3b..b1ea8def 100644
--- a/src/views/Home/components/ChatList/styles.scss
+++ b/src/views/Home/components/ChatList/styles.scss
@@ -23,8 +23,8 @@
width: 100%;
padding: 16px 0;
font-size: 14px;
- color: #eee;
- background: linear-gradient(180deg, rgb(50 54 68 / 100%) 0%, rgb(50 54 68 / 0%) 85%);
+ color: var(--font-light-1);
+ background: linear-gradient(180deg, rgb(50, 54, 68) 0%, transparent 85%);
svg {
@keyframes rotate {
@@ -63,7 +63,8 @@
font-size: 14px;
color: var(--el-color-primary-light-3);
cursor: pointer;
- background-color: var(--color-dark-bg);
+ background-color: var(--background-secondary);
+ border: 1px solid var(--color-white);
border-radius: 12px;
box-shadow: 0 0 1px 1px var(--el-box-shadow-dark);
diff --git a/src/views/Home/components/SideBar/styles.scss b/src/views/Home/components/SideBar/styles.scss
index 922af565..a45be3d6 100644
--- a/src/views/Home/components/SideBar/styles.scss
+++ b/src/views/Home/components/SideBar/styles.scss
@@ -12,9 +12,9 @@
width: 280px;
height: 60px;
padding: 12px 10px;
- color: var(--el-color-info-light-7);
+ color: var(--color-light-3);
cursor: pointer;
- background-color: var(--color-gray-bg);
+ background-color: var(--background-secondary);
border-radius: 8px;
.el-avatar {
@@ -35,8 +35,8 @@
margin-left: 4px;
font-size: 12px;
font-weight: bold;
- color: #c59512;
- background-color: #efe2bb;
+ color: var(--color-gold);
+ background-color: var(--background-4);
border-radius: 4px;
transform: scale(0.8);
}
@@ -58,7 +58,7 @@
}
&:hover {
- background-color: #484d5f;
+ background-color: var(--hover-bg-1);
transition: 0.3s;
}
@@ -67,7 +67,7 @@
}
&.active {
- background-color: var(--vt-c-indigo);
+ background-color: var(--background-indigo);
}
}
}
diff --git a/src/views/Home/components/ToolBar/index.vue b/src/views/Home/components/ToolBar/index.vue
index e933d507..be446a32 100644
--- a/src/views/Home/components/ToolBar/index.vue
+++ b/src/views/Home/components/ToolBar/index.vue
@@ -88,7 +88,7 @@ const toggleGroupListShow = () => (groupStore.showGroupList = !groupStore.showGr
-