Skip to content

Commit 5fa6412

Browse files
committed
feat(NcAppSidebar): expose CSS variable with close button offset
- var(--app-sidebar-close-button-offset) Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
1 parent 9085fb9 commit 5fa6412

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/components/NcAppSidebar/NcAppSidebar.vue

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,6 +1287,9 @@ $top-buttons-spacing: 6px;
12871287
}
12881288
12891289
.app-sidebar-header {
1290+
// Variable for custom content to be aware of space taken by close button (from top-right corner)
1291+
--app-sidebar-close-button-offset: calc(var(--default-clickable-area) + #{$top-buttons-spacing});
1292+
12901293
> .app-sidebar__close {
12911294
position: absolute;
12921295
z-index: 100;
@@ -1321,11 +1324,11 @@ $top-buttons-spacing: 6px;
13211324
padding-inline-start: 0;
13221325
flex: 1 1 auto;
13231326
min-width: 0;
1324-
padding-inline-end: calc(2 * var(--default-clickable-area) + $top-buttons-spacing);
1327+
padding-inline-end: calc(var(--default-clickable-area) + var(--app-sidebar-close-button-offset));
13251328
padding-top: var(--app-sidebar-padding);
13261329
13271330
&.app-sidebar-header__desc--without-actions {
1328-
padding-inline-end: calc(var(--default-clickable-area) + $top-buttons-spacing);
1331+
padding-inline-end: var(--app-sidebar-close-button-offset);
13291332
}
13301333
13311334
.app-sidebar-header__tertiary-actions {
@@ -1337,7 +1340,7 @@ $top-buttons-spacing: 6px;
13371340
}
13381341
.app-sidebar-header__menu {
13391342
top: $top-buttons-spacing;
1340-
inset-inline-end: calc(var(--default-clickable-area) + $top-buttons-spacing); // left of the close button
1343+
inset-inline-end: var(--app-sidebar-close-button-offset); // left of the close button
13411344
position: absolute;
13421345
}
13431346
}
@@ -1350,14 +1353,14 @@ $top-buttons-spacing: 6px;
13501353
.app-sidebar-header__menu {
13511354
position: absolute;
13521355
top: $top-buttons-spacing;
1353-
inset-inline-end: calc($top-buttons-spacing + var(--default-clickable-area));
1356+
inset-inline-end: var(--app-sidebar-close-button-offset);
13541357
}
13551358
// increase the padding to not overlap the menu
13561359
.app-sidebar-header__desc {
1357-
padding-inline-end: calc(var(--default-clickable-area) * 2 + $top-buttons-spacing);
1360+
padding-inline-end: calc(var(--default-clickable-area) + var(--app-sidebar-close-button-offset));
13581361
13591362
&.app-sidebar-header__desc--without-actions {
1360-
padding-inline-end: calc(var(--default-clickable-area) + $top-buttons-spacing);
1363+
padding-inline-end: var(--app-sidebar-close-button-offset);
13611364
}
13621365
}
13631366
}

0 commit comments

Comments
 (0)