Skip to content

Commit

Permalink
style: optimize the color scheme (#539)
Browse files Browse the repository at this point in the history
- 调整暗色模式下元素配色,提升辨识度
- 增加边框,便于区分边界
- 移除最外层元素边距,使编辑区与浏览区直接贴边
  • Loading branch information
YangFong authored Feb 26, 2025
1 parent c1922cf commit 0e5e215
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/components/CodemirrorEditor/CssEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function tabChanged(tabName: string | number) {

<template>
<transition enter-active-class="bounceInRight">
<div v-show="displayStore.isShowCssEditor" class="cssEditor-wrapper h-full flex flex-col border-l-1">
<div v-show="displayStore.isShowCssEditor" class="cssEditor-wrapper h-full flex flex-col border-l-2 border-gray/50">
<Tabs
v-model="store.cssContentConfig.active"
@update:model-value="tabChanged"
Expand Down
2 changes: 1 addition & 1 deletion src/components/CodemirrorEditor/EditorHeader/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function copy() {
</script>

<template>
<header class="header-container h-15 flex items-center justify-between px-5">
<header class="header-container h-15 flex items-center justify-between px-5 dark:bg-[#191c20]">
<div class="space-x-2 flex">
<Menubar class="menubar">
<FileDropdown />
Expand Down
10 changes: 5 additions & 5 deletions src/components/CodemirrorEditor/PostSlider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ function delPost() {

<template>
<div
class="overflow-hidden bg-gray/20 transition-width duration-300 dark:bg-gray/40"
class="overflow-hidden bg-gray/20 transition-width duration-300 dark:bg-[#191c20]"
:class="{
'w-0': !store.isOpenPostSlider,
'w-50': store.isOpenPostSlider,
}"
>
<nav
class="space-y-1 h-full overflow-auto p-2 transition-transform"
class="space-y-1 h-full overflow-auto border-r-2 border-gray/20 p-2 transition-transform"
:class="{
'translate-x-100': store.isOpenPostSlider,
'-translate-x-full': !store.isOpenPostSlider,
Expand Down Expand Up @@ -93,10 +93,10 @@ function delPost() {
</Dialog>
<a
v-for="(post, index) in store.posts" :key="post.title" href="#" :class="{
'bg-primary text-primary-foreground shadow-lg border-2 border-primary': store.currentPostIndex === index,
'dark:bg-primary-dark dark:text-primary-foreground-dark dark:border-primary-dark': store.currentPostIndex === index,
'bg-primary text-primary-foreground shadow-lg dark:border-1 border-primary': store.currentPostIndex === index,
'dark:bg-gray/30 dark:text-primary-foreground-dark dark:border-primary-dark': store.currentPostIndex === index,
}"
class="hover:bg-primary/90 hover:text-primary-foreground dark:bg-muted dark:hover:bg-muted dark:hover:border-primary-dark h-8 w-full inline-flex items-center justify-start gap-2 whitespace-nowrap rounded px-2 text-sm transition-colors dark:text-white dark:hover:text-white"
class="hover:bg-primary/90 hover:text-primary-foreground dark:hover:border-primary-dark h-8 w-full inline-flex items-center justify-start gap-2 whitespace-nowrap rounded px-2 text-sm transition-colors dark:text-white dark:hover:bg-gray/20 dark:hover:text-white"
@click="store.currentPostIndex = index"
>
<span class="line-clamp-1">{{ post.title }}</span>
Expand Down
4 changes: 2 additions & 2 deletions src/components/CodemirrorEditor/RightSlider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ const formatOptions = ref<Format[]>([`rgb`, `hex`, `hsl`, `hsv`])

<template>
<div
class="overflow-hidden bg-gray/20 transition-width duration-300 dark:bg-gray/40"
class="overflow-hidden border-l-2 border-gray/20 bg-gray/20 transition-width duration-300 dark:bg-[#191c20]"
:class="{
'w-0': !store.isOpenRightSlider,
'w-0 border-l-0': !store.isOpenRightSlider,
'w-100': store.isOpenRightSlider,
}"
>
Expand Down
3 changes: 1 addition & 2 deletions src/views/CodemirrorEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ onMounted(() => {
<CssEditor class="order-2 flex-1" />
<RightSlider class="order-2" />
</div>
<footer class="h-[30px] flex select-none items-center justify-end text-[12px]">
<footer class="h-[30px] flex select-none items-center justify-end px-4 text-[12px]">
字数 {{ readingTime?.words }}, 阅读大约需 {{ Math.ceil(readingTime?.minutes ?? 0) }} 分钟
</footer>

Expand Down Expand Up @@ -479,7 +479,6 @@ onMounted(() => {
.container-main {
overflow: hidden;
padding: 0 20px;
}
#output-wrapper {
Expand Down

0 comments on commit 0e5e215

Please sign in to comment.