Skip to content

Commit

Permalink
Merge pull request #3518 from nextcloud/fix/pixel-perfect-sidebar-button
Browse files Browse the repository at this point in the history
Make sidebar buttons pixel perfect
  • Loading branch information
CarlSchwan authored May 20, 2024
2 parents 803d437 + e4be190 commit 40ad0c2
Show file tree
Hide file tree
Showing 97 changed files with 16 additions and 15 deletions.
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};
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

0 comments on commit 40ad0c2

Please sign in to comment.