| 1 |
@import 'mediawiki.skin.variables.less'; |
| 2 |
@import 'mediawiki.mixins.less'; |
| 3 |
@import '../echo.variables.less'; |
| 4 |
@import '../echo.mixins.less'; |
| 5 |
|
| 6 |
.mw-echo-ui-notificationItemWidget { |
| 7 |
display: block; |
| 8 |
background-color: @notification-item-background-read; |
| 9 |
position: relative; |
| 10 |
white-space: normal; |
| 11 |
padding: 0.8em 1em 0.5em 1em; |
| 12 |
box-sizing: border-box; |
| 13 |
|
| 14 |
&:not( :last-child ) { |
| 15 |
border-bottom: @border-width-base @border-style-base @border-color-subtle; |
| 16 |
} |
| 17 |
|
| 18 |
&:not( [ href ] ) { |
| 19 |
// Items without a primary URL are not clickable |
| 20 |
cursor: default; |
| 21 |
} |
| 22 |
|
| 23 |
label { |
| 24 |
// Reset browser default of cursor:default; |
| 25 |
cursor: inherit; |
| 26 |
} |
| 27 |
|
| 28 |
&:focus { |
| 29 |
text-decoration: none; |
| 30 |
box-shadow: @box-shadow-inset-medium @box-shadow-color-progressive--focus; |
| 31 |
outline: @outline-base--focus; |
| 32 |
} |
| 33 |
|
| 34 |
&:hover { |
| 35 |
text-decoration: none; |
| 36 |
// FIXME: Non-standard design token. Replace with a standard token and revise skin-theme rules. |
| 37 |
background-color: #ececec; |
| 38 |
|
| 39 |
.skin-theme-clientpref-night & { |
| 40 |
@media screen { |
| 41 |
background-color: @background-color-interactive-subtle; |
| 42 |
} |
| 43 |
} |
| 44 |
|
| 45 |
.skin-theme-clientpref-os & { |
| 46 |
@media screen and ( prefers-color-scheme: dark ) { |
| 47 |
background-color: @background-color-interactive-subtle; |
| 48 |
} |
| 49 |
} |
| 50 |
} |
| 51 |
|
| 52 |
&-unread { |
| 53 |
background-color: @background-color-base; |
| 54 |
|
| 55 |
&:hover { |
| 56 |
background-color: @background-color-interactive-subtle; |
| 57 |
} |
| 58 |
} |
| 59 |
|
| 60 |
> a, |
| 61 |
&:hover > a { |
| 62 |
text-decoration: none; |
| 63 |
} |
| 64 |
|
| 65 |
// Dynamic-action messages in mw.notify |
| 66 |
&-notify { |
| 67 |
&-title { |
| 68 |
font-weight: bold; |
| 69 |
} |
| 70 |
} |
| 71 |
|
| 72 |
&-icon { |
| 73 |
position: absolute; |
| 74 |
|
| 75 |
img { |
| 76 |
height: 30px; |
| 77 |
width: 30px; |
| 78 |
} |
| 79 |
} |
| 80 |
|
| 81 |
&-content { |
| 82 |
display: block; |
| 83 |
box-sizing: border-box; |
| 84 |
// The icon is 30px |
| 85 |
margin-left: 30px; |
| 86 |
padding-left: 0.8em; |
| 87 |
|
| 88 |
&-message { |
| 89 |
line-height: 1.3em; |
| 90 |
// Compensate for the placement of the 'mark as read' |
| 91 |
// button, so the message is not stretched past it. |
| 92 |
// The 'mark as read' circle is placed with a right |
| 93 |
// margin of -1em |
| 94 |
padding-right: 1em; |
| 95 |
// break-word rules are inconsistent accross browsers |
| 96 |
// these three rules should cover the main use cases |
| 97 |
// with major browser support |
| 98 |
word-break: break-word; |
| 99 |
word-wrap: break-word; |
| 100 |
overflow-wrap: break-word; |
| 101 |
|
| 102 |
&-header { |
| 103 |
color: @color-emphasized; |
| 104 |
} |
| 105 |
|
| 106 |
&-body { |
| 107 |
color: @notification-body-color; |
| 108 |
margin-top: 4px; |
| 109 |
|
| 110 |
// In the popup only, truncate the text to one-line |
| 111 |
// with ellipses |
| 112 |
.mw-echo-ui-notificationBadgeButtonPopupWidget-popup & { |
| 113 |
.text-overflow( @visible: false ); |
| 114 |
} |
| 115 |
} |
| 116 |
} |
| 117 |
|
| 118 |
&-actions { |
| 119 |
display: flex; |
| 120 |
align-items: flex-end; |
| 121 |
font-size: 0.9em; |
| 122 |
margin-top: 0.8em; |
| 123 |
|
| 124 |
& > &-buttons.oo-ui-buttonSelectWidget { |
| 125 |
display: flex; |
| 126 |
overflow: hidden; |
| 127 |
|
| 128 |
> .oo-ui-buttonOptionWidget { |
| 129 |
min-width: 7em; |
| 130 |
overflow: hidden; |
| 131 |
|
| 132 |
.oo-ui-labelElement-label { |
| 133 |
text-overflow: ellipsis; |
| 134 |
overflow: hidden; |
| 135 |
display: inline-block; |
| 136 |
} |
| 137 |
} |
| 138 |
} |
| 139 |
|
| 140 |
&-button { |
| 141 |
margin-right: 1.2em; |
| 142 |
} |
| 143 |
|
| 144 |
.mw-echo-ui-menuItemWidget-prioritized { |
| 145 |
// Option widget already has some right padding |
| 146 |
margin-right: 0.6em; |
| 147 |
} |
| 148 |
|
| 149 |
&-menu { |
| 150 |
vertical-align: bottom; |
| 151 |
padding: 0; |
| 152 |
|
| 153 |
> .oo-ui-buttonElement-button { |
| 154 |
.mw-echo-ui-mixin-hover-opacity(); |
| 155 |
} |
| 156 |
} |
| 157 |
|
| 158 |
&-timestamp { |
| 159 |
flex-grow: 1; |
| 160 |
text-align: right; |
| 161 |
vertical-align: bottom; |
| 162 |
color: @color-emphasized; |
| 163 |
opacity: @opacity-low; |
| 164 |
white-space: nowrap; |
| 165 |
} |
| 166 |
} |
| 167 |
} |
| 168 |
|
| 169 |
&-markAsReadButton { |
| 170 |
float: right; |
| 171 |
font-size: 1em; |
| 172 |
// Compensate for the padding in the item widget |
| 173 |
margin-top: -0.8em; |
| 174 |
margin-right: -1em; |
| 175 |
padding: 0; |
| 176 |
|
| 177 |
.mw-echo-ui-notificationItemWidget-bundled & { |
| 178 |
margin-top: 0; |
| 179 |
} |
| 180 |
} |
| 181 |
|
| 182 |
// Table layout only for the content inside bundles |
| 183 |
&-bundled { |
| 184 |
display: table; |
| 185 |
width: 100%; |
| 186 |
padding: 0.5em; |
| 187 |
|
| 188 |
.mw-echo-ui-notificationItemWidget-content { |
| 189 |
display: table-row; |
| 190 |
padding-left: 0.5em + 1.5em; |
| 191 |
|
| 192 |
.mw-echo-ui-notificationItemWidget { |
| 193 |
// CSS table layout |
| 194 |
&-icon, |
| 195 |
&-content-message, |
| 196 |
&-content-actions, |
| 197 |
&-markAsReadButton { |
| 198 |
display: table-cell; |
| 199 |
vertical-align: top; |
| 200 |
} |
| 201 |
|
| 202 |
// Positioning fixes for bundled items |
| 203 |
&-icon { |
| 204 |
position: relative; |
| 205 |
padding-right: 0.5em; |
| 206 |
|
| 207 |
img { |
| 208 |
height: 20px; |
| 209 |
width: 20px; |
| 210 |
} |
| 211 |
} |
| 212 |
|
| 213 |
&-content-message { |
| 214 |
display: table-cell; |
| 215 |
padding-right: 0.5em; |
| 216 |
width: 100%; |
| 217 |
|
| 218 |
&-header { |
| 219 |
width: 100%; |
| 220 |
|
| 221 |
&-wrapper { |
| 222 |
position: relative; |
| 223 |
} |
| 224 |
|
| 225 |
// Bundled notifications don't have bodies, only headers, |
| 226 |
// so they use <em> to designate excerpts. Use the body color |
| 227 |
// for these. |
| 228 |
em { |
| 229 |
color: @notification-body-color; |
| 230 |
font-style: normal; |
| 231 |
} |
| 232 |
} |
| 233 |
} |
| 234 |
|
| 235 |
&-content-actions { |
| 236 |
&-row { |
| 237 |
display: table-row; |
| 238 |
} |
| 239 |
|
| 240 |
&-buttons { |
| 241 |
display: table-cell; |
| 242 |
vertical-align: middle; |
| 243 |
} |
| 244 |
|
| 245 |
&-menu { |
| 246 |
display: table-cell; |
| 247 |
vertical-align: middle; |
| 248 |
} |
| 249 |
|
| 250 |
&-timestamp { |
| 251 |
float: none; |
| 252 |
display: table-cell; |
| 253 |
vertical-align: middle; |
| 254 |
padding-right: 0.5em; |
| 255 |
white-space: nowrap; |
| 256 |
} |
| 257 |
} |
| 258 |
|
| 259 |
&-markAsReadButton { |
| 260 |
display: table-cell; |
| 261 |
vertical-align: top; |
| 262 |
float: none; |
| 263 |
} |
| 264 |
} |
| 265 |
} |
| 266 |
} |
| 267 |
|
| 268 |
&-initiallyUnseen { |
| 269 |
animation-name: unseen-fadeout-to-read; |
| 270 |
animation-duration: 0.5s; |
| 271 |
animation-delay: 2s; |
| 272 |
animation-timing-function: ease-out; |
| 273 |
animation-fill-mode: both; |
| 274 |
|
| 275 |
&.mw-echo-ui-notificationItemWidget-unread { |
| 276 |
animation-name: unseen-fadeout-to-unread; |
| 277 |
} |
| 278 |
} |
| 279 |
|
| 280 |
// NOTE: The internal styling of the notifications is outside this file, because |
| 281 |
// it also affects the notifications in Special:Notifications |
| 282 |
// These styles are in modules/nojs/ext.echo.notifications.less |
| 283 |
} |
| 284 |
|
| 285 |
@keyframes unseen-fadeout-to-unread { |
| 286 |
from { |
| 287 |
background-color: @notification-background-unseen; |
| 288 |
} |
| 289 |
|
| 290 |
to { |
| 291 |
background-color: @notification-background-unread; |
| 292 |
} |
| 293 |
} |
| 294 |
|
| 295 |
@keyframes unseen-fadeout-to-read { |
| 296 |
from { |
| 297 |
background-color: @notification-background-unseen; |
| 298 |
} |
| 299 |
|
| 300 |
to { |
| 301 |
background-color: @notification-background-read; |
| 302 |
} |
| 303 |
} |