feat: reduce TaskDetailView selector specificity

This commit is contained in:
Dominik Pschenitschni 2022-11-12 16:45:46 +01:00
parent 4c4adfdf4e
commit fba402fcd0
Signed by untrusted user: dpschen
GPG Key ID: B257AC0149F43A77
1 changed files with 174 additions and 188 deletions

View File

@ -2,8 +2,7 @@
<div <div
class="loader-container task-view-container" class="loader-container task-view-container"
:class="{ :class="{
'is-loading': taskService.loading, 'is-loading': taskService.loading || !visible,
'visible': visible,
'is-modal': isModal, 'is-modal': isModal,
}" }"
> >
@ -801,213 +800,200 @@ async function setPercentDone(percentDone: number) {
<style lang="scss" scoped> <style lang="scss" scoped>
$flash-background-duration: 750ms; $flash-background-duration: 750ms;
.task-view { .task-view-container {
padding: 1rem; // simulate sass lighten($primary, 30) by increasing lightness 30% to 73%
background-color: var(--site-background); --primary-light: hsla(var(--primary-h), var(--primary-s), 73%, var(--primary-a));
padding-bottom: 0;
@media screen and (max-width: $desktop) {
padding-bottom: 0; @media screen and (min-width: $desktop) {
padding-bottom: 1rem;
} }
} }
.subtitle { .task-view {
color: var(--grey-500); padding: 1rem;
margin-bottom: 1rem; padding-bottom: 0;
background-color: var(--site-background);
a {
color: var(--grey-800); @media screen and (min-width: $desktop) {
} padding: 1rem;
} }
}
h3 .button { .task-view * {
vertical-align: middle; transition: opacity 50ms ease;
} }
.icon.is-grey { .is-loading .task-view * {
color: var(--grey-400); opacity: 0;
} }
.subtitle {
color: var(--grey-500);
margin-bottom: 1rem;
.date-input { a {
display: flex; color: var(--grey-800);
align-items: center; }
} }
.remove { h3 .button {
color: var(--danger);
vertical-align: middle; vertical-align: middle;
padding-left: .5rem; }
line-height: 1;
}
:deep(.datepicker) { .icon.is-grey {
width: 100%; color: var(--grey-400);
}
.date-input {
display: flex;
align-items: center;
}
.show { .remove {
color: var(--text); color: var(--danger);
padding: .25rem .5rem; vertical-align: middle;
transition: background-color $transition; padding-left: .5rem;
border-radius: $radius; line-height: 1;
display: block; }
margin: .1rem 0;
width: 100%;
text-align: left;
&:hover { :deep(.datepicker) {
background: var(--white); width: 100%;
}
}
&.disabled .show:hover { .show {
background: transparent; color: var(--text);
} padding: .25rem .5rem;
} transition: background-color $transition;
border-radius: $radius;
display: block;
margin: .1rem 0;
width: 100%;
text-align: left;
.details { &:hover {
padding-bottom: 0.75rem; background: var(--white);
flex-flow: row wrap;
margin-bottom: 0;
.detail-title {
display: block;
color: var(--grey-400);
}
.none {
font-style: italic;
}
// Break after the 2nd element
.column:nth-child(2n) {
page-break-after: always; // CSS 2.1 syntax
break-after: always; // New syntax
}
&.labels-list,
.assignees {
:deep(.multiselect) {
.input-wrapper {
&:not(:focus-within):not(:hover) {
background: transparent;
border-color: transparent;
}
}
}
}
}
:deep(.details),
:deep(.heading) {
.input:not(.has-defaults),
.textarea,
.select:not(.has-defaults) select {
cursor: pointer;
transition: all $transition-duration;
&::placeholder {
color: var(--text-light);
opacity: 1;
font-style: italic;
}
&:not(:disabled) {
&:hover,
&:active,
&:focus {
background: var(--scheme-main);
border-color: var(--border);
cursor: text;
}
&:hover,
&:active {
cursor: text;
border-color: var(--link)
}
}
}
.select:not(.has-defaults):after {
opacity: 0;
}
.select:not(.has-defaults):hover:after {
opacity: 1;
}
}
.attachments {
margin-bottom: 0;
table tr:last-child td {
border-bottom: none;
}
}
.action-buttons {
@media screen and (min-width: $tablet) {
position: sticky;
top: $navbar-height + 1.5rem;
align-self: flex-start;
}
.button {
width: 100%;
margin-bottom: .5rem;
justify-content: left;
&.has-light-text {
color: var(--white);
}
}
}
.is-modal .action-buttons {
// we need same top margin for the modal close button
@media screen and (min-width: $tablet) {
top: 6.5rem;
}
// this is the moment when the fixed close button is outside the modal
// => we can fill up the space again
@media screen and (min-width: calc(#{$desktop} + 84px)) {
top: 0;
} }
} }
.checklist-summary { &.disabled .show:hover {
padding-left: .25rem; background: transparent;
} }
.task-view-container {
padding-bottom: 1rem;
@media screen and (max-width: $desktop) {
padding-bottom: 0;
}
.task-view * {
opacity: 0;
transition: opacity 50ms ease;
}
&.is-loading {
opacity: 1;
.task-view * {
opacity: 0;
}
}
&.visible:not(.is-loading) .task-view * {
opacity: 1;
}
} }
.task-view-container { .details {
// simulate sass lighten($primary, 30) by increasing lightness 30% to 73% padding-bottom: 0.75rem;
--primary-light: hsla(var(--primary-h), var(--primary-s), 73%, var(--primary-a)); flex-flow: row wrap;
margin-bottom: 0;
.detail-title {
display: block;
color: var(--grey-400);
}
.none {
font-style: italic;
}
// Break after the 2nd element
.column:nth-child(2n) {
page-break-after: always; // CSS 2.1 syntax
break-after: always; // New syntax
}
}
.details.labels-list,
.assignees {
:deep(.multiselect) {
.input-wrapper {
&:not(:focus-within):not(:hover) {
background: transparent;
border-color: transparent;
}
}
}
}
:deep(.details),
:deep(.heading) {
.input:not(.has-defaults),
.textarea,
.select:not(.has-defaults) select {
cursor: pointer;
transition: all $transition-duration;
&::placeholder {
color: var(--text-light);
opacity: 1;
font-style: italic;
}
&:not(:disabled) {
&:hover,
&:active,
&:focus {
background: var(--scheme-main);
border-color: var(--border);
cursor: text;
}
&:hover,
&:active {
cursor: text;
border-color: var(--link)
}
}
}
.select:not(.has-defaults):after {
opacity: 0;
}
.select:not(.has-defaults):hover:after {
opacity: 1;
}
}
.attachments {
margin-bottom: 0;
table tr:last-child td {
border-bottom: none;
}
}
.action-buttons {
@media screen and (min-width: $tablet) {
position: sticky;
top: $navbar-height + 1.5rem;
align-self: flex-start;
}
.button {
width: 100%;
margin-bottom: .5rem;
justify-content: left;
&.has-light-text {
color: var(--white);
}
}
}
.is-modal .action-buttons {
// we need same top margin for the modal close button
@media screen and (min-width: $tablet) {
top: 6.5rem;
}
// this is the moment when the fixed close button is outside the modal
// => we can fill up the space again
@media screen and (min-width: calc(#{$desktop} + 84px)) {
top: 0;
}
}
.checklist-summary {
padding-left: .25rem;
} }
.flash-background-enter-from, .flash-background-enter-from,