Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed tasks with hidden subtasks styling
Added a subtasksHidden class when all class are hidden in a task-item and fixed the style for tasks with hidden subtasks.

Signed-off-by: Tim Krief <[email protected]>
  • Loading branch information
timkrief authored and raimund-schluessler committed Jul 23, 2020
commit 2d6377bfe6f8a9408e7be2d81aad8a6c803e56eb
54 changes: 25 additions & 29 deletions css/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -437,18 +437,19 @@ $priority_colors: ($red_overdue, $red_overdue, $red_overdue, $red_overdue, $yell
*/

@mixin remove-last-squared-corners($sublevels-left: 8) {
&:empty {
&::before,
&>ol:empty::before {
display: none !important;
}
@if $sublevels-left > 0 {
&>.task-item:last-child>.subtasks-container>ol {
&>ol>.task-item:last-child>.subtasks-container{
@include remove-last-squared-corners($sublevels-left - 1);
}
}
}

.grouped-tasks>ol,
.sortable-ghost>.subtasks-container>ol {
.grouped-tasks,
.sortable-ghost>.subtasks-container {
@include remove-last-squared-corners;
}

Expand Down Expand Up @@ -487,35 +488,30 @@ $priority_colors: ($red_overdue, $red_overdue, $red_overdue, $red_overdue, $yell
}
}

.subtasks-container>ol,
.subtasks-container>.add-task {
&:not(:empty) {
&.subtasksHidden>.subtasks-container {
margin-left: 44px;
}
&:not(.subtasksHidden)>.subtasks-container{
&>ol:not(:empty),
&>.add-task + ol,
&>.add-task {
margin-left: 44px;

&>.task-item:first-child>.task-body{
border-top-left-radius: 0;
}
}

&::before {
content: '';
display: block;
height: 1px;
border: 0 solid var(--color-main-background);
border-width: var(--border-radius) 0;
margin: calc(-1 * var(--border-radius)) 0;
background-color: var(--color-background-darker);
position: relative;
z-index: -1;
}
}

.subtasks-container>.add-task {
border-top: 1px solid var(--color-background-darker);
}

.subtasks-container>.add-task + ol {
margin-left: 44px;
&.subtasksHidden>.subtasks-container::before,
&.subtasksHidden>.subtasks-container>.add-task::after,
&:not(.subtasksHidden)>.subtasks-container>.add-task::before,
&>.subtasks-container>ol::before {
content: '';
display: block;
height: 1px;
border: 0 solid var(--color-main-background);
border-width: var(--border-radius) 0;
margin: calc(-1 * var(--border-radius)) 0;
background-color: var(--color-background-darker);
position: relative;
z-index: -1;
}

// Apply colors to checkboxes for each non-zero priority level
Expand Down
2 changes: 1 addition & 1 deletion src/components/TaskBody.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
<template>
<li v-show="showTask"
:task-id="task.uri"
:class="{done: task.completed, readOnly: readOnly, deleted: !!deleteTimeout}"
:class="{done: task.completed, readOnly: readOnly, deleted: !!deleteTimeout, subtasksHidden: !showSubtasks}"
:data-priority="[task.priority]"
class="task-item"
@dragstart="dragStart($event)">
Expand Down