PortableInfobox/resources/PortableInfobox.less

534 lines
9.3 KiB
Plaintext
Raw Normal View History

.prefixer( @property; @value; @prefixes: webkit, moz, ms; @unprefixed: true ) {
.prefixer-loop( @propety; @value; @prefixes; @i: length( @prefixes ) ) when ( @i > 0 ) {
@prefix: extract( @prefixes, @i );
-@{prefix}-@{property}: @value;
.prefixer-loop( @propety; @value; @prefixes; ( @i - 1 ) );
}
.prefixer-loop( @property; @value; @prefixes );
& when ( @unprefixed ) {
@{property}: @value;
}
}
.flexbox( @flex-direction: row ) {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
& when ( @flex-direction = row ) {
.prefixer( box-orient; horizontal; webkit, ms; false );
}
& when ( @flex-direction = column ) {
.prefixer( box-orient; vertical; webkit, ms; false );
}
.prefixer( flex-direction; @flex-direction; webkit, ms );
}
2018-08-26 10:13:26 +00:00
.flex-wrap( @value: wrap ) {
.prefixer( flex-wrap; @value );
}
.flex-basis( @value ) {
-ms-flex-preferred-size: @value;
.prefixer( flex-basis; @value; webkit, moz );
}
.flex-grow( @value ) {
-ms-flex-positive: @value;
.prefixer( flex-grow; @value; webkit, moz );
}
.flex-shrink( @value ) {
-ms-flex-negative: @value;
.prefixer( flex-shrink; @value; webkit, moz );
}
2018-08-26 10:13:26 +00:00
.hyphens( @value ) {
& when ( @value = auto ) {
word-wrap: break-word;
}
& when ( @value = none ) {
word-wrap: normal;
}
.prefixer( hyphens; @value );
}
.transform( @value ) {
.prefixer( transform; @value );
}
@pi-background: #f8f9fa;
@pi-secondary-background: #eaecf0;
@pi-border-color: #a2a9b1;
@pi-item-spacing: 5px 10px;
@pi-margin: 15px;
@pi-width: 270px;
2018-07-25 14:36:56 +00:00
:root {
--pi-background: @pi-background;
--pi-secondary-background: @pi-secondary-background;
--pi-border-color: @pi-border-color;
--pi-item-spacing: @pi-item-spacing;
--pi-margin: @pi-margin;
--pi-width: @pi-width;
2018-07-25 14:36:56 +00:00
}
.portable-infobox {
background: @pi-background;
background: var( --pi-background );
2018-07-25 14:36:56 +00:00
clear: right;
float: right;
2018-08-01 10:48:50 +00:00
font-size: .85em;
margin: 0 0 @pi-margin @pi-margin;
margin: 0 0 var( --pi-margin ) var( --pi-margin );
width: @pi-width;
width: var( --pi-width );
2018-08-07 12:13:14 +00:00
2018-08-01 10:48:50 +00:00
.pi-border-color {
border-color: @pi-border-color;
border-color: var( --pi-border-color );
2018-08-01 10:48:50 +00:00
}
.pi-secondary-background {
background-color: @pi-secondary-background;
background-color: var( --pi-secondary-background );
2018-08-01 10:48:50 +00:00
}
.pi-secondary-font {
margin: 0;
padding: 0;
}
.pi-item-spacing {
padding: @pi-item-spacing;
padding: var( --pi-item-spacing );
2018-08-01 10:48:50 +00:00
}
2018-08-07 12:13:14 +00:00
2018-08-01 10:48:50 +00:00
.pi-title {
2018-07-25 14:36:56 +00:00
border: 0;
margin: 0;
2018-07-31 10:29:24 +00:00
font-family: inherit;
2018-08-01 10:48:50 +00:00
font-size: 1.75em;
line-height: 1.5;
2018-07-25 14:36:56 +00:00
}
2018-08-01 10:48:50 +00:00
.pi-header {
2018-07-25 14:36:56 +00:00
border: 0;
margin: 0;
2018-08-01 10:48:50 +00:00
font-family: inherit;
font-size: 1.2em;
font-weight: bold;
line-height: 1.3;
}
2018-08-12 13:56:54 +00:00
.pi-media {
2018-08-01 10:48:50 +00:00
margin: 0;
max-width: 100%;
text-align: center;
2018-07-25 14:36:56 +00:00
}
.pi-data-label {
2018-08-01 10:48:50 +00:00
font-size: inherit;
line-height: inherit;
2018-07-25 14:36:56 +00:00
}
.pi-data-value {
2021-10-02 23:39:16 +00:00
flex-basis: 200px;
-webkit-flex-basis: 200px;
-moz-flex-basis: 200px;
> :not( ul ),
li {
2018-07-25 14:36:56 +00:00
margin: 0;
}
2018-08-01 10:48:50 +00:00
ol {
2018-07-25 14:36:56 +00:00
list-style-position: inside;
}
}
>.pi-item:last-child {
border-bottom: 0;
}
}
2019-03-24 21:36:04 +00:00
.pi-section-navigation {
.flexbox();
.flex-wrap();
justify-content: center;
width: 100%;
.portable-infobox & {
margin: 0 -1px;
padding: 2px 0 1px;
list-style: none;
text-align: center;
}
.client-nojs & {
display: none;
}
.pi-section-tab {
border-width: 1px;
border-style: solid;
border-color: @pi-secondary-background;
border-color: var( --pi-secondary-background );
box-sizing: border-box;
cursor: pointer;
display: inline-block;
margin: -1px -1px 0 0;
max-width: 50%;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: bottom;
white-space: nowrap;
&.pi-section-active, &.current {
background: @pi-secondary-background;
background: var( --pi-secondary-background );
font-weight: bold;
}
}
}
.client-js {
.pi-section-content {
display: none;
&.pi-section-active {
display: block
}
}
}
2018-07-25 14:36:56 +00:00
.pi {
2018-08-12 13:56:54 +00:00
&-media-collection {
overflow: hidden;
margin: 0;
&-tabs {
2019-03-24 21:36:04 +00:00
&:extend( .pi-section-navigation );
.portable-infobox & {
&:extend( .portable-infobox .pi-section-navigation );
}
.client-nojs & {
display: none;
}
2018-08-12 13:56:54 +00:00
}
&-tab-content {
display: none;
&.current {
2019-03-24 21:36:04 +00:00
display: block;
}
}
.pi-tab-link {
&:extend( .pi-section-navigation .pi-section-tab );
&.current {
&:extend( .pi-section-navigation .pi-section-tab.pi-section-active );
2018-07-25 14:36:56 +00:00
}
}
}
2018-08-12 13:56:54 +00:00
&-image-thumbnail {
max-width: @pi-width;
max-width: var( --pi-width );
2018-08-12 13:56:54 +00:00
height: auto;
}
2018-08-07 12:13:14 +00:00
&-video-player {
width: @pi-width;
width: var( --pi-width );
2018-08-07 12:13:14 +00:00
height: auto;
display: block;
2018-08-07 12:13:14 +00:00
}
2018-08-12 10:46:37 +00:00
&-audio-player {
width: @pi-width;
width: var( --pi-width );
2018-08-12 10:46:37 +00:00
&::-webkit-media-controls-enclosure {
border-radius: 0;
}
}
2018-07-25 14:36:56 +00:00
&-caption {
.hyphens( auto );
2018-07-25 14:36:56 +00:00
color: #808080;
2018-08-01 10:48:50 +00:00
font-size: 1em;
2018-07-25 14:36:56 +00:00
font-style: italic;
word-wrap: break-word;
}
&-data {
border-bottom-style: solid;
border-bottom-width: 1px;
.flexbox();
2018-07-25 14:36:56 +00:00
box-sizing: border-box;
overflow: hidden;
width: 100%;
&-label {
.flex-basis( 90px );
.hyphens( auto );
2018-07-25 14:36:56 +00:00
overflow: hidden;
word-wrap: break-word;
}
&-value {
.flex-grow( 1 );
.hyphens( auto );
2018-07-25 14:36:56 +00:00
padding-left: 0;
word-break: break-word;
&:not( :first-child ) {
2018-07-25 14:36:56 +00:00
padding-left: 10px;
}
}
}
&-group {
border-bottom-style: solid;
border-bottom-width: 1px;
>.pi-item:last-child {
border-bottom: 0;
}
}
&-horizontal-group {
border-spacing: 0;
table-layout: fixed;
text-align: center;
width: 100%;
.pi-header {
text-align: left;
}
2018-08-01 10:48:50 +00:00
thead + tbody .pi-data-value {
padding-top: 0;
}
2018-07-25 14:36:56 +00:00
.pi-horizontal-group-item {
vertical-align: top;
&:not( :first-child ) {
2018-07-25 14:36:56 +00:00
border-left-style: solid;
border-left-width: 1px;
}
}
.pi-data-label {
padding-bottom: 0;
}
}
&-smart {
&-data {
&-label:not( :first-child ),
&-value:not( :first-child ) {
border-color: @pi-border-color;
border-color: var( --pi-border-color );
2018-07-25 14:36:56 +00:00
border-left-style: solid;
border-left-width: 1px;
}
}
&-group {
border-bottom-style: solid;
border-bottom-width: 1px;
.flexbox( column );
2018-07-25 14:36:56 +00:00
text-align: center;
&:after {
content: "";
clear: both;
display: block;
}
2018-07-25 14:36:56 +00:00
&:last-child {
border-bottom: 0;
}
&-head,
2018-08-01 10:48:50 +00:00
&-body {
.flexbox();
}
&-head + .pi-smart-group-body .pi-data-value {
padding-top: 0;
2018-07-25 14:36:56 +00:00
}
2018-07-31 10:29:24 +00:00
.pi-smart-data-label {
padding-bottom: 0;
box-sizing: border-box;
.flex-grow( 1 );
.flex-basis( auto );
float: left;
2018-07-31 10:29:24 +00:00
}
.pi-smart-data-value {
box-sizing: border-box;
.flex-basis( auto );
float: left;
2018-07-31 10:29:24 +00:00
}
2018-07-25 14:36:56 +00:00
}
}
&-layout-stacked {
.pi-data {
display: block;
}
.pi-data-value:not( :only-child ) {
2018-07-25 14:36:56 +00:00
padding-left: 10px;
}
}
2018-08-07 12:13:14 +00:00
2018-08-01 10:48:50 +00:00
}
@media screen and ( min-width: 720px ) {
.client-js {
.pi-collapse .pi-header:first-child {
padding-right: 25px;
position: relative;
&::after {
border-color: currentColor;
border-style: solid;
border-width: 2px 2px 0 0;
content: '';
display: block;
height: 5px;
right: 10px;
position: absolute;
top: 50%;
width: 5px;
2018-08-28 13:27:22 +00:00
.transform( rotate( -45deg ) );
margin-top: -3px;
}
2018-08-01 10:48:50 +00:00
}
.pi-collapse-closed {
.pi-header:first-child::after {
2018-08-28 13:27:22 +00:00
.transform( rotate( 135deg ) );
margin-top: -5px;
2018-07-25 14:36:56 +00:00
}
> :nth-child( n+2 ) {
2018-08-01 10:48:50 +00:00
display: none;
2018-07-25 14:36:56 +00:00
}
.pi-horizontal-group {
thead,
tbody {
display: none;
}
}
2018-07-25 14:36:56 +00:00
}
}
}
2018-08-01 10:48:50 +00:00
@media screen and ( max-width: 720px ) {
2018-08-01 10:48:50 +00:00
.portable-infobox {
float: none;
width: initial;
font-size: initial;
margin: 0;
2018-08-03 12:26:17 +00:00
}
.pi-title {
text-align: center;
}
2019-03-24 21:36:04 +00:00
.pi-data-label {
flex-basis: 30%
}
2018-08-03 12:26:17 +00:00
2019-03-24 21:36:04 +00:00
.pi-media-collection-tabs li,
.pi-section-navigation li {
li { flex: 1 50% }
2018-08-01 10:48:50 +00:00
}
}
/* PI errors */
2018-08-27 07:27:55 +00:00
.pi-error-info.pi-error-info {
2018-07-28 09:36:14 +00:00
background-color: #f33;
color: #fff;
font-size: 18px;
line-height: 28px;
margin: 0;
padding: 30px 50px;
}
2018-08-27 07:27:55 +00:00
.pi-debug.pi-debug {
2018-07-28 09:36:14 +00:00
background-color: #e6e6e6;
font-family: monospace;
list-style: none;
margin: 0;
width: 100%;
li {
2018-07-25 14:36:56 +00:00
margin: 0;
}
2018-07-28 09:36:14 +00:00
.error {
font-size: inherit;
2018-07-25 14:36:56 +00:00
}
}
.pi-debug-line {
.flexbox();
2018-07-25 14:36:56 +00:00
&-number {
box-sizing: border-box;
.flex-basis( 50px );
.flex-shrink( 0 );
2018-07-25 14:36:56 +00:00
padding-left: 10px;
}
&-code {
box-sizing: border-box;
}
}
.pi-debug-error-message {
background-color: #000;
color: #fff;
font-family: Helvetica,Arial,sans-serif;
margin: 20px 0 10px 25px;
padding: 10px 15px;
position: relative;
width: 400px;
&:before {
border-bottom: 15px solid black;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
content: '';
display: block;
height: 0;
left: 25px;
position: absolute;
top: -15px;
width: 0;
}
.pi-debug-error-message-item {
margin: 5px 0;
}
}
/* Skin specific fixes */
.skin-minerva {
2019-03-24 21:36:04 +00:00
.portable-infobox {
font-size: .8em;
}
.pi-caption {
margin: @pi-item-spacing;
margin: var( --pi-item-spacing );
}
.pi-horizontal-group {
display: table;
margin: 0;
width: 100% !important;
.pi-header {
display: table-caption;
}
}
.pi-navigation {
box-sizing: border-box;
width: 100%;
float: none;
}
}
.skin-timeless #mw-content-text {
2019-03-24 21:36:04 +00:00
.portable-infobox {
font-size: .8em;
}
.pi-title {
border: none;
font-size: 1.75em;
line-height: 1.5;
margin: 0;
}
.pi-header {
border: none;
font-family: inherit;
font-size: 1.2em;
font-weight: bold;
line-height: 1.3;
margin: 0;
}
.pi-data-label {
font-family: inherit;
font-size: inherit;
font-weight: bold;
line-height: inherit;
margin: 0;
}
2021-10-02 23:39:16 +00:00
}