Skip to content

Commit 22e3e67

Browse files
committed
feat: custom layout spacing
1 parent b4236bc commit 22e3e67

File tree

4 files changed

+29
-4
lines changed

4 files changed

+29
-4
lines changed

src/layout.scss

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ body.app-layout-card:not(.is-mobile) {
88
--pdf-background: transparent;
99
--tab-divider-color: var(--color-base-35);
1010
--tab-active-shadow: none !important;
11+
--app-layout-spacing: var(--setting-app-layout-spacing, var(--size-2-3));
1112

1213
&.theme-light {
1314
--background-primary-alt: hsl(var(--base-accent-h), 14%, 95%);
@@ -105,16 +106,29 @@ body.app-layout-card:not(.is-mobile) {
105106

106107
.mod-root {
107108
.workspace-tab-header-container {
108-
padding-left: var(--size-4-1);
109+
padding-left: var(--app-layout-spacing);
109110
}
110111
.workspace-tab-container {
111-
padding: var(--size-4-1);
112+
padding: var(--app-layout-spacing);
112113
padding-top: 0;
113114

114115
.workspace-leaf-content {
115116
border-radius: var(--radius-m);
116117
}
117118
}
119+
:is(
120+
.workspace-tabs + .workspace-tabs.mod-top,
121+
.workspace-split.mod-vertical > .workspace-tabs + .workspace-tabs,
122+
.workspace-tabs + .workspace-split > .workspace-tabs,
123+
.workspace-split + .workspace-tabs,
124+
.workspace-split + .workspace-split:not(.mod-root) > .workspace-tabs
125+
)
126+
> div {
127+
padding-left: 0;
128+
}
129+
.workspace-tabs:not(.mod-top) {
130+
margin-top: -4px;
131+
}
118132
}
119133

120134
.workspace-tab-header {

src/style-settings/_index.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ body:not(.calendar-swap-year-month)
192192
body:not(.app-layout-card)
193193
.setting-item:is(
194194
[data-id='app-layout-card-bg'],
195-
[data-id='app-layout-card-border']
195+
[data-id='app-layout-card-border'],
196+
[data-id='setting-app-layout-spacing']
196197
),
197198
body:not(.app-layout-card.app-layout-card-custom)
198199
.setting-item:is(

src/style-settings/basic.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,16 @@ export default Settings.create('maple-basic', 'Maple Basic').children([
140140
.addClassToggle('app-layout-card-border', {
141141
title: { en: 'Add Border For Card', zh: '为卡片添加边框' },
142142
})
143+
.addVarNumSlider(
144+
'setting-app-layout-spacing',
145+
{
146+
title: {
147+
en: 'Card Spacing',
148+
zh: '卡片间距',
149+
},
150+
},
151+
{ default: 6, max: 16, min: 2, step: 0.5, format: 'px' },
152+
)
143153
.addClassSelect(
144154
'app-layout-card-bg',
145155
{

src/workspace/tab.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
&-inner {
3838
margin-top: var(--size-4-1);
3939
padding-bottom: var(--size-4-1);
40-
padding-left: var(--size-4-1);
40+
padding-left: 5px;
4141

4242
&-close-button {
4343
padding: var(--size-2-1);

0 commit comments

Comments
 (0)