Skip to content

Commit 3e68698

Browse files
palkerecsenyizzacharo
authored andcommitted
feat(css): styles for threaded replies
1 parent 0202650 commit 3e68698

File tree

4 files changed

+178
-4
lines changed

4 files changed

+178
-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: 159 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,56 @@
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-reply-top-divider {
98+
margin-bottom: 0;
99+
border-bottom: none !important;
100+
}
101+
102+
.requests-reply-container {
103+
padding-top: 0.5rem;
104+
background-color: #f9f9f9;
105+
}
106+
107+
.requests-comment-fake-reply {
108+
display: flex;
109+
align-items: center;
110+
padding: @eventPadding;
111+
padding-top: 0;
112+
113+
.requests-avatar-container {
114+
margin-top: 0;
115+
}
116+
117+
.requests-comment-fake-reply-input {
118+
width: 100%;
119+
120+
&:disabled {
121+
// This is overriden to `opacity: 1 !important` in the Invenio Theme so we need a clearer visual effect
122+
opacity: 0.45 !important;
123+
}
124+
}
48125
}
49126

50127
.requests-event-inner-container {
@@ -72,7 +149,6 @@
72149
flex: 1;
73150
border: @defaultBorder;
74151
border-radius: @defaultBorderRadius;
75-
padding: 0.5 * @defaultPadding;
76152
background-color: @white;
77153
position: relative;
78154

@@ -94,6 +170,10 @@
94170
}
95171
}
96172

173+
.button.requests-reply-expand {
174+
margin-left: @eventPadding;
175+
}
176+
97177
&.requests-action-event {
98178
border: 0;
99179
display: flex;
@@ -103,6 +183,17 @@
103183
margin-right: 0.5 * @defaultMargin;
104184
}
105185
}
186+
187+
&.requests-reply-event {
188+
border: none;
189+
padding: 0;
190+
margin-left: 0.5rem;
191+
}
192+
193+
p.requests-event-body-deleted {
194+
font-style: italic;
195+
color: @mutedTextColor;
196+
}
106197
}
107198

108199
.requests-action-event-icon {
@@ -113,6 +204,66 @@
113204
background-color: @white;
114205
}
115206
}
207+
208+
.requests-comment-fake-reply {
209+
display: flex;
210+
align-items: center;
211+
212+
.requests-avatar-container {
213+
margin-top: 0;
214+
}
215+
}
216+
217+
.requests-reply-count {
218+
background-color: @primaryColor;
219+
color: white;
220+
padding: 2px 4px;
221+
border-radius: @defaultBorderRadius;
222+
font-weight: normal;
223+
// Default font Helvetica has non-standard metrics so doesn't look middle-aligned on Firefox
224+
font-family: sans-serif;
225+
font-size: 0.75rem;
226+
}
227+
228+
.requests-reply-caret {
229+
margin-left: 2px !important;
230+
// The button styles add a right margin when the `right` class is added, despite that just being
231+
// part of the icon name.
232+
margin-right: 0 !important;
233+
}
234+
235+
.requests-reply-load-more {
236+
// Padding + width of avatar + padding on right-side of avatar + margin on left-side of main content
237+
margin-left: calc(@eventPadding + 28px + 1em + 0.5rem);
238+
margin-top: 0.5rem;
239+
margin-bottom: 0.5rem;
240+
position: relative;
241+
color: @linkColor;
242+
font-weight: normal;
243+
244+
&::before {
245+
content: "";
246+
position: absolute;
247+
display: block;
248+
top: 0;
249+
bottom: 0;
250+
// Margin on left-side of main content, padding on right-side of avatar, half width of line
251+
left: calc(-1rem - 1em);
252+
width: 2px;
253+
background: linear-gradient(to bottom, white, @borderColor);
254+
// Full height of the comment + the margin of the next comment
255+
height: calc(100% + 1rem);
256+
}
257+
258+
@media screen and (max-width: @largestMobileScreen) {
259+
& {
260+
margin: 0.5rem @eventPadding;
261+
&::before {
262+
display: none;
263+
}
264+
}
265+
}
266+
}
116267
}
117268
.ui.feed.last-page .requests-event-item:first-child .requests-event-container {
118269
padding-top: @defaultPadding;
@@ -134,6 +285,10 @@
134285
vertical-align: @userImageVerticalAlign;
135286
}
136287

288+
.event > .content {
289+
margin: @eventPadding;
290+
}
291+
137292
/*--------------
138293
Inline Date
139294
---------------*/
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)