Skip to content

Commit 9cac6d7

Browse files
committed
feat(css): styles for quote replies
* Remove padding from popup to make the button more sleek * Reduce the default margin/padding on blockquotes to make nested quotes look neater. * Change text color within blockquotes to be a muted gray.
1 parent ff948e8 commit 9cac6d7

File tree

3 files changed

+127
-1
lines changed

3 files changed

+127
-1
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
@@ -76,3 +76,20 @@
7676
}
7777
}
7878
}
79+
80+
.ui.button.text-only {
81+
padding: @verticalPadding @textOnlyHorizontalPadding;
82+
transform: translateX(-@textOnlyHorizontalPadding);
83+
84+
&:not(:hover):not(:active):not(:focus) {
85+
background: none;
86+
}
87+
88+
&:hover:not(:active), &:focus:not(:active) {
89+
background-color: @backgroundColor;
90+
}
91+
92+
&:active {
93+
background-color: @hoverBackgroundColor;
94+
}
95+
}

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: 109 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
position: relative;
99
padding: @defaultPadding 0;
1010

11-
&::before {
11+
&:not(.reply)::before {
1212
position: absolute;
1313
top: 0;
1414
bottom: 0;
@@ -27,11 +27,20 @@
2727
padding-top: 0;
2828
}
2929

30+
&.reply {
31+
padding: 0;
32+
margin-top: 1rem;
33+
34+
.requests-avatar-container {
35+
margin-top: 0;
36+
}
37+
}
3038
}
3139

3240
.requests-avatar-container {
3341
padding-right: 0.5em;
3442
margin-top: 1rem;
43+
position: relative;
3544

3645
@media screen and (max-width: @largestMobileScreen) {
3746
margin-top: 0;
@@ -41,6 +50,26 @@
4150
max-height: 40px;
4251
width: auto;
4352
}
53+
54+
&.has-line::before {
55+
content: "";
56+
position: absolute;
57+
display: block;
58+
top: 0;
59+
bottom: 0;
60+
// Half the width of the avatar minus the width of the line
61+
left: calc(1em - 1px);
62+
width: 1px;
63+
background-color: @borderColor;
64+
// Full height of the comment + the margin of the next comment
65+
height: calc(100% + 1rem);
66+
67+
@media screen and (max-width: @largestMobileScreen) {
68+
& {
69+
display: none;
70+
}
71+
}
72+
}
4473
}
4574

4675
.requests-event-inner-container {
@@ -78,6 +107,16 @@
78107

79108
.text {
80109
width: auto;
110+
111+
&.extra blockquote {
112+
margin-left: 0.5rem;
113+
padding-left: 0.75rem;
114+
color: @mutedTextColor;
115+
116+
& > blockquote {
117+
margin-left: 0;
118+
}
119+
}
81120
}
82121

83122
&.requests-action-event {
@@ -89,6 +128,12 @@
89128
margin-right: 0.5 * @defaultMargin;
90129
}
91130
}
131+
132+
&.requests-reply-event {
133+
border: none;
134+
padding: 0;
135+
margin-left: 0.5rem;
136+
}
92137
}
93138

94139
.requests-action-event-icon {
@@ -99,6 +144,61 @@
99144
background-color: @white;
100145
}
101146
}
147+
148+
.requests-comment-fake-reply {
149+
display: flex;
150+
align-items: center;
151+
152+
.requests-avatar-container {
153+
margin-top: 0;
154+
}
155+
}
156+
157+
.requests-reply-count {
158+
background-color: @primaryColor;
159+
color: white;
160+
padding: 2px 4px;
161+
border-radius: @defaultBorderRadius;
162+
font-weight: normal;
163+
// Default font Helvetica has non-standard metrics so doesn't look middle-aligned on Firefox
164+
font-family: sans-serif;
165+
font-size: 0.75rem;
166+
}
167+
168+
.requests-reply-caret {
169+
margin-left: 2px !important;
170+
// The button styles add a right margin when the `right` class is added, despite that just being
171+
// part of the icon name.
172+
margin-right: 0 !important;
173+
}
174+
175+
.requests-reply-load-more {
176+
// Width of avatar + padding on right-side of avatar + margin on left-side of main content
177+
margin-left: calc(2em + 1.25em + 0.5rem);
178+
179+
&::before {
180+
content: "";
181+
position: absolute;
182+
display: block;
183+
top: 0;
184+
bottom: 0;
185+
// Margin on left-side of main content, padding on right-side of avatar, quarter of avatar width, width of line
186+
left: calc(-0.5rem - 1.5em - 1px);
187+
width: 1px;
188+
background-color: @borderColor;
189+
// Full height of the comment + the margin of the next comment
190+
height: calc(100% + 1rem);
191+
}
192+
193+
@media screen and (max-width: @largestMobileScreen) {
194+
& {
195+
margin-left: 0;
196+
&::before {
197+
display: none;
198+
}
199+
}
200+
}
201+
}
102202
}
103203

104204
.ui.feed {
@@ -160,6 +260,7 @@
160260
border-left: @extraTextPointer;
161261
font-size: @extraTextFontSize;
162262
line-height: @extraTextLineHeight;
263+
163264
}
164265

165266
/*--------------
@@ -233,4 +334,11 @@
233334
}
234335
}
235336

337+
.ui.popup.requests-event-body-popup {
338+
padding: 0;
339+
border: none;
236340

341+
.ui.button {
342+
margin: 0;
343+
}
344+
}

0 commit comments

Comments
 (0)