Skip to content

Commit

Permalink
Add dark mode support (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
AceDataCloud committed Apr 4, 2024
1 parent ddef4ce commit b8970e1
Show file tree
Hide file tree
Showing 46 changed files with 247 additions and 166 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "add dark mode support",
"packageName": "@acedatacloud/hub",
"email": "cqc@cuiqingcai.com",
"dependentChangeType": "patch"
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"uuid": "^8.3.2",
"vue": "^3.2.6",
"vue-codemirror": "^6.1.1",
"vue-dark-switch": "^1.0.6",
"vue-i18n": "^9.1.7",
"vue-qrcode": "^2.2.0",
"vue-router": "^4.0.11",
Expand Down
12 changes: 12 additions & 0 deletions src/assets/scss/_common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ body {
overflow: hidden;
}

html,
html.dark,
:root {
--el-color-primary: #277186;
--el-color-primary-light-3: #689caa;
--el-color-primary-light-5: #93b8c3;
--el-color-primary-light-7: #bed4db;
--el-color-primary-light-8: #d4e3e7;
--el-color-primary-light-9: #e9f1f3;
--el-color-primary-dark-2: #1f5a6b;
}

* {
box-sizing: border-box;
}
Expand Down
12 changes: 1 addition & 11 deletions src/assets/scss/_element.scss
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
@forward 'element-plus/theme-chalk/src/common/var.scss' with (
$colors: (
'primary': (
'base': #277186
),
'danger': (
'base': #ec4450
)
)
);

$--font-path: 'element-plus/theme-chalk/src/fonts';

@import 'element-plus/theme-chalk/src/index.scss';
@import 'element-plus/theme-chalk/dark/css-vars.css';
1 change: 0 additions & 1 deletion src/components/application/Status.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ export default defineComponent({
.info {
font-size: 14px;
color: var(--el-text-color-regular);
// display: inline-block;
text-align: center;
}
.actions {
Expand Down
2 changes: 1 addition & 1 deletion src/components/chat/AnsweringMark.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default defineComponent({
width: 2px;
height: 16px;
margin-top: 3px;
background-color: var(--el-color-black);
background-color: var(--el-text-color-primary);
animation: blink 1s infinite;
}
</style>
13 changes: 7 additions & 6 deletions src/components/chat/InputBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
</span>
<el-input
v-model="questionValue"
:rows="3"
:disabled="disabled"
class="input"
type="textarea"
Expand Down Expand Up @@ -143,6 +142,8 @@ export default defineComponent({
position: relative;
.input {
textarea {
height: auto;
max-height: 100px;
border: none;
background: none;
box-shadow: none;
Expand All @@ -165,7 +166,7 @@ export default defineComponent({
<style lang="scss" scoped>
.input-box {
width: 100%;
border: 1px solid #eee;
border: 1px solid var(--el-border-color);
border-radius: 10px;
background: none;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.1);
Expand All @@ -175,7 +176,7 @@ export default defineComponent({
.btn-upload {
cursor: not-allowed;
.icon-attachment {
color: #eee;
color: var(--el-text-color-disabled);
}
}
}
Expand All @@ -195,20 +196,20 @@ export default defineComponent({
left: 10px;
.icon-attachment {
font-size: 14px;
color: #666;
color: var(--el-text-color-primary);
}
}
&.btn-send {
right: 15px;
&.disabled {
.icon-send {
color: #eee;
color: var(--el-text-color-disabled);
}
cursor: not-allowed;
}
.icon-send {
font-size: 16px;
color: #666;
color: var(--el-text-color-primary);
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/components/chat/IntroductionItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ export default defineComponent({
<style lang="scss" scoped>
.introduction-item {
font-size: 14px;
background-color: #eee;
color: #333;
background-color: var(--el-fill-color-extra-light);
color: var(--el-text-color-primary);
border: 1px solid var(--el-border-color-lighter);
padding: 10px 20px;
border-radius: 20px;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/chat/Message.vue
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export default defineComponent({
align-items: start;
.content {
background-color: var(--el-bg-color-page);
color: var(--el-color-black);
color: var(--el-text-color-primary);
border-bottom-left-radius: 0;
}
}
Expand Down
17 changes: 8 additions & 9 deletions src/components/chat/ModelSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,23 +130,21 @@ export default defineComponent({

<style lang="scss" scoped>
.model-selector {
background-color: #ececf1;
background-color: var(--el-bg-color-page);
padding: 7px 6px;
border-radius: 15px;
margin-bottom: 5px;
.group {
padding: 20px 30px;
color: black;
color: var(--el-text-color-primary);
border: none;
border-radius: 10px;
margin: 0 3px;
background-color: inherit;
&:hover,
&:focus {
background-color: inherit;
}
&:focus,
&.active {
background-color: white;
background-color: var(--el-fill-color-extra-light);
}
.icon {
display: inline-block;
Expand All @@ -161,7 +159,7 @@ export default defineComponent({
.fa-chevron-down {
margin-left: 5px;
font-weight: 100;
color: #999;
color: var(--el-text-color-primary);
transform: scale(0.8);
}
}
Expand All @@ -171,6 +169,7 @@ export default defineComponent({
.item {
display: flex;
flex-direction: row;
.icon {
width: 15px;
display: flex;
Expand All @@ -190,12 +189,12 @@ export default defineComponent({
.name {
font-size: 14px;
font-weight: bold;
color: #333;
color: var(--el-text-color-primary);
margin: 0;
}
.description {
font-size: 12px;
color: #999;
color: var(--el-text-color-secondary);
margin: 0;
}
}
Expand Down
11 changes: 6 additions & 5 deletions src/components/chat/SidePanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export default defineComponent({
padding: 15px;
width: 300px;
height: 100%;
border-right: 1px solid #eee;
border-right: 1px solid var(--el-border-color);
overflow-y: scroll;
.conversations {
Expand All @@ -164,15 +164,15 @@ export default defineComponent({
flex-direction: row;
padding: 10px;
margin-bottom: 5px;
border: 1px dashed hsl(0, 0%, 93%);
border: 1px dashed var(--el-border-color);
line-height: 30px;
border-radius: 10px;
color: #666;
color: var(--el-text-color-primary);
cursor: pointer;
&.active,
&:hover {
background-color: #eee;
background-color: var(--el-fill-color-extra-light);
}
.icons {
Expand All @@ -189,10 +189,11 @@ export default defineComponent({
overflow: hidden;
text-overflow: ellipsis;
padding-right: 8px;
color: #666;
color: var(--el-text-color-primary);
}
.operations {
width: 40px;
color: var(--el-text-color-regular);
.icon {
cursor: pointer;
font-size: 14px;
Expand Down
2 changes: 1 addition & 1 deletion src/components/chatdoc/AnsweringMark.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default defineComponent({
width: 2px;
height: 16px;
margin-top: 3px;
background-color: var(--el-color-black);
background-color: var(--el-text-color-primary);
animation: blink 1s infinite;
}
</style>
11 changes: 6 additions & 5 deletions src/components/chatdoc/Conversations.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export default defineComponent({
padding: 15px;
width: 300px;
height: 100%;
border-right: 1px solid #eee;
border-right: 1px solid var(--el-border-color);
overflow-y: scroll;
.conversations {
Expand All @@ -158,15 +158,15 @@ export default defineComponent({
flex-direction: row;
padding: 10px;
margin-bottom: 5px;
border: 1px dashed hsl(0, 0%, 93%);
border: 1px dashed var(--el-border-color);
line-height: 30px;
border-radius: 10px;
color: #666;
color: var(--el-text-color-primary);
cursor: pointer;
&.active,
&:hover {
background-color: #eee;
background-color: var(--el-fill-color-extra-light);
}
.icons {
Expand All @@ -183,10 +183,11 @@ export default defineComponent({
overflow: hidden;
text-overflow: ellipsis;
padding-right: 8px;
color: #666;
color: var(--el-text-color-primary);
}
.operations {
width: 40px;
color: var(--el-text-color-regular);
.icon {
cursor: pointer;
font-size: 14px;
Expand Down
2 changes: 1 addition & 1 deletion src/components/chatdoc/CreateRepository.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default defineComponent({
height: 50px;
border-radius: 50%;
margin-top: 5px;
background-color: #eee;
background-color: var(--el-bg-color-page);
margin-bottom: 0;
}
Expand Down
11 changes: 6 additions & 5 deletions src/components/chatdoc/InputBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
</span>
<el-input
v-model="questionValue"
:rows="3"
:disabled="disabled"
class="input"
type="textarea"
Expand Down Expand Up @@ -89,6 +88,8 @@ export default defineComponent({
.input-box {
.input {
textarea {
height: auto;
max-height: 100px;
border: none;
background: none;
box-shadow: none;
Expand All @@ -112,7 +113,7 @@ export default defineComponent({
.input-box {
position: relative;
width: 100%;
border: 1px solid #eee;
border: 1px solid var(--el-border-color);
border-radius: 10px;
background: none;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.1);
Expand All @@ -132,13 +133,13 @@ export default defineComponent({
right: 15px;
&.disabled {
.icon-send {
color: #eee;
color: var(--el-text-color-disabled);
}
cursor: not-allowed;
}
.icon-send {
font-size: 16px;
color: #666;
color: var(--el-text-color-primary);
}
}
}
Expand All @@ -147,7 +148,7 @@ export default defineComponent({
.info {
display: block;
font-size: 12px;
color: #666;
color: var(--el-text-color-regular);
margin-top: 5px;
margin-left: 3px;
margin-bottom: 0;
Expand Down
2 changes: 1 addition & 1 deletion src/components/chatdoc/Message.vue
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export default defineComponent({
align-items: start;
.content {
background-color: var(--el-bg-color-page);
color: var(--el-color-black);
color: var(--el-text-color-primary);
border-bottom-left-radius: 0;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/common/Chevron.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default defineComponent({
border-radius: 50%;
padding: 5px 6px;
cursor: pointer;
color: var(--el-color-black);
background: var(--el-color-white);
background-color: inherit;
color: var(--el-text-color-primary);
}
</style>
Loading

0 comments on commit b8970e1

Please sign in to comment.