mirror of
https://github.com/StarCitizenTools/mediawiki-extensions-TabberNeue.git
synced 2024-12-21 04:15:11 +00:00
f24ddb58ee
We don't need the empty paragraph hack for non-list elements. Related: #151
227 lines
4.9 KiB
Plaintext
227 lines
4.9 KiB
Plaintext
.tabber {
|
|
// Codex tokens aren't avaliable in older MW version
|
|
--tabber-color-progressive: var( --color-progressive, #36c ); // @color-progressive
|
|
--tabber-color-progressive--hover: var( --color-progressive--hover, #447ff5 ); // @color-progressive--hover
|
|
--tabber-color-progressive--active: var( --color-progressive--active, #2a4b8d ); // @color-progressive--active
|
|
--tabber-color-base: var( --color-base, #202122 ); // @color-base
|
|
--tabber-color-subtle: var( --color-subtle, #54595d ); // @color-subtle
|
|
--tabber-background-color-button-quiet--hover: var( --background-color-button-quiet--hover, rgba( 0, 24, 73, 0.027 ) ); // @background-color-button-quiet--hover
|
|
--tabber-background-color-button-quiet--active: var( --background-color-button-quiet--active, rgba( 0, 24, 73, 0.082 ) ); // @background-color-button-quiet--active
|
|
--tabber-border-color-base: var( --border-color-base, #a2a9b1 ); // @border-color-base
|
|
--tabber-height-indicator: 2px;
|
|
position: relative;
|
|
display: flex;
|
|
|
|
/* establish primary containing box */
|
|
overflow: hidden;
|
|
flex-direction: column;
|
|
|
|
&__header {
|
|
position: relative;
|
|
display: flex;
|
|
flex-direction: column;
|
|
/* defend against <section> needing 100% */
|
|
flex-shrink: 0;
|
|
box-shadow: inset 0 -1px 0 0 var( --tabber-border-color-base );
|
|
/* 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 {
|
|
left: 0;
|
|
}
|
|
|
|
& &__next {
|
|
right: 0;
|
|
}
|
|
|
|
& &__prev,
|
|
& &__next {
|
|
position: absolute;
|
|
z-index: 1;
|
|
top: 0;
|
|
bottom: 0;
|
|
display: none;
|
|
width: 20px;
|
|
border-radius: 4px;
|
|
cursor: pointer;
|
|
|
|
&::after {
|
|
display: block;
|
|
width: inherit;
|
|
height: 100%;
|
|
background-position: center;
|
|
background-repeat: no-repeat;
|
|
background-size: 14px;
|
|
content: '';
|
|
}
|
|
}
|
|
|
|
&--prev-visible .tabber__tabs {
|
|
-webkit-mask-image: linear-gradient( 90deg, transparent, #000 20% );
|
|
mask-image: linear-gradient( 90deg, transparent, #000 20% );
|
|
}
|
|
|
|
&--next-visible .tabber__tabs {
|
|
-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 {
|
|
-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;
|
|
}
|
|
}
|
|
|
|
&__indicator {
|
|
display: none;
|
|
margin-top: ~'calc( var( --tabber-height-indicator ) * -1 )';
|
|
background: var( --tabber-color-progressive );
|
|
block-size: var( --tabber-height-indicator );
|
|
inline-size: 0;
|
|
|
|
&--visible {
|
|
display: block;
|
|
}
|
|
}
|
|
|
|
&__tab {
|
|
&[ aria-selected='true' ] {
|
|
box-shadow: 0 -2px 0 var( --color-progressive, #36c ) inset;
|
|
}
|
|
|
|
&[ aria-selected='true' ],
|
|
&[ aria-selected='true' ]:visited {
|
|
color: var( --color-progressive, #36c );
|
|
}
|
|
}
|
|
|
|
&__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;
|
|
background: linear-gradient( to right, var( --tabber-color-base ) 8%, var( --tabber-color-subtle ) 18%, var( --tabber-color-base ) 33% );
|
|
}
|
|
|
|
&::before,
|
|
&::after {
|
|
content: '';
|
|
}
|
|
|
|
&::after {
|
|
width: 60%;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// Animations
|
|
.tabber-animations-ready {
|
|
.tabber {
|
|
&__header {
|
|
scroll-behavior: smooth;
|
|
}
|
|
|
|
&__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
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@media ( hover: hover ) {
|
|
.tabber {
|
|
&__header {
|
|
&__prev,
|
|
&__next {
|
|
&:hover {
|
|
background-color: var( --tabber-background-color-button-quiet--hover );
|
|
}
|
|
|
|
&:active {
|
|
background-color: var( --tabber-background-color-button-quiet--active );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@keyframes skeletonload {
|
|
0% {
|
|
background-position: 0 0;
|
|
}
|
|
|
|
100% {
|
|
background-position: 100em 0;
|
|
}
|
|
}
|
|
|
|
@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;
|
|
}
|
|
}
|