mediawiki-extensions-Multim.../resources/mmv/ui/mmv.ui.metadataPanel.less
Gergő Tisza 0e9cfb5de0 Fix clipping of text when metadata panel is closed
The first item (license) of the list on the right side of the
metadata panel wasn't large enough (due to some recent global style
change that I couldn't track down) and the top of the next item was
visible. Added fixed height to prevent that. Also centered the
credit/license text which looked sloppy.

Bug: T101391
Change-Id: I848917ebb9c378c3210646486a87a6497d31a168
2015-06-19 00:42:35 +00:00

318 lines
6.4 KiB
Plaintext

@import "../mmv.globals";
@import "../mmv.mixins";
@info-box-color: #FFFFFF;
@info-box-border-color: #DDDDDD;
@info-box-border-shadow-color: #C9C9C9;
@secondary-text-color: rgb(136, 136, 136);
@panel-below-fold-background-color: #f5f5f5;
@fold-separator-border-width: 1px;
@vertical-padding: 10px;
@horizontal-padding: 20px;
@space-above-credit: 2px;
.mw-mmv-info-box {
display: inline-block;
overflow: hidden;
border: 1px solid @info-box-border-color;
border-bottom: 2px solid @info-box-border-shadow-color;
.box-round(3px);
background-color: @info-box-color;
}
.mw-mmv-title-contain {
position: relative;
}
.mw-mmv-title-para {
@height: @metadatabar-above-fold-inner-height - 2 * @vertical-padding; // needs explicit height for text truncation logic
margin: 0 0 @vertical-padding; // use margin instead of padding for bottom so text is not visible
padding: @vertical-padding @horizontal-padding 0 @horizontal-padding;
height: @height;
line-height: @height;
&.mw-mmv-ttf-normal {
font-size: 20px;
}
&.mw-mmv-title-small {
font-size: 18px;
}
&.mw-mmv-title-smaller {
@vertical-padding: 6px;
@height: @metadatabar-above-fold-inner-height - 2 * @vertical-padding;
height: @height;
margin: 0 0 @horizontal-padding;
padding: @vertical-padding @horizontal-padding 0 @horizontal-padding ;
line-height: floor(@height / 2); // two lines
font-size: 16px;
}
// this should be after the size-specific styles so it can override any height set there
&.mw-mmv-ttf-untruncated {
height: auto;
}
.mw-mmv-ttf-ellipsis {
right: @horizontal-padding;
bottom: 3px;
background-color: @panel-above-fold-background-color; // clip text
&:before {
.fade-out-horizontal(@panel-above-fold-background-color);
}
}
}
.mw-mmv-credit {
@padding-right: 5px;
margin: 0;
color: #555;
padding: 0 0 @padding-right;
font-size: 0.85em;
.metadata-panel-is-closed {
height: @metadatabar-below-fold-pushup-height - @space-above-credit - @fold-separator-border-width; // needs explicit height for text truncation logic
line-height: @metadatabar-below-fold-pushup-height - @space-above-credit - @fold-separator-border-width;
}
&.empty {
height: 0.85em;
}
.mw-mmv-ttf-ellipsis {
right: @padding-right;
bottom: 13px;
background-color: @panel-below-fold-background-color; // clip text
&:before {
.fade-out-horizontal(@panel-below-fold-background-color);
}
}
}
.mw-mmv-source-author {
line-height: 1.8em;
}
.mw-mmv-title {
// this element is the click target for text untruncation; with the default display:inline it would be an
// inline box which can have "gaps" between the lines, making clicks seem to have no effect
display: inline-block;
}
.mw-mmv-image-metadata {
width: 100%;
position: relative;
margin-top: -@metadatabar-below-fold-pushup-height;
border-top: @fold-separator-border-width solid #ddd;
background-color: @panel-below-fold-background-color;
padding-top: @space-above-credit;
.jq-fullscreened & {
// Make sure content fits into the screen. This assumes no paddings.
height: @metadatabar-below-fold-pushup-height - @fold-separator-border-width - @space-above-credit;
overflow: hidden;
}
.jq-fullscreened .mw-mmv-untruncated & {
height: auto;
}
}
.mw-mmv-author:before {
display: inline-block;
vertical-align: middle;
height: 16px;
width: 16px;
content: ' ';
margin-right: 7px;
margin-bottom: 2px;
background-size: contain;
background-position: center center;
background-repeat: no-repeat;
/* @embed */
background-image: url(img/user-ltr.svg);
}
.mw-mmv-image-desc-div {
overflow-y: auto;
&.empty {
display: none;
}
}
.mw-mmv-image-desc-div,
.mw-mmv-image-links-div {
display: inline-block;
vertical-align: top;
}
.mw-mmv-image-desc-div {
max-height: 150px;
margin-bottom: 15px;
}
@littlefont: 0.85em;
@mediumfont: 0.95em;
.mw-mmv-image-desc {
font-size: @mediumfont;
color: #555555;
}
.mw-mmv-image-links {
margin: 0 20px;
li {
list-style: none;
font-size: @littlefont;
color: #3f4040;
&.empty {
display: none;
}
// Make sure the next list item is not visible when the
// metadata panel is closed
.metadata-panel-is-closed &.mw-mmv-license-li {
height: @metadatabar-below-fold-pushup-height - @space-above-credit;
line-height: @metadatabar-below-fold-pushup-height - @space-above-credit;
}
&:before {
display: inline-block;
vertical-align: middle;
height: 16px;
width: 16px;
content: ' ';
margin-right: 7px;
margin-bottom: 2px;
background-size: contain;
background-position: right center;
background-repeat: no-repeat;
}
&.mw-mmv-license-li:before {
/* @embed */
background-image: url(img/license.svg);
}
&.mw-mmv-license-li.cc-license:before {
/* @embed */
background-image: url(img/cc.svg);
}
&.mw-mmv-license-li.pd-license:before {
/* @embed */
background-image: url(img/pd.svg);
}
&.mw-mmv-filename-li:before {
/* @embed */
background-image: url(img/file.svg);
}
&.mw-mmv-datetime-li:before {
/* @embed */
background-image: url(img/time.svg);
}
&.mw-mmv-username-li:before {
/* @embed */
background-image: url(img/uploader-ltr.svg);
width: 18px;
margin-right: 5px;
}
&.mw-mmv-location-li:before {
/* @embed */
background-image: url(img/location.svg);
}
&.empty:before {
background-image: none !important;
}
}
}
.mw-mmv-license-contain,
.mw-mmv-license {
text-align: right;
}
.mw-mmv-filename-prefix {
padding-right: 4px;
cursor: text;
}
.mw-mmv-title-para,
.mw-mmv-credit,
.mw-mmv-image-desc {
padding-left: @horizontal-padding;
}
.mw-mmv-about-links {
font-size: @littlefont;
padding: @horizontal-padding;
width: 50%;
}
.mw-mmv-label {
color: #333333;
margin-left: 6px;
.box-round(3px);
padding: 2px 5px;
background-color: #dddddd;
font-size: 0.9em;
&:hover {
background-color: #c9c9c9;
}
}
.mw-mmv-image-metadata-column {
float: left;
}
.mw-mmv-image-metadata-desc-column {
width: 66.5%;
}
.mw-mmv-image-metadata-links-column {
max-width: 33.5%;
width: 25%;
text-align: right;
float: right;
transition: width 0.2s ease-out;
.mw-mmv-untruncated & {
width: 33.5%;
text-align: left;
}
}
.mw-mmv-restriction-label {
&, &:hover {
background-color: #ffcc66;
}
cursor: default;
}
.mw-mmv-permission-link {
cursor: pointer;
.jq-fullscreened & {
display: none;
}
}
.mw-mmv-optout-link.pending {
cursor: wait;
color: #555;
}
.mw-mmv-about-links {
clear: both;
}