PortableInfobox/styles/PortableInfobox.scss
2015-06-10 17:31:29 +02:00

204 lines
4.1 KiB
SCSS

@import 'skins/shared/color';
@import 'skins/shared/mixins/columns';
@import 'skins/shared/mixins/flexbox';
$infobox-width: 270px; // temporary value used to mach with Khal Drogo Infobox
$infobox-margin: 15px;
$infobox-item-margin: 5px;
$infobox-background: mix($color-page, $color-links, 92%);
$infobox-section-header-background: transparentize($color-links, .9);
$infobox-debug-line-number-width: 50px;
$infobox-debug-error-msg-color: white;
$infobox-debug-error-msg-bg: black;
.portable-infobox {
background-color: $infobox-background;
clear: right;
float: right;
margin: 0 0 $infobox-margin $infobox-margin;
width: $infobox-width;
// TODO: experimental wide infobox styles (remove or refactor)
&.wide-infobox {
@include column-count(3);
@include column-gap($infobox-item-margin * 2);
clear: both;
float: none;
margin: 0;
width: 100%;
.portable-infobox-item:not(.item-type-title) {
@include column-break-inside(avoid);
}
.item-type-title {
@include column-span(all);
}
}
.portable-infobox-item-margins {
padding: $infobox-item-margin $infobox-item-margin * 4 $infobox-item-margin $infobox-item-margin * 2;
}
.portable-infobox-image-wrapper {
text-align: center;
}
.portable-infobox-image-caption {
color: $color-alternate-text;
font-size: 12px;
font-style: italic;
text-align: left;
}
.portable-infobox-header-background {
background-color: $infobox-section-header-background;
color: $color-alternate-text;
}
.portable-infobox-header-font {
font-size: 12px;
font-weight: bold;
line-height: 18px;
margin-top: 0;
}
.portable-infobox-header,
.portable-infobox-title {
border: 0;
margin: 0;
padding: 0;
}
.portable-infobox-title {
font-size: 18px;
line-height: 28px;
}
.item-type-key-val:not(:last-of-type) {
border-bottom: 1px solid $infobox-section-header-background;
}
.portable-infobox-item-label {
margin-top: 0;
}
.portable-infobox-item-value {
padding-left: $infobox-item-margin * 2;
// experiment with removing margins on all children of data value
> * {
margin: 0;
}
ul,
ol {
list-style-position: inside;
}
}
.portable-infobox-comparison {
border-collapse: collapse;
width: 100%;
}
.portable-infobox-comparison-set {
display: block;
}
.portable-infobox-comparison-set-header {
box-sizing: border-box;
display: block;
text-align: left;
width: 100%;
}
.portable-infobox-comparison-item {
box-sizing: border-box;
vertical-align: top;
width: $infobox-width / 2;
&:first-of-type {
border-right: 1px solid $infobox-section-header-background;
}
.item-type-key-val {
border-bottom: 0;
padding-right: $infobox-item-margin * 2;
}
}
}
.WikiaArticle {
.portable-infobox-error-info {
background-color: $color-error;
color: $infobox-debug-error-msg-color;
font-size: 18px;
line-height: 28px;
margin: 0;
padding: $infobox-margin * 2 $infobox-debug-line-number-width;
}
.portable-infobox-debug {
background-color: $color-unified-module-background;
font-family: monospace;
list-style: none;
margin: 0;
width: 100%;
li {
margin: 0;
}
.error {
font-size: inherit;
}
}
}
.portable-infobox-debug-line {
@include flexbox();
}
.portable-infobox-debug-line-number,
.portable-infobox-debug-line-code {
box-sizing: border-box;
}
.portable-infobox-debug-line-number {
@include flex-basis($infobox-debug-line-number-width);
@include flex-shrink(0);
padding-left: $infobox-item-margin * 2;
}
.portable-infobox-debug-error-massage {
background-color: $infobox-debug-error-msg-bg;
color: $infobox-debug-error-msg-color;
font-family: Helvetica, Arial, sans-serif;
margin: 20px 0 10px 25px;
padding: $infobox-item-margin * 2 $infobox-item-margin * 3;
position: relative;
width: 400px;
&:before {
border-bottom: $infobox-margin solid $infobox-debug-error-msg-bg;
border-left: $infobox-margin solid transparent;
border-right: $infobox-margin solid transparent;
content: '';
display: block;
height: 0;
left: 25px;
position: absolute;
top: -$infobox-margin;
width: 0;
}
.portable-infobox-debug-error-massage-item {
margin: $infobox-item-margin 0;
}
}