Skip to content

Commit

Permalink
Merge pull request #6390 from nextcloud-libraries/fix/next/6384/box-s…
Browse files Browse the repository at this point in the history
…izing

[next] fix!: make 'box-sizing: border-box' a default behaviour for all containers
  • Loading branch information
Antreesy authored Jan 17, 2025
2 parents 2220800 + 00a1be5 commit 7ae3143
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 27 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ All notable changes to this project will be documented in this file.
* The package is now a native ESM package and the CommonJS entry points were dropped!
* The `limitWidth` prop of `NcSettingsSection` was removed (the content is now always limitted width) [\#5605](https://github.com/nextcloud-libraries/nextcloud-vue/pull/5605)
* The `closing` and `opening` events of `NcAppSidebar` were removed as they are directly emitted when the sidebar was opened when using `v-if` and also just duplicated the state of the `open` prop [\#5606](https://github.com/nextcloud-libraries/nextcloud-vue/pull/5606)
* The `checked` prop was renamed to `modelValue`, the `update:checked` event was renamed to `update:modelValue`. This affects the following components.
* The `checked` prop was renamed to `modelValue`, the `update:checked` event was renamed to `update:modelValue`. This affects the following components:
- `NcActionCheckbox`
- `NcActionRadio`
- `NcCheckboxRadioSwitch`
* The `value` prop was renamed to `modelValue`, the `update:value` or `input` events were renamed to `update:modelValue`. This affects the following components.
* The `value` prop was renamed to `modelValue`, the `update:value` or `input` events were renamed to `update:modelValue`. This affects the following components:
- `NcActionInput`
- `NcActionTextEditable`
- `NcColorPicker`
Expand All @@ -41,6 +41,9 @@ All notable changes to this project will be documented in this file.
- `NcBreadcrumb`
- `NcListItem`
* The `isFullscreen` and `isMobile` mixins were removed. Use the according composables instead.
* The `box-sizing: border-box` is now default for following components and its content. This is done to match behaviour of `NcContent` (as they can be mounted directly to `body`):
- `NcModal`
- `NcPopover`

### 🚀 Enhancements
* Allow writing components using Typescript and provide type definitions for `NcButton` [\#4525](https://github.com/nextcloud-libraries/nextcloud-vue/pull/4525) \([susnux](https://github.com/susnux)\)
Expand Down
5 changes: 1 addition & 4 deletions src/assets/NcAppNavigationItem.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

.app-navigation-entry {
position: relative;
display: flex;
flex-shrink: 0;
flex-wrap: wrap;
box-sizing: border-box;
width: 100%;
min-height: var(--default-clickable-area);
transition: background-color var(--animation-quick) ease-in-out;
Expand All @@ -20,7 +19,6 @@
display: flex;
flex-shrink: 0;
flex-wrap: wrap;
box-sizing: border-box;
width: 100%;

&.app-navigation-entry--collapsible:not(.app-navigation-entry--opened) > ul {
Expand Down Expand Up @@ -85,7 +83,6 @@
display: flex;
overflow: hidden;
flex: 1 1 0;
box-sizing: border-box;
min-height: var(--default-clickable-area);
padding: 0;
white-space: nowrap;
Expand Down
2 changes: 0 additions & 2 deletions src/components/NcAppNavigation/NcAppNavigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,6 @@ export default {
// Above NcAppContent
z-index: 1800;
height: 100%;
box-sizing: border-box;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
Expand All @@ -351,7 +350,6 @@ export default {
width: 100%;
overflow-x: hidden;
overflow-y: auto;
box-sizing: border-box;
display: flex;
flex-direction: column;
gap: var(--default-grid-baseline, 4px);
Expand Down
1 change: 0 additions & 1 deletion src/components/NcAppNavigationList/NcAppNavigationList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export default {
width: 100%;
overflow-x: hidden;
overflow-y: auto;
box-sizing: border-box;
display: flex;
flex-direction: column;
gap: var(--default-grid-baseline, 4px);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ export default {
padding: $app-navigation-settings-margin;

&__header {
box-sizing: border-box;
margin: 0 $app-navigation-settings-margin $app-navigation-settings-margin $app-navigation-settings-margin;

.settings-button {
Expand Down Expand Up @@ -129,7 +128,6 @@ export default {
/* restrict height of settings and make scrollable */
max-height: 300px;
overflow-y: auto;
box-sizing: border-box;
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/components/NcAppSettingsDialog/NcAppSettingsDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -393,14 +393,12 @@ export default {
position: relative;
}
:deep &__content {
box-sizing: border-box;
padding-inline: calc(4 * var(--default-grid-baseline));
}
}

.navigation-list {
height: 100%;
box-sizing: border-box;
overflow-y: auto;
padding: calc(3 * var(--default-grid-baseline));

Expand Down
1 change: 0 additions & 1 deletion src/components/NcColorPicker/NcColorPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,6 @@ export default defineComponent({
align-content: flex-end;
flex-direction: column;
justify-content: space-between;
box-sizing: content-box !important;
width: 176px;
padding: 8px;
border-radius: 3px;
Expand Down
4 changes: 2 additions & 2 deletions src/components/NcContent/NcContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ export default {
}

.content {
box-sizing: border-box;
display: flex;
width: calc(100% - var(--body-container-margin) * 2);
border-radius: var(--body-container-radius);
Expand All @@ -233,7 +232,8 @@ export default {
position: fixed;
}

:deep(*) {
&,
& * {
box-sizing: border-box;
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/components/NcDialog/NcDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -622,8 +622,6 @@ export default defineComponent({
}

&__actions {
box-sizing: border-box;

display: flex;
gap: 6px;
align-content: center;
Expand Down
15 changes: 6 additions & 9 deletions src/components/NcModal/NcModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,12 @@ export default {
height: 100%;
--backdrop-color: 0, 0, 0;
background-color: rgba(var(--backdrop-color), .5);

&,
& * {
box-sizing: border-box;
}

&--opaque {
background-color: rgba(var(--backdrop-color), .92);
}
Expand All @@ -876,7 +882,6 @@ export default {

&__name {
overflow-x: hidden;
box-sizing: border-box;
width: 100%;
padding: 0 calc(var(--default-clickable-area) * 3) 0 12px; // maximum actions is 3
transition: padding ease 100ms;
Expand Down Expand Up @@ -905,7 +910,6 @@ export default {
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
margin: calc((var(--header-height) - var(--default-clickable-area)) / 2);
padding: 0;
}
Expand All @@ -930,7 +934,6 @@ export default {
}
&__play,
&__pause {
box-sizing: border-box;
width: var(--default-clickable-area);
height: var(--default-clickable-area);
margin: calc((var(--header-height) - var(--default-clickable-area)) / 2);
Expand All @@ -943,7 +946,6 @@ export default {
margin: calc((var(--header-height) - var(--default-clickable-area)) / 2);

&--single {
box-sizing: border-box;
width: var(--default-clickable-area);
height: var(--default-clickable-area);
cursor: pointer;
Expand Down Expand Up @@ -974,14 +976,9 @@ export default {
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
width: 100%;
height: 100%;

:deep(*) {
box-sizing: border-box;
}

/* Navigation buttons */
.prev,
.next {
Expand Down
5 changes: 5 additions & 0 deletions src/components/NcPopover/NcPopover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,11 @@ export default {
$arrow-width: 10px;

.v-popper--theme-dropdown {
&,
& * {
box-sizing: border-box;
}

&.v-popper__popper {
z-index: 100000;
top: 0;
Expand Down

0 comments on commit 7ae3143

Please sign in to comment.