akkoma-fe/src/components/notifications/notifications.scss

175 lines
2.8 KiB
SCSS
Raw Normal View History

2016-11-27 19:00:44 +00:00
@import '../../_variables.scss';
.Notifications {
&:not(.minimal) {
// a bit of a hack to allow scrolling below notifications
padding-bottom: 15em;
}
2016-11-27 19:00:44 +00:00
2018-08-20 17:45:54 +00:00
.loadmore-error {
2018-10-07 16:59:22 +00:00
color: $fallback--text;
color: var(--text, $fallback--text);
2018-08-20 17:45:54 +00:00
}
.notification {
position: relative;
.notification-overlay {
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 0;
2018-11-21 15:22:05 +00:00
pointer-events: none;
}
&.unseen {
.notification-overlay {
background-image: linear-gradient(135deg, var(--badgeNotification, $fallback--cRed) 4px, transparent 10px)
}
}
}
}
.notification {
box-sizing: border-box;
&:hover .animated.Avatar {
canvas {
display: none;
}
img {
visibility: visible;
2018-04-09 16:43:31 +00:00
}
}
2018-04-09 16:43:31 +00:00
&:last-child .Notification {
border-bottom: none;
}
.non-mention {
display: flex;
flex: 1;
flex-wrap: nowrap;
padding: 0.6em;
min-width: 0;
2020-06-13 10:09:55 +00:00
.avatar-container {
width: 32px;
height: 32px;
}
2020-06-13 10:09:55 +00:00
2020-07-27 22:27:11 +00:00
--link: var(--faintLink);
--text: var(--faint);
}
2016-11-27 18:44:56 +00:00
.follow-request-accept {
&:hover {
color: $fallback--text;
color: var(--text, $fallback--text);
}
}
.follow-request-reject {
&:hover {
color: $fallback--cRed;
color: var(--cRed, $fallback--cRed);
}
}
2019-12-10 15:00:10 +00:00
.follow-text, .move-text {
padding: 0.5em 0;
overflow-wrap: break-word;
display: flex;
justify-content: space-between;
.follow-name {
display: block;
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
2020-07-27 22:27:11 +00:00
/* TODO cleanup this */
.Status {
flex: 1;
}
2017-08-10 16:17:40 +00:00
time {
white-space: nowrap;
}
.notification-right {
flex: 1;
padding-left: 0.8em;
min-width: 0;
Stop notifications boxes from change size over time Notifications about favourites and follows use .notification-right, notifications about replies instead use .heading-right. Previously only the former set a min-width, however the chosen value of 3em was too small to fit the worst case. As a consequence, when the timestamp text changes over time, its element width changes, which may result in neighbouring text (no longer) needing to wrap to a new line in turn changing the size of the whole notification box pushing older notification boxes down/up. These constant movements at the side of the screen can be quite annoying and confusing when the cause cannot be immediately discerned. Avoid this, by reserving enough space for any timestamp. For English, the worst case is the five-character 'XXmin', since the short identifier for minutes is the longest with three letters. With two exceptions, all other current localisation also do not exceed three letters in any short unit identifier up to days. However, some localisations (e.g. Polish) additionally insert a space between numerical value and unit. This matches SI recommendations pushing the worst case to 6 characters. 6 characters will be sufficient for timestamps up to 3 weeks in all languages (minus prev exceptions), which seems reasonable enough as beyond this timestamps rarely change anyway. The aforementioned exceptions being Vietnamese and Occitan, but in the current localisation all or the relevant short unit identifiers are identical to the long forms indicating this is just due to incomplete translation. Indeed, Vietnamese Wikipedia (read through machine translation) suggests “ph” is commonly used as unit identifiers for minutes, but the current localisation fully spells it out as “phút”.
2023-10-18 20:51:24 +00:00
}
2020-07-08 11:11:42 +00:00
Stop notifications boxes from change size over time Notifications about favourites and follows use .notification-right, notifications about replies instead use .heading-right. Previously only the former set a min-width, however the chosen value of 3em was too small to fit the worst case. As a consequence, when the timestamp text changes over time, its element width changes, which may result in neighbouring text (no longer) needing to wrap to a new line in turn changing the size of the whole notification box pushing older notification boxes down/up. These constant movements at the side of the screen can be quite annoying and confusing when the cause cannot be immediately discerned. Avoid this, by reserving enough space for any timestamp. For English, the worst case is the five-character 'XXmin', since the short identifier for minutes is the longest with three letters. With two exceptions, all other current localisation also do not exceed three letters in any short unit identifier up to days. However, some localisations (e.g. Polish) additionally insert a space between numerical value and unit. This matches SI recommendations pushing the worst case to 6 characters. 6 characters will be sufficient for timestamps up to 3 weeks in all languages (minus prev exceptions), which seems reasonable enough as beyond this timestamps rarely change anyway. The aforementioned exceptions being Vietnamese and Occitan, but in the current localisation all or the relevant short unit identifiers are identical to the long forms indicating this is just due to incomplete translation. Indeed, Vietnamese Wikipedia (read through machine translation) suggests “ph” is commonly used as unit identifiers for minutes, but the current localisation fully spells it out as “phút”.
2023-10-18 20:51:24 +00:00
.heading-right, .notification-right {
2020-07-08 11:11:42 +00:00
.timeago {
Stop notifications boxes from change size over time Notifications about favourites and follows use .notification-right, notifications about replies instead use .heading-right. Previously only the former set a min-width, however the chosen value of 3em was too small to fit the worst case. As a consequence, when the timestamp text changes over time, its element width changes, which may result in neighbouring text (no longer) needing to wrap to a new line in turn changing the size of the whole notification box pushing older notification boxes down/up. These constant movements at the side of the screen can be quite annoying and confusing when the cause cannot be immediately discerned. Avoid this, by reserving enough space for any timestamp. For English, the worst case is the five-character 'XXmin', since the short identifier for minutes is the longest with three letters. With two exceptions, all other current localisation also do not exceed three letters in any short unit identifier up to days. However, some localisations (e.g. Polish) additionally insert a space between numerical value and unit. This matches SI recommendations pushing the worst case to 6 characters. 6 characters will be sufficient for timestamps up to 3 weeks in all languages (minus prev exceptions), which seems reasonable enough as beyond this timestamps rarely change anyway. The aforementioned exceptions being Vietnamese and Occitan, but in the current localisation all or the relevant short unit identifiers are identical to the long forms indicating this is just due to incomplete translation. Indeed, Vietnamese Wikipedia (read through machine translation) suggests “ph” is commonly used as unit identifiers for minutes, but the current localisation fully spells it out as “phút”.
2023-10-18 20:51:24 +00:00
display: inline-block;
min-width: 6em;
2020-07-08 11:11:42 +00:00
text-align: right;
}
}
.emoji-reaction-emoji {
2022-04-20 20:44:33 +00:00
font-size: 1.3em;
}
.notification-details {
2022-04-20 20:44:33 +00:00
min-width: 0;
word-wrap: break-word;
line-height: var(--post-line-height);
position: relative;
overflow: hidden;
width: 100%;
2018-04-10 19:12:59 +00:00
flex: 1 1 0;
display: flex;
flex-wrap: nowrap;
justify-content: space-between;
.name-and-action {
flex: 1;
2018-04-14 05:59:55 +00:00
overflow: hidden;
text-overflow: ellipsis;
}
.username {
font-weight: bolder;
2018-04-14 05:59:55 +00:00
max-width: 100%;
text-overflow: ellipsis;
white-space: nowrap;
}
.timeago {
2022-04-20 20:44:33 +00:00
margin-right: 0.2em;
}
.status-content {
margin: 0;
max-height: 300px;
}
2018-04-09 16:43:31 +00:00
h1 {
word-break: break-all;
margin: 0 0 0.3em;
padding: 0;
font-size: 1em;
line-height: 1.5;
small {
font-weight: lighter;
}
2018-04-09 16:43:31 +00:00
}
p {
margin: 0;
margin-top: 0;
margin-bottom: 0.3em;
}
2018-04-09 16:43:31 +00:00
}
}