Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sidebar buttons pixel perfect #3518

Merged
merged 2 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 16 additions & 15 deletions src/components/NcAppSidebar/NcAppSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1136,23 +1136,22 @@ export default {
</style>

<style lang="scss" scoped>
$desc-vertical-padding: 18px;
$desc-vertical-padding-compact: 10px;
$desc-input-padding: 7px;

// name and subname
$desc-name-height: 30px;
$desc-subname-height: 22px;
$desc-height: $desc-name-height + $desc-subname-height;

$top-buttons-spacing: 6px;
$top-buttons-spacing: $app-navigation-padding; // align with app navigation

/*
Sidebar: to be used within #content
app-content will be shrinked properly
*/
.app-sidebar {
--app-sidebar-width: clamp(300px, 27vw, 500px);
--app-sidebar-padding: #{$app-navigation-padding};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it needed here? It duplicates an existing variable available on the .content

width: var(--app-sidebar-width);

z-index: 1500;
Expand Down Expand Up @@ -1201,34 +1200,35 @@ $top-buttons-spacing: 6px;
flex-direction: row;

.app-sidebar-header__figure {
--figure-size: calc($desc-height + var(--app-sidebar-padding));
z-index: 2;
width: $desc-height + $desc-vertical-padding;
height: $desc-height + $desc-vertical-padding;
margin: math.div($desc-vertical-padding, 2);
width: var(--figure-size);
height: var(--figure-size);
margin: calc(var(--app-sidebar-padding) / 2);
border-radius: 3px;
flex: 0 0 auto;
}
.app-sidebar-header__desc {
padding-left: 0;
flex: 1 1 auto;
min-width: 0;
padding-right: 2 * $clickable-area + $top-buttons-spacing;
padding-top: $desc-vertical-padding-compact;
padding-right: calc(2 * $clickable-area + $top-buttons-spacing);
padding-top: var(--app-sidebar-padding);

&.app-sidebar-header__desc--without-actions {
padding-right: #{$clickable-area + $top-buttons-spacing};
padding-right: calc($clickable-area + $top-buttons-spacing);
}

.app-sidebar-header__tertiary-actions {
z-index: 3; // above star
position: absolute;
top: math.div($desc-vertical-padding, 2);
top: calc(var(--app-sidebar-padding) / 2);
left: -1 * $clickable-area;
gap: 0; // override gap
}
.app-sidebar-header__menu {
top: $top-buttons-spacing;
right: $clickable-area + $top-buttons-spacing; // left of the close button
right: calc($clickable-area + $top-buttons-spacing); // left of the close button
position: absolute;
}
}
Expand All @@ -1241,14 +1241,14 @@ $top-buttons-spacing: 6px;
.app-sidebar-header__menu {
position: absolute;
top: $top-buttons-spacing;
right: $top-buttons-spacing + $clickable-area;
right: calc($top-buttons-spacing + $clickable-area);
}
// increase the padding to not overlap the menu
.app-sidebar-header__desc {
padding-right: #{$clickable-area * 2 + $top-buttons-spacing};
padding-right: calc($clickable-area * 2 + $top-buttons-spacing);

&.app-sidebar-header__desc--without-actions {
padding-right: #{$clickable-area + $top-buttons-spacing};
padding-right: calc($clickable-area + $top-buttons-spacing);
}
}
}
Expand Down Expand Up @@ -1279,7 +1279,8 @@ $top-buttons-spacing: 6px;
flex-direction: row;
justify-content: center;
align-items: center;
padding: #{$desc-vertical-padding} #{$top-buttons-spacing} #{$desc-vertical-padding} #{math.div($desc-vertical-padding, 2)};
padding-inline: var(--app-sidebar-padding);
padding-block: #{$top-buttons-spacing} calc(var(--app-sidebar-padding) / 2);
gap: 0 4px;

// custom overrides
Expand Down
Loading