mediawiki-skins-Citizen/resources/skins.citizen.styles/skinning/content.tables.less

129 lines
2.5 KiB
Plaintext
Raw Normal View History

/*
* Citizen
*
* Module: mediawiki.skinning.content.tables
* Version: REL1_39
*
* Date: 2024-02-26
*/
// TODO: Revisit on MW 1.43 since Minerva table styles are merged upstream
.wikitable {
display: block;
max-width: max-content; // Needed for the border
margin: var( --space-md ) 0;
overflow-x: auto;
font-size: var( --font-size-small );
border-collapse: collapse;
border-color: var( --border-color-base );
border-radius: var( --border-radius-medium );
box-shadow: var( --box-shadow-border );
caption {
padding: var( --space-xs ) var( --space-sm );
font-size: var( --font-size-medium );
font-weight: var( --font-weight-semibold );
color: var( --color-emphasized );
text-align: start;
}
tbody tr {
&:hover {
background-color: var( --background-color-button-quiet--hover );
}
}
th {
2022-11-15 18:16:39 +00:00
text-align: start;
}
th,
td {
padding: var( --space-xs ) var( --space-sm );
}
tr {
&:first-of-type {
th,
td {
&:first-child {
border-left-width: 0;
border-top-left-radius: var( --border-radius-medium );
}
&:last-child {
border-right-width: 0;
border-top-right-radius: var( --border-radius-medium );
}
}
}
&:last-of-type {
th,
td {
&:first-child {
border-left-width: 0;
border-bottom-left-radius: var( --border-radius-medium );
}
&:last-child {
border-right-width: 0;
border-bottom-right-radius: var( --border-radius-medium );
}
}
}
}
/* Add border separator between tr, thead, tbody, tfoot */
> :not( [ hidden ] ) ~ :not( [ hidden ] ),
> * > :not( [ hidden ] ) ~ :not( [ hidden ] ) {
border-top: var( --border-width-base ) solid var( --border-color-base );
}
/* Reset border radius between thead tbody, tbody tfoot, etc. */
> :has( + :not( :empty ) ) {
tr:last-of-type {
th,
td {
&:first-child {
border-bottom-left-radius: var( --border-radius-sharp );
}
&:last-child {
border-bottom-right-radius: var( --border-radius-sharp );
}
}
}
}
> * + :not( :empty ) {
tr:first-of-type {
th,
td {
&:first-child {
border-top-left-radius: var( --border-radius-sharp );
}
&:last-child {
border-top-right-radius: var( --border-radius-sharp );
}
}
}
}
&--border {
tr {
> :not( [ hidden ] ) ~ :not( [ hidden ] ) {
border-right: var( --border-width-base ) solid var( --border-color-base );
border-left: var( --border-width-base ) solid var( --border-color-base );
}
}
}
&--stripe {
tbody tr:nth-child( even ) {
background-color: var( --color-surface-2 );
}
}
}