Skip to content

Commit a4055d9

Browse files
youngbeom-shin申永范-UX
andauthored
feat(community): improve styling and layout (#1271)
* feat(community): improve styling and layout * feat(community): improve styling and layout --------- Co-authored-by: 申永范-UX <[email protected]>
1 parent dfc6c57 commit a4055d9

File tree

3 files changed

+86
-18
lines changed

3 files changed

+86
-18
lines changed

frontend/src/components/community/CommunityMDTextarea.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<div class="border border-gray-200 rounded-lg bg-gray-100">
33
<div class="flex text-sm rounded-t-lg leading-[22px]">
44
<div
5-
class="px-5 py-2 rounded-tl-lg whitespace-nowrap border-r"
6-
:class="activeTab == 'Edit' ? 'bg-white' : 'border-b'"
5+
class="px-5 py-2 rounded-tl-lg whitespace-nowrap border-r text-sm font-medium"
6+
:class="activeTab == 'Edit' ? 'bg-white text-brand-700' : 'border-b text-gray-700'"
77
@click="activeTab = 'Edit'"
88
>
99
{{ $t('community.MD.edit') }}
1010
</div>
1111
<div
12-
class="px-5 py-2 whitespace-nowrap border-r"
13-
:class="activeTab == 'Preview' ? 'bg-white' : 'border-b'"
12+
class="px-5 py-2 whitespace-nowrap border-r text-sm font-medium"
13+
:class="activeTab == 'Preview' ? 'bg-white text-brand-700' : 'border-b text-gray-700'"
1414
@click="activeTab = 'Preview'"
1515
>
1616
{{ $t('community.MD.preview') }}
@@ -28,7 +28,7 @@
2828
cols="10"
2929
@input="handleInput"
3030
v-model="theDesc"
31-
class="w-full text-gray-500 text-md mb-2 p-2 border border-gray-300 shadow-xs rounded-md focus:outline-none focus:ring-0.5 focus:border-brand-300"
31+
class="w-full text-gray-500 text-sm mb-2 p-2 border border-gray200 rounded-sm focus:outline-none focus:ring-0.5 focus:border-brand-300"
3232
:placeholder="placeholder || $t('community.MD.default')"
3333
></textarea>
3434
<div class="flex items-center gap-2 text-gray-500 text-sm leading-5">

frontend/src/components/shared/CodeEditor.vue

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,72 @@ const changeTab = (tabName) => {
8686
}
8787
8888
:deep(.el-tabs__header) {
89-
background-color: #F5F7FA !important;
89+
background-color: #F2F4F7 !important;
90+
border-radius: var(--border-radius-md) var(--border-radius-md) 0 0 !important;
9091
}
9192
9293
:deep(.d2h-file-header) {
93-
background-color: #F5F7FA !important;
94+
background-color: #F2F4F7 !important;
95+
}
96+
97+
:deep(.el-tabs__nav-scroll) {
98+
background-color: #F2F4F7 !important;
99+
border-radius: var(--border-radius-md) var(--border-radius-md) 0 0 !important;
100+
}
101+
102+
:deep(.el-tabs) {
103+
border-radius: var(--border-radius-md) !important;
104+
border: 1px solid #EAECF0 !important;
105+
overflow: hidden !important;
106+
}
107+
108+
/* 确保内容区域也有正确的圆角 */
109+
:deep(.el-tabs__content) {
110+
border-radius: 0 0 var(--border-radius-md) var(--border-radius-md) !important;
111+
background-color: white !important;
112+
}
113+
114+
/* 使用伪元素创建更精确的边框效果 */
115+
:deep(.el-tabs) {
116+
position: relative !important;
117+
}
118+
119+
:deep(.el-tabs::before) {
120+
content: '';
121+
position: absolute;
122+
top: 0;
123+
left: 0;
124+
right: 0;
125+
bottom: 0;
126+
border: 1px solid #EAECF0;
127+
border-radius: var(--border-radius-md);
128+
pointer-events: none;
129+
z-index: 1;
130+
}
131+
132+
/* 确保内部元素不会覆盖边框 */
133+
:deep(.el-tabs__header),
134+
:deep(.el-tabs__content) {
135+
position: relative;
136+
z-index: 2;
137+
}
138+
139+
/* 设置标签页字体颜色 */
140+
:deep(.el-tabs__item.is-top) {
141+
color: #344054 !important;
142+
font-size: 14px !important;
143+
font-weight: 500 !important;
144+
}
145+
146+
:deep(.el-tabs__item.is-top:hover) {
147+
color: #344054 !important;
148+
font-size: 14px !important;
149+
font-weight: 500 !important;
150+
}
151+
152+
:deep(.el-tabs__item.is-top.is-active) {
153+
color: #3250BD !important;
154+
font-size: 14px !important;
155+
font-weight: 500 !important;
94156
}
95157
</style>

frontend/src/components/shared/EditFile.vue

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
2-
<div class="flex flex-col gap-4 my-[30px] md:px-5">
3-
<div class="flex items-center gap-[10px]">
4-
<div class="whitespace-nowrap">{{ repoName }}</div>
2+
<div class="flex flex-col gap-4 my-8 md:px-5">
3+
<div class="flex items-center gap-3">
4+
<div class="whitespace-nowrap ">{{ repoName }}</div>
55
<div class="text-gray-500">/</div>
66
<el-input
77
v-model="fileName"
@@ -10,7 +10,7 @@
1010
clearable
1111
:placeholder="$t('repo.edit.fileName')"
1212
@input="handleFileNameChange"
13-
class="w-full h-[40px] text-gray-500"
13+
class="w-full h-10 text-gray-500"
1414
/>
1515
</div>
1616
<code-editor
@@ -36,7 +36,7 @@
3636
show-word-limit
3737
clearable
3838
:placeholder="commitTitlePlaceholder"
39-
class="w-full h-[40px] text-gray-500"
39+
class="w-full h-10 text-gray-500"
4040
/>
4141
</div>
4242
<CommunityMDTextarea
@@ -45,13 +45,19 @@
4545
@inputChange="handleCommentInputChange"
4646
></CommunityMDTextarea>
4747
<div>
48-
<el-button
49-
type="primary"
50-
@click="updateFile"
48+
<div class="flex items-center gap-2">
49+
<CsgButton
50+
class="btn btn-primary btn-md"
51+
:name="$t('repo.edit.update')"
5152
:disabled="!commitValid || submiting"
52-
>{{ $t('repo.edit.update') }}</el-button
53-
>
54-
<el-button @click="cancel">{{ $t('repo.edit.cancel') }}</el-button>
53+
@click="updateFile"
54+
/>
55+
<CsgButton
56+
class="btn btn-secondary-gray btn-md"
57+
:name="$t('repo.edit.cancel')"
58+
@click="cancel"
59+
/>
60+
</div>
5561
</div>
5662
</div>
5763
</template>

0 commit comments

Comments
 (0)