mediawiki-extensions-Tabber.../modules/ext.tabberNeue/ext.tabberNeue.less

199 lines
3.8 KiB
Plaintext
Raw Permalink Normal View History

2021-06-21 17:49:47 +00:00
.tabber {
2021-06-21 18:45:06 +00:00
&__header {
position: relative;
display: flex;
flex-direction: column;
2021-06-21 18:45:06 +00:00
/* defend against <section> needing 100% */
flex-shrink: 0;
2024-11-16 00:29:58 +00:00
box-shadow: inset 0 -1px 0 0 var( --border-color-base, #a2a9b1 );
2021-06-21 18:45:06 +00:00
/* fixes cross browser quarks */
min-block-size: fit-content;
button {
/* Remove all default button styles */
all: unset;
}
/* additional specificity needed after reset button styles */
& &__prev {
2021-06-21 18:45:06 +00:00
left: 0;
}
& &__next {
2021-06-21 18:45:06 +00:00
right: 0;
}
& &__prev,
& &__next {
2021-06-21 18:45:06 +00:00
position: absolute;
z-index: 1;
top: 0;
bottom: 0;
2024-11-16 00:29:58 +00:00
display: none; // Required as all:unset also unset display:none
2021-06-21 18:45:06 +00:00
width: 20px;
border-radius: 4px;
2021-06-21 18:45:06 +00:00
cursor: pointer;
&::after {
display: block;
2021-06-21 18:45:06 +00:00
width: inherit;
height: 100%;
2021-06-21 18:45:06 +00:00
background-position: center;
background-repeat: no-repeat;
background-size: 14px;
content: '';
}
}
&--prev-visible .tabber__tabs {
2021-06-21 18:45:06 +00:00
-webkit-mask-image: linear-gradient( 90deg, transparent, #000 20% );
mask-image: linear-gradient( 90deg, transparent, #000 20% );
}
&--next-visible .tabber__tabs {
2021-06-21 18:45:06 +00:00
-webkit-mask-image: linear-gradient( 90deg, #000 80%, transparent );
mask-image: linear-gradient( 90deg, #000 80%, transparent );
}
&--prev-visible.tabber__header--next-visible .tabber__tabs {
2021-06-21 18:45:06 +00:00
-webkit-mask-image: linear-gradient( 90deg, transparent, #000 20%, #000 80%, transparent );
mask-image: linear-gradient( 90deg, transparent, #000 20%, #000 80%, transparent );
}
&--prev-visible .tabber__header__prev,
&--next-visible .tabber__header__next {
display: block;
}
}
&__tab {
2024-05-27 01:54:52 +00:00
&[ aria-selected='true' ] {
box-shadow: 0 -2px 0 var( --color-progressive, #36c ) inset;
2024-05-27 01:54:52 +00:00
}
&[ aria-selected='true' ],
&[ aria-selected='true' ]:visited {
color: var( --color-progressive, #36c );
2021-06-21 18:45:06 +00:00
}
}
&__panel {
&--loading {
.tabber__transclusion {
opacity: 0.1;
a {
color: transparent;
}
a,
&::before,
&::after {
display: block;
height: 0.5em;
border-radius: 40px;
margin-top: 1em;
animation-duration: 3s;
animation-fill-mode: forwards;
animation-iteration-count: infinite;
animation-name: skeletonload;
animation-timing-function: linear;
background: #000;
2024-11-16 00:29:58 +00:00
background: linear-gradient( to right, var( --color-base, #202122 ) 8%, var( --color-subtle, #54595d ) 18%, var( --color-base, #202122 ) 33% );
}
&::before,
&::after {
content: '';
}
&::after {
width: 60%;
}
}
}
}
}
// Animations
.tabber-animations-ready {
.tabber {
2024-05-25 19:27:47 +00:00
&__header {
scroll-behavior: smooth;
}
2024-11-16 00:29:58 +00:00
/* stylelint-disable-next-line no-descending-specificity */
2024-05-25 19:27:47 +00:00
&__section,
&__tabs {
@media ( min-width: 720px ) {
scroll-behavior: smooth;
}
}
}
}
@media ( hover: none ) {
// Need extra specificity to override
.tabber {
.tabber__header {
&__prev,
&__next {
pointer-events: none; // Disable arrow button
&::after {
background-image: none; // Remove arrow icon
}
}
}
}
}
2021-06-21 18:45:06 +00:00
@media ( hover: hover ) {
.tabber {
&__header {
&__prev,
&__next {
&:hover {
2024-11-16 00:29:58 +00:00
background-color: var( --background-color-button-quiet--hover, rgba( 0, 24, 73, 0.027 ) );
}
&:active {
2024-11-16 00:29:58 +00:00
background-color: var( --background-color-button-quiet--active, rgba( 0, 24, 73, 0.082 ) );
}
}
2021-06-21 18:45:06 +00:00
}
}
2021-06-21 17:49:47 +00:00
}
@keyframes skeletonload {
0% {
background-position: 0 0;
}
100% {
background-position: 100em 0;
}
}
2024-07-14 21:55:13 +00:00
@media print {
.tabber__header {
display: none;
}
/* Show all tab contents */
.tabber__section {
/* stylelint-disable-next-line declaration-no-important */
height: auto !important;
gap: 1em;
grid-auto-flow: row;
}
/* Show tab header */
.tabber__panel::before {
display: block;
margin: 1em 0;
content: attr( data-mw-tabber-title );
font-weight: bold;
}
}