Created
January 9, 2025 21:33
-
-
Save benpearson/397b07926effe1c14b8311fd73775f48 to your computer and use it in GitHub Desktop.
Table core block: Styles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ------------------------------------------------------------ *\ | |
Mixins: Table core block | |
Included in frontend and admin styles. | |
\* ------------------------------------------------------------ */ | |
@mixin wp-block-table { | |
@include blocks-core__margin-vertical__large; | |
// font-weight: 400; | |
line-height: 1.6; | |
// Reset WP core admin styles | |
thead, | |
th, | |
td { | |
border: none; | |
} | |
th, | |
td { | |
padding: 0; | |
} | |
td { | |
vertical-align: top; | |
} | |
// Include caption styles | |
figcaption { | |
@include figcaption; | |
} | |
margin-top: 35px; | |
margin-bottom: 35px; | |
// color: $c-purple-darker; | |
@include breakpoint-down(mobile){ | |
margin-right: -20px; | |
overflow: auto; | |
padding-right: 20px; | |
} | |
table, | |
figcaption { | |
@include breakpoint-down(mobile){ | |
width: 690px; | |
} | |
} | |
th, | |
td { | |
padding: 15px 30px; | |
border-right: 2px solid $c-white; | |
@include breakpoint-down(tablet){ | |
padding: 10px 20px; | |
} | |
&:last-child { | |
border-right: 0; | |
} | |
&.has-text-align-center { | |
text-align: center; | |
} | |
} | |
th { | |
background: #7b20d6; // update | |
font-size: 18px; | |
letter-spacing: 0.03em; | |
font-weight: 700; | |
text-align: left; | |
color: $c-white; | |
@include breakpoint-down(tablet){ | |
font-size: 16px; | |
} | |
@include breakpoint-down(mobile){ | |
font-size: 15px; | |
letter-spacing: 0.02em; | |
} | |
&:last-child { | |
border-right: 0; | |
} | |
} | |
tbody { | |
tr { | |
&:nth-child(odd) { | |
background: $c-white; | |
} | |
&:nth-child(even) { | |
// background: $c-lt-purple; | |
} | |
} | |
} | |
} | |
/** | |
* Frontend styles. | |
* | |
* Don't edit here, edit mixins used instead as they are used in the editor too. | |
*/ | |
@mixin wp-block-table__frontend { | |
& > .wp-block-table { | |
@include wp-block-table; | |
@include link-inline; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ------------------------------------------------------------ *\ | |
Core block: Table | |
Editor styles only | |
\* ------------------------------------------------------------ */ | |
.wp-block-table { | |
@include wp-block-table; | |
@include link-inline; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment