Skip to content

Commit 0f8b91f

Browse files
refactor(ui): introduce variable for the mobile breakpoint
Signed-off-by: Christoph Wurst <[email protected]>
1 parent d997a26 commit 0f8b91f

File tree

9 files changed

+31
-12
lines changed

9 files changed

+31
-12
lines changed

css/variables.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
3+
* SPDX-License-Identifier: AGPL-3.0-only
4+
*/
5+
6+
$breakpoint-mobile: 1024px;

src/components/ComposerSessionIndicator.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ export default {
9797
</script>
9898
9999
<style lang="scss" scoped>
100+
@use '../../css/variables';
101+
100102
.composer-session {
101103
position: fixed;
102104
bottom: calc(var(--body-container-margin) + var(--default-grid-baseline));
@@ -114,7 +116,7 @@ export default {
114116
border-radius: var(--body-container-radius);
115117
116118
// Mobile
117-
@media (max-width: 1024px) {
119+
@media (max-width: #{variables.$breakpoint-mobile}) {
118120
width: calc(100% - 2 * var(--default-grid-baseline));
119121
height: 44px;
120122
border-radius: var(--border-radius-pill);

src/components/Message.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ export default {
173173
</script>
174174
175175
<style lang="scss" scoped>
176+
@use '../../css/variables';
177+
176178
.v-popover > .trigger > .action-item {
177179
border-radius: 22px;
178180
background-color: var(--color-background-darker);
@@ -233,7 +235,7 @@ export default {
233235
margin-inline-start: auto;
234236
}
235237
236-
@media (max-width: var(--breakpoint-mobile)) {
238+
@media (max-width: #{variables.$breakpoint-mobile}) {
237239
margin-inline: calc(var(--default-grid-baseline) * 3);
238240
}
239241
}

src/components/MessageAttachment.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,9 @@ export default {
260260
</script>
261261

262262
<style lang="scss" scoped>
263+
@use '../../css/variables';
263264
264-
@media screen and (max-width: 1024px) {
265+
@media screen and (max-width: #{variables.$breakpoint-mobile}) {
265266
.attachment{
266267
width: 100% !important;
267268
}

src/components/MessageAttachments.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ export default {
216216
</script>
217217

218218
<style lang="scss">
219+
@use '../../css/variables';
220+
219221
.attachments {
220222
width: 100%;
221223
box-sizing: border-box;
@@ -294,8 +296,7 @@ export default {
294296
bottom: -2px;
295297
background: linear-gradient(0deg, var(--color-main-background), var(--color-main-background) 90%, rgba(255, 255, 255, 0));
296298
297-
298-
@media (max-width: var(--breakpoint-mobile)) {
299+
@media (max-width: #{variables.$breakpoint-mobile}) {
299300
padding: 10px 12px 10px 12px;
300301
}
301302
}

src/components/MessageLoadingSkeleton.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export default {
3535
</script>
3636

3737
<style lang="scss" scoped>
38+
@use '../../css/variables';
3839
3940
/* skeleton */
4041
.message-loading-skeleton {
@@ -99,7 +100,7 @@ export default {
99100
}
100101
}
101102
102-
@media only screen and (max-width: 1024px) {
103+
@media only screen and (max-width: #{variables.$breakpoint-mobile}) {
103104
.message-loading-skeleton__body {
104105
margin-inline-start: 12px;
105106
}

src/components/NewMessageModal.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,8 @@ export default {
643643
</script>
644644
645645
<style lang="scss" scoped>
646+
@use '../../css/variables';
647+
646648
@media only screen and (max-width: 600px) {
647649
:deep(.modal-container) {
648650
max-width: 80%;
@@ -695,7 +697,7 @@ export default {
695697
overflow-y: auto;
696698
padding-inline-start: 5px;
697699
border-inline-start: 1px solid var(--color-text-maxcontrast);
698-
@media (max-width: 1024px) {
700+
@media (max-width: #{variables.$breakpoint-mobile}) {
699701
display: none;
700702
}
701703
}

src/components/PhishingWarning.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ export default {
6868
</script>
6969

7070
<style lang="scss" scoped>
71+
@use '../../css/variables';
72+
7173
.phishing-warning {
7274
background-color: rgba(var(--color-warning-rgb), 0.2);
7375
border-radius: var(--border-radius-element);
@@ -94,7 +96,7 @@ export default {
9496
}
9597
}
9698
97-
@media (max-width: 1024px) {
99+
@media (max-width: #{variables.$breakpoint-mobile}) {
98100
margin-inline-start: calc(var(--default-grid-baseline) * 3);
99101
}
100102
}

src/components/Thread.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,8 @@ export default {
580580
</script>
581581
582582
<style lang="scss">
583+
@use '../../css/variables';
584+
583585
#mail-message {
584586
width: 100%;
585587
max-width: 100%;
@@ -631,7 +633,7 @@ export default {
631633
}
632634
}
633635
634-
@media only screen and (max-width: 1024px) {
636+
@media only screen and (max-width: #{variables.$breakpoint-mobile}) {
635637
#mail-thread-header {
636638
position: sticky !important;
637639
top: 29px !important;
@@ -669,13 +671,13 @@ export default {
669671
}
670672
}
671673
672-
@media only screen and (max-width: 1024px) {
674+
@media only screen and (max-width: #{variables.$breakpoint-mobile}) {
673675
#mail-thread-header-fields {
674676
padding-inline-start: 48px;
675677
}
676678
}
677679
678-
@media only screen and (max-width: 1024px) {
680+
@media only screen and (max-width: #{variables.$breakpoint-mobile}) {
679681
#mail-thread-header-fields {
680682
margin-top: -32px;
681683
}
@@ -695,7 +697,7 @@ export default {
695697
margin: calc(var(--default-grid-baseline) * 2) calc(var(--default-grid-baseline) * 10) 0 calc(var(--default-grid-baseline) * 14);
696698
}
697699
698-
@media only screen and (max-width: var(--breakpoint-mobile)) {
700+
@media only screen and (max-width: #{variables.$breakpoint-mobile}) {
699701
#mail-content {
700702
margin: calc(var(--default-grid-baseline) * 2) calc(var(--default-grid-baseline) * 3) 0 calc(var(--default-grid-baseline) * 3);
701703
}

0 commit comments

Comments
 (0)