Skip to content

Commit 1ef661f

Browse files
committed
feat(css): styles for threaded replies
1 parent 0ec0c02 commit 1ef661f

File tree

4 files changed

+163
-4
lines changed

4 files changed

+163
-4
lines changed

invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/elements/button.overrides

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,20 @@
8383
background-color: transparent;
8484
padding-left: 0;
8585
}
86+
87+
.ui.button.text-only {
88+
padding: @verticalPadding @textOnlyHorizontalPadding;
89+
transform: translateX(-@textOnlyHorizontalPadding);
90+
91+
&:not(:hover):not(:active):not(:focus) {
92+
background: none;
93+
}
94+
95+
&:hover:not(:active), &:focus:not(:active) {
96+
background-color: @backgroundColor;
97+
}
98+
99+
&:active {
100+
background-color: @hoverBackgroundColor;
101+
}
102+
}

invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/elements/button.variables

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
***********************************************/
44

55
@searchButtonColor: #fb8273;
6+
@textOnlyHorizontalPadding: 0.5rem;

invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/views/feed.overrides

Lines changed: 144 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@
33
.requests-event-item {
44
box-sizing: border-box;
55

6-
&.selected .event, &:target .event {
7-
outline: 2px solid @primaryColor;
6+
&.selected, &:target {
7+
& > .requests-event-container > .requests-event-inner-container > .event {
8+
outline: 2px solid @primaryColor;
9+
}
810
}
911
}
1012

1113
.requests-event-container {
1214
position: relative;
1315
padding: @defaultPadding 0;
1416

15-
&::before {
17+
&:not(.reply)::before {
1618
position: absolute;
1719
top: 0;
1820
bottom: 0;
@@ -31,11 +33,36 @@
3133
padding-top: 0;
3234
}
3335

36+
&.reply {
37+
padding: (@eventPadding / 2) @eventPadding;
38+
39+
&:hover {
40+
background-color: @whiteHover;
41+
}
42+
43+
.requests-avatar-container {
44+
margin-top: 0;
45+
}
46+
47+
.content {
48+
margin: 0;
49+
}
50+
51+
.event {
52+
background: none;
53+
}
54+
}
55+
56+
.timeline-comment-editor-container {
57+
padding: @eventPadding;
58+
padding-top: 0;
59+
}
3460
}
3561

3662
.requests-avatar-container {
3763
padding-right: 0.5em;
3864
margin-top: 1rem;
65+
position: relative;
3966

4067
@media screen and (max-width: @largestMobileScreen) {
4168
margin-top: 0;
@@ -45,6 +72,41 @@
4572
max-height: 40px;
4673
width: auto;
4774
}
75+
76+
&.has-line::before {
77+
content: "";
78+
position: absolute;
79+
display: block;
80+
top: 0;
81+
bottom: 0;
82+
// Half the width of the avatar minus the width of the line
83+
left: calc(1em - 2px);
84+
width: 2px;
85+
background-color: @borderColor;
86+
// Full height of the comment + the margin of the next comment
87+
height: calc(100% + 1rem);
88+
89+
@media screen and (max-width: @largestMobileScreen) {
90+
& {
91+
display: none;
92+
}
93+
}
94+
}
95+
}
96+
97+
.requests-comment-fake-reply {
98+
display: flex;
99+
align-items: center;
100+
padding: @eventPadding;
101+
padding-top: 0;
102+
103+
.requests-avatar-container {
104+
margin-top: 0;
105+
}
106+
107+
.requests-comment-fake-reply-input {
108+
width: 100%;
109+
}
48110
}
49111

50112
.requests-event-inner-container {
@@ -72,7 +134,6 @@
72134
flex: 1;
73135
border: @defaultBorder;
74136
border-radius: @defaultBorderRadius;
75-
padding: 0.5 * @defaultPadding;
76137
background-color: @white;
77138
position: relative;
78139

@@ -94,6 +155,10 @@
94155
}
95156
}
96157

158+
.button.requests-reply-expand {
159+
margin-left: @eventPadding;
160+
}
161+
97162
&.requests-action-event {
98163
border: 0;
99164
display: flex;
@@ -103,6 +168,17 @@
103168
margin-right: 0.5 * @defaultMargin;
104169
}
105170
}
171+
172+
&.requests-reply-event {
173+
border: none;
174+
padding: 0;
175+
margin-left: 0.5rem;
176+
}
177+
178+
p.requests-event-body-deleted {
179+
font-style: italic;
180+
color: @mutedTextColor;
181+
}
106182
}
107183

108184
.requests-action-event-icon {
@@ -113,6 +189,66 @@
113189
background-color: @white;
114190
}
115191
}
192+
193+
.requests-comment-fake-reply {
194+
display: flex;
195+
align-items: center;
196+
197+
.requests-avatar-container {
198+
margin-top: 0;
199+
}
200+
}
201+
202+
.requests-reply-count {
203+
background-color: @primaryColor;
204+
color: white;
205+
padding: 2px 4px;
206+
border-radius: @defaultBorderRadius;
207+
font-weight: normal;
208+
// Default font Helvetica has non-standard metrics so doesn't look middle-aligned on Firefox
209+
font-family: sans-serif;
210+
font-size: 0.75rem;
211+
}
212+
213+
.requests-reply-caret {
214+
margin-left: 2px !important;
215+
// The button styles add a right margin when the `right` class is added, despite that just being
216+
// part of the icon name.
217+
margin-right: 0 !important;
218+
}
219+
220+
.requests-reply-load-more {
221+
// Padding + width of avatar + padding on right-side of avatar + margin on left-side of main content
222+
margin-left: calc(@eventPadding + 28px + 1em + 0.5rem);
223+
margin-top: 0.5rem;
224+
margin-bottom: 0.5rem;
225+
position: relative;
226+
color: @linkColor;
227+
font-weight: normal;
228+
229+
&::before {
230+
content: "";
231+
position: absolute;
232+
display: block;
233+
top: 0;
234+
bottom: 0;
235+
// Margin on left-side of main content, padding on right-side of avatar, half width of line
236+
left: calc(-1rem - 1em);
237+
width: 2px;
238+
background: linear-gradient(to bottom, white, @borderColor);
239+
// Full height of the comment + the margin of the next comment
240+
height: calc(100% + 1rem);
241+
}
242+
243+
@media screen and (max-width: @largestMobileScreen) {
244+
& {
245+
margin: 0.5rem @eventPadding;
246+
&::before {
247+
display: none;
248+
}
249+
}
250+
}
251+
}
116252
}
117253
.ui.feed.last-page .requests-event-item:first-child .requests-event-container {
118254
padding-top: @defaultPadding;
@@ -134,6 +270,10 @@
134270
vertical-align: @userImageVerticalAlign;
135271
}
136272

273+
.event > .content {
274+
margin: @eventPadding;
275+
}
276+
137277
/*--------------
138278
Inline Date
139279
---------------*/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@eventPadding: 0.5 * @defaultPadding;

0 commit comments

Comments
 (0)