feat(wikitable): use box-shadow instead of border hacks to build table border

This commit is contained in:
alistair3149 2024-07-07 01:51:22 -04:00
parent c2523b141c
commit 442c272cab
No known key found for this signature in database
5 changed files with 12 additions and 13 deletions

View file

@ -9,9 +9,6 @@
* Base theme * Base theme
*/ */
:root { :root {
--box-shadow-card: @box-shadow-card;
--box-shadow-dialog: @box-shadow-dialog;
--font-grade: 0; --font-grade: 0;
/* Foreground Colors */ /* Foreground Colors */

View file

@ -14,9 +14,10 @@
margin: var( --space-md ) 0; margin: var( --space-md ) 0;
overflow-x: auto; overflow-x: auto;
font-size: var( --font-size-small ); font-size: var( --font-size-small );
border-spacing: 0; border-collapse: collapse;
border: 1px solid var( --border-color-base ); border-color: var( --border-color-base );
border-radius: var( --border-radius-medium ); border-radius: var( --border-radius-medium );
box-shadow: var( --box-shadow-border );
caption { caption {
padding-right: var( --space-sm ); padding-right: var( --space-sm );

View file

@ -34,6 +34,14 @@
--background-color-icon: ~'rgba( 0, 0, 0, var( --opacity-icon-base ) )'; --background-color-icon: ~'rgba( 0, 0, 0, var( --opacity-icon-base ) )';
--background-color-icon--hover: ~'rgba( 0, 0, 0, var( --opacity-icon-base--hover ) )'; --background-color-icon--hover: ~'rgba( 0, 0, 0, var( --opacity-icon-base--hover ) )';
--background-color-icon--active: ~'rgba( 0, 0, 0, var( --opacity-icon-base--active ) )'; --background-color-icon--active: ~'rgba( 0, 0, 0, var( --opacity-icon-base--active ) )';
/* Box shadow */
--box-shadow-border: var( --border-color-base ) 0 0 0 1px inset;
// Based on https://web.dev/building-a-color-scheme/#rad-shadow
// TODO: Refactor this to support filter drop-shadow
--box-shadow-card:
0 2.8px 2.2px -4px ~'hsla( var(--surface-shadow), calc(var(--shadow-strength) + .03) )',0 6.7px 5.3px -4px ~'hsla( var(--surface-shadow), calc(var(--shadow-strength) + .01) )',0 12.5px 10px -4px ~'hsla( var(--surface-shadow), calc(var(--shadow-strength) + .02) )',0 22.3px 17.9px -4px ~'hsla( var(--surface-shadow), calc(var(--shadow-strength) + .02) )',0 41.8px 33.4px -4px ~'hsla( var(--surface-shadow), calc(var(--shadow-strength) + .03) )',0 100px 80px -4px ~'hsla( var(--surface-shadow), var(--shadow-strength) )';
--box-shadow-dialog:
0 2.8px 2.2px ~'hsla( var(--surface-shadow), calc(var(--shadow-strength) + .03) )',0 6.7px 5.3px ~'hsla (var(--surface-shadow), calc(var(--shadow-strength) + .01) )',0 12.5px 10px ~'hsla( (--surface-shadow), calc(var(--shadow-strength) + .02) )',0 22.3px 17.9px ~'hsla( var(--surface-shadow), calc(var(--shadow-strength) + .02) )',0 41.8px 33.4px ~'hsla( var(--surface-shadow), calc(var(--shadow-strength) + .03) )',0 100px 80px ~'hsla( var(--surface-shadow), var(--shadow-strength) )';
/* Font */ /* Font */
// Used as base unit to caluclate font-size // Used as base unit to caluclate font-size
--font-size-base: 1rem; --font-size-base: 1rem;

View file

@ -109,13 +109,6 @@
@transition-hover: 150ms cubic-bezier( 0.215, 0.61, 0.355, 1 ); @transition-hover: 150ms cubic-bezier( 0.215, 0.61, 0.355, 1 );
@transition-menu: 250ms cubic-bezier( 0.4, 0, 0.2, 1 ); @transition-menu: 250ms cubic-bezier( 0.4, 0, 0.2, 1 );
/* Shadow */
/* Box shadow */
// Based on https://web.dev/building-a-color-scheme/#rad-shadow
// TODO: Refactor this to support filter drop-shadow
@box-shadow-card: 0 2.8px 2.2px -4px ~'hsla(var(--surface-shadow), calc(var(--shadow-strength) + .03))', 0 6.7px 5.3px -4px ~'hsla(var(--surface-shadow), calc(var(--shadow-strength) + .01))', 0 12.5px 10px -4px ~'hsla(var(--surface-shadow), calc(var(--shadow-strength) + .02))', 0 22.3px 17.9px -4px ~'hsla(var(--surface-shadow), calc(var(--shadow-strength) + .02))', 0 41.8px 33.4px -4px ~'hsla(var(--surface-shadow), calc(var(--shadow-strength) + .03))', 0 100px 80px -4px ~'hsla(var(--surface-shadow), var(--shadow-strength))';
@box-shadow-dialog: 0 2.8px 2.2px ~'hsla(var(--surface-shadow), calc(var(--shadow-strength) + .03))', 0 6.7px 5.3px ~'hsla(var(--surface-shadow), calc(var(--shadow-strength) + .01))', 0 12.5px 10px ~'hsla(var(--surface-shadow), calc(var(--shadow-strength) + .02))', 0 22.3px 17.9px ~'hsla(var(--surface-shadow), calc(var(--shadow-strength) + .02))', 0 41.8px 33.4px ~'hsla(var(--surface-shadow), calc(var(--shadow-strength) + .03))', 0 100px 80px ~'hsla(var(--surface-shadow), var(--shadow-strength))';
/* /*
* Framework * Framework
*/ */

View file

@ -28,7 +28,7 @@
display: block; display: block;
max-width: none; max-width: none;
line-height: var( --line-height-sm ); line-height: var( --line-height-sm );
border: 0; box-shadow: none;
tbody { tbody {
display: grid; display: grid;