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
Adjust checkbox css, also style details checkbox
Signed-off-by: Raimund Schlüßler <[email protected]>
  • Loading branch information
raimund-schluessler committed Jul 23, 2020
commit ed3ab3281afd27f1baf210f6eafbe1ac8549dc5b
54 changes: 39 additions & 15 deletions css/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ $red_overdue: #b3312d; // overdue dates and high importance
$yellow: #fd0; // medium importance
$blue_due: #4271a6; // due dates and low importance

// Specify colors for each non-zero priority level
$priority_colors: ($red_overdue, $red_overdue, $red_overdue, $red_overdue, $yellow, $blue_due, $blue_due, $blue_due, $blue_due);

/**
* rules for app-navigation
*/
Expand Down Expand Up @@ -527,13 +524,6 @@ $priority_colors: ($red_overdue, $red_overdue, $red_overdue, $red_overdue, $yell
display: none;
}

// Apply colors to checkboxes for each non-zero priority level
@for $i from 1 through 9 {
&[data-priority="#{$i}"]>.task-body>.task-checkbox>input[type='checkbox'].checkbox + label::before {
border-color: nth($priority_colors, $i);
}
}

.task-body {
display: flex;
flex-direction: row;
Expand All @@ -555,10 +545,22 @@ $priority_colors: ($red_overdue, $red_overdue, $red_overdue, $red_overdue, $yell
height: 44px;
width: 44px;

input[type='checkbox'].checkbox + label::before {
border-width: 2px;
border-radius: var(--border-radius);
border-color: $color-lightgrey;
input[type='checkbox'].checkbox + label {
&::before {
border-width: 2px;
border-radius: var(--border-radius);
}

&.priority-high::before {
border-color: $red_overdue;
}
&.priority-medium::before {
border-color: $yellow;
}

&.priority-low::before {
border-color: $blue_due;
}
}
}

Expand Down Expand Up @@ -870,7 +872,24 @@ $priority_colors: ($red_overdue, $red_overdue, $red_overdue, $red_overdue, $yell

.detail-checkbox {
padding: 11px 10px;
opacity: .5;

input[type='checkbox'].checkbox + label {
&::before {
border-width: 2px;
border-radius: var(--border-radius);
}

&.priority-high::before {
border-color: $red_overdue;
}
&.priority-medium::before {
border-color: $yellow;
}

&.priority-low::before {
border-color: $blue_due;
}
}
}

.title-wrapper {
Expand Down Expand Up @@ -1223,6 +1242,11 @@ $priority_colors: ($red_overdue, $red_overdue, $red_overdue, $red_overdue, $yell
label {
padding-left: 14px;
width: 100%;

&::before {
border-width: 2px;
border-radius: var(--border-radius);
}
}

div,
Expand Down
22 changes: 16 additions & 6 deletions src/components/TaskBody.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
:disabled="readOnly"
:aria-label="$t('tasks', 'Task is completed')"
@click="toggleCompleted(task)">
<label class="reactive no-nav" :for="'toggleCompleted_' + task.uid" />
<label :class="[checkboxColor, 'reactive no-nav']" :for="'toggleCompleted_' + task.uid" />
</div>
<!-- Info: title, progress & categories -->
<div class="task-info">
Expand Down Expand Up @@ -293,18 +293,28 @@ export default {
}
},

iconStar() {
priorityClass() {
if (+this.task.priority > 5) {
return 'sprt-color sprt-task-star-low'
return 'low'
} else if (+this.task.priority === 5) {
return 'sprt-color sprt-task-star-medium'
return 'medium'
} else if (+this.task.priority > 0 && +this.task.priority < 5) {
return 'sprt-color sprt-task-star-high'
return 'high'
} else {
return 'icon-sprt-bw sprt-task-star'
return ''
}
},

checkboxColor() {
const priority = this.priorityClass
return priority ? `priority-${priority}` : ''
},

iconStar() {
const priority = this.priorityClass
return priority ? `sprt-color sprt-task-star-${priority}` : 'icon-sprt-bw sprt-task-star'
},

hasCompletedSubtasks() {
return Object.values(this.task.subTasks).some(subTask => {
return subTask.completed
Expand Down
6 changes: 5 additions & 1 deletion src/components/TheDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
:disabled="readOnly"
:aria-label="$t('tasks', 'Task is completed')"
@click="toggleCompleted(task)">
<label :for="'detailsToggleCompleted_' + task.uid" />
<label :class="[checkboxColor]" :for="'detailsToggleCompleted_' + task.uid" />
</span>
<div v-click-outside="() => finishEditing('summary')" class="title-wrapper">
<div v-linkify="task.summary"
Expand Down Expand Up @@ -618,6 +618,10 @@ export default {
}
return ''
},
checkboxColor() {
const priority = this.priorityClass
return priority ? `priority-${priority}` : ''
},
completeString() {
return this.$t('tasks', '{percent} % completed', { percent: this.task.complete })
},
Expand Down