Skip to content

Commit 516294e

Browse files
Merge pull request #6640 from ludij/feature/3331-dynamic-column-width
Feature/3331 dynamic column width
2 parents 6ace186 + 5a39996 commit 516294e

File tree

11 files changed

+206
-157
lines changed

11 files changed

+206
-157
lines changed

css/deck.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
input[type=submit].icon-confirm {
1616
border-color: var(--color-border-maxcontrast) !important;
17+
border-style: solid;
1718
border-left: none;
1819
}
1920

src/components/board/Board.vue

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -276,18 +276,15 @@ export default {
276276
position: relative;
277277
width: 100%;
278278
height: 100%;
279-
max-height: calc(100vh - 50px);
280279
display: flex;
281280
flex-direction: column;
282281
}
283282
284283
.board {
285-
padding-left: $board-spacing;
286284
position: relative;
287-
max-height: calc(100% - var(--default-clickable-area));
288-
overflow: hidden;
289285
overflow-x: auto;
290286
flex-grow: 1;
287+
scrollbar-gutter: stable;
291288
}
292289
293290
/**
@@ -297,28 +294,29 @@ export default {
297294
.smooth-dnd-container.horizontal {
298295
display: flex;
299296
align-items: stretch;
297+
gap: $board-gap;
298+
padding: 0 $board-gap;
300299
height: 100%;
301300
302301
&:deep(.stack-draggable-wrapper.smooth-dnd-draggable-wrapper) {
303302
display: flex;
304303
height: auto;
304+
flex: 0 1 $card-max-width;
305+
min-width: $card-min-width;
305306
306307
.stack {
307308
display: flex;
308309
flex-direction: column;
309310
position: relative;
310311
311312
.smooth-dnd-container.vertical {
312-
flex-grow: 1;
313+
$margin-x: calc($stack-gap * -1);
313314
display: flex;
314315
flex-direction: column;
315-
// Margin left instead of padidng to avoid jumps on dropping a card
316-
margin-left: $stack-spacing;
317-
padding-right: $stack-spacing;
318-
overflow-x: hidden;
316+
gap: $stack-gap;
317+
padding: $stack-gap;
318+
margin: 0 $margin-x;
319319
overflow-y: auto;
320-
padding-top: 15px;
321-
margin-top: -10px;
322320
scrollbar-gutter: stable;
323321
}
324322

src/components/board/Stack.vue

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
{{ stack.title }}
1515
</h3>
1616
<h3 v-else-if="!editing"
17-
title="stack.title"
1817
dir="auto"
1918
tabindex="0"
2019
:aria-label="stack.title"
20+
:title="stack.title"
2121
class="stack__title"
2222
@click="startEditing(stack)"
2323
@keydown.enter="startEditing(stack)">
@@ -108,7 +108,7 @@
108108
</Container>
109109

110110
<transition name="slide-bottom" appear>
111-
<div v-show="showAddCard" class="stack__card-add">
111+
<div v-if="showAddCard" class="stack__card-add">
112112
<form :class="{ 'icon-loading-small': stateCardCreating }"
113113
@submit.prevent.stop="clickAddCard()">
114114
<label for="new-stack-input-main" class="hidden-visually">{{ t('deck', 'Add a new card') }}</label>
@@ -365,37 +365,31 @@ export default {
365365
@import './../../css/variables';
366366
367367
.stack {
368-
width: $stack-width + $stack-spacing * 3;
368+
width: 100%;
369369
}
370370
371371
.stack__header {
372372
display: flex;
373373
position: sticky;
374374
top: 0;
375+
height: var(--default-clickable-area);
375376
z-index: 100;
376-
padding-left: $card-spacing;
377-
padding-right: $card-spacing;
378-
margin: 6px;
379377
margin-top: 0;
380378
cursor: grab;
381379
background-color: var(--color-main-background);
382380
383381
// Smooth fade out of the cards at the top
384382
&:before {
385-
content: ' ';
383+
content: '';
386384
display: block;
387385
position: absolute;
388-
width: calc(100% - 16px);
389-
height: 20px;
390-
top: 30px;
391-
left: 0px;
386+
width: 100%;
387+
height: $stack-gap;
388+
bottom: 0;
392389
z-index: 99;
393390
transition: top var(--animation-slow);
394-
395-
background-image: linear-gradient(180deg, var(--color-main-background) 3px, rgba(255, 255, 255, 0) 100%);
396-
body.theme--dark & {
397-
background-image: linear-gradient(180deg, var(--color-main-background) 3px, rgba(0, 0, 0, 0) 100%);
398-
}
391+
background-image: linear-gradient(180deg, var(--color-main-background) 0%, transparent 100%);
392+
transform: translateY(100%);
399393
}
400394
401395
& > * {
@@ -404,8 +398,10 @@ export default {
404398
}
405399
406400
h3, form {
407-
flex-grow: 1;
401+
flex: 1 1 auto;
402+
min-width: 0;
408403
display: flex;
404+
align-items: center;
409405
cursor: inherit;
410406
margin: 0;
411407
@@ -418,9 +414,8 @@ export default {
418414
white-space: nowrap;
419415
overflow: hidden;
420416
text-overflow: ellipsis;
421-
max-width: calc($stack-width - 60px);
422417
border-radius: 3px;
423-
padding: 4px 4px;
418+
padding: $card-padding;
424419
font-size: var(--default-font-size);
425420
426421
&:focus-visible {
@@ -430,7 +425,6 @@ export default {
430425
}
431426
432427
form {
433-
margin: -4px;
434428
input {
435429
font-weight: bold;
436430
padding: 0 6px;
@@ -453,14 +447,25 @@ export default {
453447
flex-shrink: 0;
454448
z-index: 100;
455449
display: flex;
456-
margin-bottom: 5px;
457-
padding-top: var(--default-grid-baseline);
450+
padding-bottom: $stack-gap;
458451
background-color: var(--color-main-background);
452+
position: relative;
453+
454+
// Smooth fade out of the cards at the top
455+
&:before {
456+
content: '';
457+
display: block;
458+
position: absolute;
459+
width: 100%;
460+
height: $stack-gap;
461+
z-index: 99;
462+
transition: bottom var(--animation-slow);
463+
background-image: linear-gradient(0deg, var(--color-main-background) 0%, transparent 100%);
464+
transform: translateY(-100%);
465+
}
459466
460467
form {
461468
display: flex;
462-
margin-left: $stack-spacing;
463-
margin-right: $stack-spacing;
464469
width: 100%;
465470
border: 2px solid var(--color-border-maxcontrast);
466471
border-radius: var(--border-radius-large);
@@ -481,7 +486,6 @@ export default {
481486
input {
482487
border: none;
483488
margin: 0;
484-
padding: 4px;
485489
}
486490
}
487491

src/components/cards/CardBadges.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ export default {
101101
</script>
102102

103103
<style lang="scss" scoped>
104+
@import './../../css/variables';
105+
104106
.badges {
105107
display: flex;
106108
width: 100%;
@@ -111,6 +113,7 @@ export default {
111113
.icon-badge {
112114
color: var(--color-text-maxcontrast);
113115
display: flex;
116+
align-items: center;
114117
margin-right: 2px;
115118
116119
span,
@@ -125,6 +128,7 @@ export default {
125128
flex-direction: row;
126129
flex-wrap: wrap;
127130
gap: 3px;
131+
height: var(--default-clickable-area);
128132
}
129133
130134
.badges .icon.due {

src/components/cards/CardCover.vue

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,10 @@
44
-->
55

66
<template>
7-
<div v-if="referencePreview" class="card-cover">
8-
<div class="image-wrapper rounded-left rounded-right" :style="{ backgroundImage: `url(${referencePreview})`}" />
9-
</div>
10-
<div v-else-if="cardId && ( attachments.length > 0 )" class="card-cover">
11-
<div v-for="(attachment, index) in attachments"
7+
<div v-if="cardId && ( attachments.length > 0 )" class="card-cover">
8+
<div v-for="attachment in attachments"
129
:key="attachment.id"
13-
:class="['image-wrapper', { 'rounded-left': index === 0 }, { 'rounded-right': index === attachments.length - 1 }]"
10+
class="image-wrapper"
1411
:style="{ backgroundImage: `url(${attachmentPreview(attachment)})` }" />
1512
</div>
1613
</template>
@@ -77,22 +74,14 @@ export default {
7774
.card-cover {
7875
height: 90px;
7976
display: flex;
80-
margin-top: -4px;
81-
margin-left: -4px;
82-
margin-right: -4px;
77+
margin: $card-image-margin $card-image-margin 0;
8378
8479
.image-wrapper {
8580
flex: 1;
8681
position: relative;
8782
background-size: cover;
8883
background-repeat: no-repeat;
8984
background-position: center center;
90-
&.rounded-left {
91-
border-top-left-radius: calc(var(--border-radius-large) - 1px);
92-
}
93-
&.rounded-right {
94-
border-top-right-radius: calc(var(--border-radius-large) - 1px);
95-
}
9685
}
9786
}
9887
</style>

src/components/cards/CardItem.vue

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<template>
77
<AttachmentDragAndDrop v-if="card" :card-id="card.id" class="drop-upload--card">
88
<div :ref="`card${card.id}`"
9-
:class="{'compact': compactMode, 'current-card': currentCard, 'has-labels': card.labels && card.labels.length > 0, 'card__editable': canEdit, 'card__archived': card.archived, 'card__highlight': highlight}"
9+
:class="{'compact': compactMode, 'current-card': currentCard, 'no-labels': !hasLabels, 'card__editable': canEdit, 'card__archived': card.archived, 'card__highlight': highlight}"
1010
tag="div"
1111
:tabindex="0"
1212
class="card"
@@ -331,12 +331,13 @@ export default {
331331
border-radius: var(--border-radius-large);
332332
font-size: 100%;
333333
background-color: var(--color-main-background);
334-
margin-bottom: $card-spacing;
335-
padding: var(--default-grid-baseline) $card-padding;
334+
padding: $card-padding;
336335
border: 2px solid var(--color-border-dark);
337336
width: 100%;
338337
display: flex;
339338
flex-direction: column;
339+
gap: $card-gap;
340+
overflow: hidden;
340341
341342
&:deep(*) {
342343
cursor: pointer;
@@ -359,12 +360,10 @@ export default {
359360
h4 {
360361
font-weight: normal;
361362
margin: 0;
362-
padding: var(--default-grid-baseline);
363363
flex-grow: 1;
364364
font-size: 100%;
365365
overflow: hidden;
366366
word-wrap: break-word;
367-
padding-left: 4px;
368367
align-self: center;
369368
370369
:deep(a) {
@@ -374,9 +373,6 @@ export default {
374373
&.editable {
375374
span {
376375
cursor: text;
377-
padding-right: 8px;
378-
padding-top: 3px;
379-
padding-bottom: 3px;
380376
381377
&:focus, &:focus-visible {
382378
outline: none;
@@ -385,6 +381,7 @@ export default {
385381
386382
&:focus-within {
387383
outline: 2px solid var(--color-border-dark);
384+
outline-offset: 4px;
388385
border-radius: 3px;
389386
}
390387
}
@@ -427,8 +424,6 @@ export default {
427424
.card-labels {
428425
display: flex;
429426
align-items: end;
430-
padding-left: var(--default-grid-baseline);
431-
padding-top: var(--default-grid-baseline);
432427
433428
.labels {
434429
flex-wrap: wrap;
@@ -444,7 +439,7 @@ export default {
444439
445440
.card-related {
446441
display: flex;
447-
padding: 12px;
442+
padding: 4px;
448443
padding-bottom: 0px;
449444
color: var(--color-text-maxcontrast);
450445
@@ -469,8 +464,8 @@ export default {
469464
height: 32px;
470465
width: 32px;
471466
}
472-
&.has-labels {
473-
padding-bottom: $card-padding;
467+
&.no-labels {
468+
padding-bottom: var(--default-grid-baseline);
474469
}
475470
.labels {
476471
height: 6px;

0 commit comments

Comments
 (0)