Skip to content

Commit

Permalink
feat(wikitable): ✨ add border to wikitables
Browse files Browse the repository at this point in the history
Adding borders to wikitables to promote better readability.
This is a complete rewrite of the styles so there might be unexpected issues.
  • Loading branch information
alistair3149 committed Feb 26, 2024
1 parent c9f665e commit 9bd23fd
Showing 1 changed file with 59 additions and 7 deletions.
66 changes: 59 additions & 7 deletions resources/skins.citizen.styles/skinning/content.tables.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
* Module: mediawiki.skinning.content.tables
* Version: REL1_39
*
* Date: 2022-11-14
* Date: 2024-02-26
*/

.wikitable {
margin: var( --space-md ) 0;
border-collapse: collapse;
border-spacing: 0;

caption {
padding-right: var( --space-sm );
Expand All @@ -24,11 +24,6 @@
}

tbody tr {
// Divider
+ tr {
border-top: 1px solid var( --border-color-base );
}

&:hover {
background-color: var( --background-color-quiet--hover );
}
Expand All @@ -50,4 +45,61 @@
td {
padding: var( --space-xs ) var( --space-sm );
}

tr {
th,
td {
border-top: 1px solid var( --border-color-base );

&:first-of-type {
border-left: 1px solid var( --border-color-base );
}

&:last-of-type {
border-right: 1px solid var( --border-color-base );
}
}

&:first-of-type {
th,
td {
border-top: 0;

&:not( :first-child ):not( :last-child ) {
border-top: 1px solid var( --border-color-base );
}

&:first-child {
border-top: 1px solid var( --border-color-base );
border-top-left-radius: var( --border-radius--medium );
}

&:last-child {
border-top: 1px solid var( --border-color-base );
border-top-right-radius: var( --border-radius--medium );
}
}
}

&:last-of-type {
th,
td {
&:first-child {
border-left: 1px solid var( --border-color-base );
border-bottom: 1px solid var( --border-color-base );
border-bottom-left-radius: var( --border-radius--medium );
}

&:not(:first-child):not(:last-child) {
border-bottom: 1px solid var( --border-color-base );
}

&:last-child {
border-right: 1px solid var( --border-color-base );
border-bottom: 1px solid var( --border-color-base );
border-bottom-right-radius: var( --border-radius--medium );
}
}
}
}
}

0 comments on commit 9bd23fd

Please sign in to comment.