discourse/app/assets/stylesheets/common/base/lightbox.scss
Joffrey JAFFEUX 8ea114007f
UX: adds hover effect on lightboxed images (#8416)
* UX: adds hover effect on lightboxed images

This commits also adds two scss functions:

- is-light-color-scheme()
- is-dark-color-scheme()

This hover effect won't be added on dark color schemes, as images already standout nicely on dark backgrounds.

Co-Authored-By: David Taylor <david@taylorhq.com>
2019-11-26 15:06:30 +01:00

88 lines
1.4 KiB
SCSS

$meta-element-margin: 6px;
.lightbox-wrapper .lightbox {
position: relative;
display: inline-block;
overflow: hidden;
&:hover .meta {
opacity: 0.9;
transition: opacity 0.5s;
}
}
.d-lazyload-hidden {
box-sizing: border-box;
}
.onebox img.d-lazyload-hidden {
border: 1px solid $primary-low;
}
.cooked img.d-lazyload {
transition: opacity 0.4s 0.75s ease;
}
.lightbox-wrapper {
display: inline-block;
img {
object-fit: cover;
object-position: top;
}
&,
* {
outline: 0;
}
}
.meta {
position: absolute;
bottom: 0;
width: 100%;
color: $secondary;
background: $primary;
opacity: 0;
transition: opacity 0.2s;
display: flex;
align-items: center;
.filename {
margin: $meta-element-margin;
@include ellipsis;
}
.d-icon {
margin: $meta-element-margin;
opacity: 0.8;
color: $secondary;
+ .filename {
margin-left: 0px;
}
}
.informations {
margin: $meta-element-margin;
padding-right: 20px;
color: $secondary-high;
font-size: $font-0;
flex-shrink: 0;
flex-grow: 3;
}
}
.mfp-preloader .spinner {
margin: auto;
}
@if is-light-color-scheme() {
a.lightbox {
-webkit-transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}
a.lightbox:hover {
border-radius: 5px;
box-shadow: 0 2px 5px 0 rgba($primary, 0.2),
0 2px 10px 0 rgba($primary, 0.2);
}
}