Commit 1c962d58 authored by Annabel Dunstone Gray's avatar Annabel Dunstone Gray

Fix stylelint warnings in related_items_list.scss

This commit rearranges the styles in related_items_list
to adhere to stylelint's warnings. It also adds some
utility classes where applicable
parent fe4f3a41
...@@ -72,7 +72,7 @@ export default { ...@@ -72,7 +72,7 @@ export default {
<template> <template>
<div ref="milestoneDetails" class="issue-milestone-details"> <div ref="milestoneDetails" class="issue-milestone-details">
<icon :size="16" class="inline icon" name="clock" /> <icon :size="16" class="inline icon" name="clock" />
<span class="milestone-title">{{ milestone.title }}</span> <span class="milestone-title d-inline-block">{{ milestone.title }}</span>
<gl-tooltip :target="() => $refs.milestoneDetails" placement="bottom" class="js-item-milestone"> <gl-tooltip :target="() => $refs.milestoneDetails" placement="bottom" class="js-item-milestone">
<span class="bold">{{ __('Milestone') }}</span> <br /> <span class="bold">{{ __('Milestone') }}</span> <br />
<span>{{ milestone.title }}</span> <br /> <span>{{ milestone.title }}</span> <br />
......
...@@ -81,8 +81,11 @@ export default { ...@@ -81,8 +81,11 @@ export default {
:title="stateTitle" :title="stateTitle"
:aria-label="state" :aria-label="state"
data-html="true" data-html="true"
class="d-xl-none"
/> />
<span v-tooltip :title="itemPath" class="path-id-text">{{ itemPath }}</span> <span v-tooltip :title="itemPath" class="path-id-text d-inline-block">{{
itemPath
}}</span>
{{ pathIdSeparator }}{{ itemId }} {{ pathIdSeparator }}{{ itemId }}
</div> </div>
<div class="item-meta-child d-flex align-items-center"> <div class="item-meta-child d-flex align-items-center">
......
...@@ -11,6 +11,10 @@ $item-weight-max-width: 48px; ...@@ -11,6 +11,10 @@ $item-weight-max-width: 48px;
} }
} }
.sortable-link {
max-width: 85%;
}
.item-body { .item-body {
display: flex; display: flex;
position: relative; position: relative;
...@@ -18,13 +22,6 @@ $item-weight-max-width: 48px; ...@@ -18,13 +22,6 @@ $item-weight-max-width: 48px;
padding: $gl-padding-8; padding: $gl-padding-8;
line-height: $gl-line-height; line-height: $gl-line-height;
.item-contents {
display: flex;
align-items: center;
flex-wrap: wrap;
flex-grow: 1;
}
.issue-token-state-icon-open { .issue-token-state-icon-open {
color: $green-500; color: $green-500;
} }
...@@ -66,143 +63,136 @@ $item-weight-max-width: 48px; ...@@ -66,143 +63,136 @@ $item-weight-max-width: 48px;
font-weight: $gl-font-weight-bold; font-weight: $gl-font-weight-bold;
} }
.sortable-link {
max-width: 85%;
}
.issue-token-state-icon-open, .issue-token-state-icon-open,
.issue-token-state-icon-closed { .issue-token-state-icon-closed {
display: none; display: none;
} }
} }
.item-meta { .item-path-id .path-id-text,
display: flex; .item-milestone .milestone-title,
flex-wrap: wrap; .item-due-date,
flex-basis: 100%; .item-weight .board-card-info-text {
font-size: $gl-font-size-small;
color: $gl-text-color-secondary; color: $gl-text-color-secondary;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
}
.item-meta-child { .item-contents {
order: 0; display: flex;
display: flex; align-items: center;
flex-wrap: wrap; flex-wrap: wrap;
flex-basis: 100%; flex-grow: 1;
}
.item-due-date, .item-meta {
.item-weight { display: flex;
margin-left: $gl-padding-8; flex-wrap: wrap;
} flex-basis: 100%;
font-size: $gl-font-size-small;
color: $gl-text-color-secondary;
.item-milestone, .item-meta-child {
.item-weight { order: 0;
cursor: help; display: flex;
} flex-wrap: wrap;
flex-basis: 100%;
}
.item-milestone { .item-milestone,
text-decoration: none; .item-weight {
max-width: $item-milestone-max-width; cursor: help;
} }
.item-due-date { .item-milestone {
margin-right: 0; text-decoration: none;
} max-width: $item-milestone-max-width;
.item-weight { .ic-clock {
margin-right: 0; color: $gl-text-color-tertiary;
max-width: $item-weight-max-width; margin-right: $gl-padding-4;
}
} }
}
.item-path-id .path-id-text, .item-weight {
.item-milestone .milestone-title, margin-right: 0;
.item-due-date, max-width: $item-weight-max-width;
.item-weight .board-card-info-text { }
color: $gl-text-color-secondary;
display: inline-block;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.item-path-id { .item-assignees {
margin-top: $gl-padding-4; order: 2;
font-size: $gl-font-size-xs; align-self: flex-end;
white-space: nowrap; align-items: center;
margin-left: auto;
.path-id-text { .user-avatar-link {
font-weight: $gl-font-weight-bold; margin-right: -$gl-padding-4;
max-width: $item-path-max-width;
&:nth-of-type(1) {
z-index: 2;
} }
.issue-token-state-icon-open, &:nth-of-type(2) {
.issue-token-state-icon-closed { z-index: 1;
display: block;
} }
&:not(.mr-item-path) { &:last-child {
order: 1; margin-right: 0;
} }
} }
.item-milestone .ic-clock { .avatar {
color: $gl-text-color-tertiary; height: $gl-padding;
margin-right: $gl-padding-4; width: $gl-padding;
margin-right: 0;
vertical-align: bottom;
} }
.item-assignees { .avatar-counter {
order: 2; height: $gl-padding;
align-self: flex-end; border: 1px solid transparent;
align-items: center; background-color: $gl-text-color-tertiary;
margin-left: auto; font-weight: $gl-font-weight-bold;
padding: 0 $gl-padding-4;
.user-avatar-link { line-height: $gl-padding;
margin-right: -$gl-padding-4; }
}
&:nth-of-type(1) { }
z-index: 2;
}
&:nth-of-type(2) { .item-path-id {
z-index: 1; margin-top: $gl-padding-4;
} font-size: $gl-font-size-xs;
white-space: nowrap;
&:last-child { .path-id-text {
margin-right: 0; font-weight: $gl-font-weight-bold;
} max-width: $item-path-max-width;
} }
.avatar { .issue-token-state-icon-open,
height: $gl-padding; .issue-token-state-icon-closed {
width: $gl-padding; display: block;
margin-right: 0; }
vertical-align: bottom;
}
.avatar-counter { &:not(.mr-item-path) {
height: $gl-padding; order: 1;
border: 1px solid transparent;
background-color: $gl-text-color-tertiary;
font-weight: $gl-font-weight-bold;
padding: 0 $gl-padding-4;
line-height: $gl-padding;
}
}
} }
}
.btn-item-remove { .btn-item-remove {
position: absolute; position: absolute;
right: 0; right: 0;
top: $gl-padding-4 / 2; top: $gl-padding-4 / 2;
padding: $gl-padding-4; padding: $gl-padding-4;
margin-right: $gl-padding-4 / 2; margin-right: $gl-padding-4 / 2;
line-height: 0; line-height: 0;
border-color: transparent; border-color: transparent;
color: $gl-text-color-secondary; color: $gl-text-color-secondary;
&:hover { &:hover {
color: $gl-text-color; color: $gl-text-color;
}
} }
} }
...@@ -212,18 +202,20 @@ $item-weight-max-width: 48px; ...@@ -212,18 +202,20 @@ $item-weight-max-width: 48px;
} }
@include media-breakpoint-up(sm) { @include media-breakpoint-up(sm) {
.item-body { .sortable-link {
.item-contents .item-title { max-width: 90%;
.mr-title-link,
.sortable-link {
max-width: 90%;
}
}
} }
} }
/* Small devices (landscape phones, 768px and up) */ /* Small devices (landscape phones, 768px and up) */
@include media-breakpoint-up(md) { @include media-breakpoint-up(md) {
.sortable-link {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
max-width: 100%;
}
.item-body { .item-body {
.item-contents { .item-contents {
min-width: 0; min-width: 0;
...@@ -235,37 +227,6 @@ $item-weight-max-width: 48px; ...@@ -235,37 +227,6 @@ $item-weight-max-width: 48px;
// positioned absolutely // positioned absolutely
width: 95%; width: 95%;
margin-bottom: $gl-padding-4; margin-bottom: $gl-padding-4;
.mr-title-link,
.sortable-link {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
max-width: 100%;
}
}
.item-meta {
.item-path-id {
order: 0;
margin-top: 0;
}
.item-meta-child {
flex-basis: unset;
margin-left: auto;
margin-right: $gl-padding-4;
~ .item-assignees {
margin-left: $gl-padding-4;
}
}
.item-assignees {
margin-bottom: 0;
margin-left: 0;
order: 2;
}
} }
} }
...@@ -273,6 +234,29 @@ $item-weight-max-width: 48px; ...@@ -273,6 +234,29 @@ $item-weight-max-width: 48px;
order: 1; order: 1;
} }
} }
.item-meta {
.item-path-id {
order: 0;
margin-top: 0;
}
.item-meta-child {
flex-basis: unset;
margin-left: auto;
margin-right: $gl-padding-4;
~ .item-assignees {
margin-left: $gl-padding-4;
}
}
.item-assignees {
margin-bottom: 0;
margin-left: 0;
order: 2;
}
}
} }
/* Medium devices (desktops, 992px and up) */ /* Medium devices (desktops, 992px and up) */
...@@ -287,11 +271,6 @@ $item-weight-max-width: 48px; ...@@ -287,11 +271,6 @@ $item-weight-max-width: 48px;
.item-meta .item-path-id { .item-meta .item-path-id {
font-size: inherit; // Base size given to `item-meta` is `$gl-font-size-small` font-size: inherit; // Base size given to `item-meta` is `$gl-font-size-small`
} }
.issue-token-state-icon-open,
.issue-token-state-icon-closed {
margin-right: $gl-padding-4;
}
} }
} }
...@@ -301,93 +280,87 @@ $item-weight-max-width: 48px; ...@@ -301,93 +280,87 @@ $item-weight-max-width: 48px;
padding: $gl-padding-8; padding: $gl-padding-8;
padding-left: $gl-padding; padding-left: $gl-padding;
.item-contents { .item-title {
flex-wrap: nowrap; display: flex;
overflow: hidden; margin-bottom: 0;
min-width: 0;
width: auto;
flex-basis: unset;
font-weight: $gl-font-weight-normal;
.item-title { .issue-token-state-icon-open,
display: flex; .issue-token-state-icon-closed {
margin-bottom: 0; display: block;
min-width: 0; margin-right: $gl-padding-8;
width: auto;
flex-basis: unset;
font-weight: $gl-font-weight-normal;
.mr-title-link,
.sortable-link {
display: block;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
line-height: 1.3;
}
.issue-token-state-icon-open,
.issue-token-state-icon-closed {
display: block;
margin-right: $gl-padding-8;
}
.confidential-icon {
align-self: auto;
margin-top: 0;
}
} }
.item-meta { .confidential-icon {
align-self: auto;
margin-top: 0; margin-top: 0;
justify-content: flex-end;
flex: 1;
flex-wrap: nowrap;
.item-path-id {
order: 0;
margin-top: 0;
margin-left: $gl-padding-8;
margin-right: auto;
.issue-token-state-icon-open,
.issue-token-state-icon-closed {
display: none;
}
}
.item-meta-child {
margin-left: $gl-padding-8;
flex-wrap: nowrap;
}
.item-assignees {
flex-grow: 0;
margin-top: 0;
margin-right: $gl-padding-4;
.avatar {
height: $gl-padding-24;
width: $gl-padding-24;
}
.avatar-counter {
height: $gl-padding-24;
min-width: $gl-padding-24;
line-height: $gl-padding-24;
border-radius: $gl-padding-24;
}
}
} }
} }
}
.btn-item-remove { .item-contents {
position: relative; flex-wrap: nowrap;
align-self: center; overflow: hidden;
top: initial; }
right: 0;
margin-right: 0;
padding: $btn-sm-side-margin;
&:hover { .item-meta {
border-color: $border-color; margin-top: 0;
} justify-content: flex-end;
flex: 1;
flex-wrap: nowrap;
.item-meta-child {
margin-left: $gl-padding-8;
flex-wrap: nowrap;
} }
} }
.item-path-id {
order: 0;
margin-top: 0;
margin-left: $gl-padding-8;
margin-right: auto;
}
.item-assignees {
flex-grow: 0;
margin-top: 0;
margin-right: $gl-padding-4;
.avatar {
height: $gl-padding-24;
width: $gl-padding-24;
}
.avatar-counter {
height: $gl-padding-24;
min-width: $gl-padding-24;
line-height: $gl-padding-24;
border-radius: $gl-padding-24;
}
}
.btn-item-remove {
position: relative;
align-self: center;
top: initial;
right: 0;
margin-right: 0;
padding: $btn-sm-side-margin;
&:hover {
border-color: $border-color;
}
}
.sortable-link {
display: block;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
line-height: 1.3;
}
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment