Skip to content

Commit

Permalink
Merge pull request #5973 from nextcloud-libraries/fix/--header-height
Browse files Browse the repository at this point in the history
fix: use `--header-height` instead of `50px` constant
  • Loading branch information
susnux authored Aug 19, 2024
2 parents ea3b8be + 57fdcc1 commit f6ca078
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/assets/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ $action-background-hover: rgba(127, 127, 127, .25);

// various structure data used in the
// `AppNavigation` component
$header-height: 50px;
$navigation-width: 300px;

// mobile breakpoint
Expand Down
2 changes: 1 addition & 1 deletion src/components/NcContent/NcContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export default {
.content {
box-sizing: border-box;
margin: var(--body-container-margin);
margin-top: 50px;
margin-top: var(--header-height);
display: flex;
width: calc(100% - var(--body-container-margin) * 2);
border-radius: var(--body-container-radius);
Expand Down
4 changes: 2 additions & 2 deletions src/components/NcHeaderMenu/NcHeaderMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ $externalMargin: 8px;
&__wrapper {
position: fixed;
z-index: 2000;
top: 50px;
top: var(--header-height);
inset-inline-end: 0;
box-sizing: border-box;
margin: 0 $externalMargin;
Expand Down Expand Up @@ -388,7 +388,7 @@ $externalMargin: 8px;
width: 350px;
max-width: calc(100vw - 2 * $externalMargin);
min-height: calc(var(--default-clickable-area) * 1.5);
max-height: calc(100vh - 50px * 2);
max-height: calc(100vh - var(--header-height) * 2);
:deep(.empty-content) {
margin: 12vh 10px;
}
Expand Down
18 changes: 9 additions & 9 deletions src/components/NcModal/NcModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ export default {
align-items: center;
justify-content: center;
width: 100%;
height: $header-height;
height: var(--header-height);
overflow: hidden;
transition: opacity 250ms, visibility 250ms;

Expand Down Expand Up @@ -889,14 +889,14 @@ export default {
align-items: center;
justify-content: center;
box-sizing: border-box;
margin: calc(calc($header-height - var(--default-clickable-area)) / 2);
margin: calc(calc(var(--header-height) - var(--default-clickable-area)) / 2);
padding: 0;
}

.play-pause-icons {
position: relative;
width: $header-height;
height: $header-height;
width: var(--header-height);
height: var(--header-height);
margin: 0;
padding: 0;
cursor: pointer;
Expand All @@ -916,14 +916,14 @@ export default {
box-sizing: border-box;
width: var(--default-clickable-area);
height: var(--default-clickable-area);
margin: calc(calc($header-height - var(--default-clickable-area)) / 2);
margin: calc(calc(var(--header-height) - var(--default-clickable-area)) / 2);
cursor: pointer;
opacity: $opacity_normal;
}
}

&:deep() .action-item {
margin: calc(calc($header-height - var(--default-clickable-area)) / 2);
margin: calc(calc(var(--header-height) - var(--default-clickable-area)) / 2);

&--single {
box-sizing: border-box;
Expand Down Expand Up @@ -1014,7 +1014,7 @@ export default {

// We allow 90% max-height, but we need to ensure the header does not overlap the modal
// as the modal is centered, we need the space on top and bottom
$max-modal-height: min(90%, calc(100% - 2 * $header-height));
$max-modal-height: min(90%, calc(100% - 2 * var(--header-height)));

// Sizing
&--small {
Expand Down Expand Up @@ -1043,7 +1043,7 @@ export default {
width: 100%;
height: calc(100% - var(--header-height));
position: absolute;
top: $header-height;
top: var(--header-height);
border-radius: 0;
}
}
Expand All @@ -1056,7 +1056,7 @@ export default {
max-height: initial;
height: calc(100% - var(--header-height));
position: absolute;
top: $header-height;
top: var(--header-height);
border-radius: 0;
}
}
Expand Down

0 comments on commit f6ca078

Please sign in to comment.