Skip to content

Commit cad7a43

Browse files
committed
chore: update template styles
1 parent e169fb3 commit cad7a43

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

src/components/workspace/content-item.tsx

+12-2
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ export function ContentItem(props: ContainerProps) {
8181
<GripVertical className="w-4 h-4" />
8282
</div>
8383

84-
{/* 桌面端展示 */}
85-
<a href={`/#${item.id}`} className="min-h-[61px] relative border-b border-b-border py-4 hidden sm:block">
84+
{/* 桌面端展示,只允许一级标题可点击 */}
85+
{!item.parentId
86+
? <a href={`/#${item.id}`} className="min-h-[61px] relative border-b border-b-border py-4 hidden sm:block">
8687
<div className="mr-28">{parse(DOMPurify.sanitize(item.title))}</div>
8788
<ContentItemButtons
8889
item={item}
@@ -91,6 +92,15 @@ export function ContentItem(props: ContainerProps) {
9192
onSubContentAdd={handleSubContentAdd}
9293
/>
9394
</a>
95+
: <div className="min-h-[61px] relative border-b border-b-border py-4" onClick={e => e.preventDefault()}>
96+
<div className="mr-28 select-none">{parse(DOMPurify.sanitize(item.title))}</div>
97+
<ContentItemButtons
98+
item={item}
99+
onContentEdit={handleContentEdit}
100+
onDialogOpen={handleDialogOpen}
101+
onSubContentAdd={handleSubContentAdd}
102+
/>
103+
</div>}
94104

95105
{/* 移动端展示 */}
96106
<div className="min-h-[61px] relative border-b border-b-border py-4 sm:hidden" onClick={e => e.preventDefault()}>

src/theme/templates/cartoon-template/cartoon-template.ts

+2
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ export const cartoonTemplate: ArticleModuleTemplate = {
155155
},
156156
},
157157
content: {
158+
flexGrow: 1,
158159
width: '100%',
159160
paddingTop: '30px',
160161
paddingLeft: '16px',
@@ -164,6 +165,7 @@ export const cartoonTemplate: ArticleModuleTemplate = {
164165
borderRadius: '8px',
165166
border: '1px solid',
166167
backgroundColor: 'var(--main-content-background)',
168+
overflow: 'hidden',
167169
},
168170
},
169171
sub: {

src/theme/templates/simple-template/simple-template.ts

+4
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ export const simpleTemplate: ArticleModuleTemplate = {
4444
},
4545
main: {
4646
container: {
47+
'display': 'flex',
48+
'flexDirection': 'column',
4749
'padding': '45px 36px',
4850

4951
'&:nth-of-type(2n)': {
@@ -61,6 +63,7 @@ export const simpleTemplate: ArticleModuleTemplate = {
6163
color: 'var(--main-title-foreground)',
6264
},
6365
content: {
66+
'flexGrow': 1,
6467
'color': 'var(--main-content-foreground)',
6568
'backgroundColor': 'var(--main-content-background)',
6669
'fontSize': '15px',
@@ -82,6 +85,7 @@ export const simpleTemplate: ArticleModuleTemplate = {
8285
backgroundColor: 'var(--main-content-secondary-background)',
8386
color: 'var(--sub-container-foreground)',
8487
},
88+
'overflow': 'hidden',
8589
},
8690
},
8791
sub: {

src/theme/templates/tech-template/tech-template.ts

+4
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ export const techTemplate: ArticleModuleTemplate = {
4545
},
4646
main: {
4747
container: {
48+
display: 'flex',
49+
flexDirection: 'column',
4850
paddingLeft: '12px',
4951
paddingRight: '12px',
5052
paddingTop: '13px',
@@ -84,12 +86,14 @@ export const techTemplate: ArticleModuleTemplate = {
8486
},
8587
},
8688
content: {
89+
flexGrow: 1,
8790
position: 'relative',
8891
padding: '12px 18px',
8992
borderRadius: '12px',
9093
fontSize: '15px',
9194
backgroundColor: 'rgb(255 255 255 / 0.7)',
9295
color: 'var(--main-content-foreground)',
96+
overflow: 'hidden',
9397
},
9498
},
9599
sub: {

0 commit comments

Comments
 (0)