Skip to content

Commit

Permalink
Merge pull request #173 from moderntribe/feature/MOOSE-181/table-over…
Browse files Browse the repository at this point in the history
…flow

[MOOSE-181] Table Overflow
  • Loading branch information
GeoffDusome authored Jan 3, 2025
2 parents a9827f8 + 212e459 commit 14abe96
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). Each changelog entry gets prefixed with the category of the item (Added, Changed, Depreciated, Removed, Fixed, Security).

## [2025.01]
- Add ability for table blocks to utilize the `overflow-x` set on them by setting a `min-width` property for the `table` element within the table block.
- Enabled background images on the Group block; We should try to use this instead of the Cover block where possible.

## [2024.08]
Expand Down
1 change: 1 addition & 0 deletions wp-content/themes/core/assets/pcss/layout/_variables.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
:root {
--grid-margin: var(--wp--custom--spacing--grid-margin);
--grid-gutter: var(--wp--custom--spacing--grid-gutter);
--grid-content-width: var(--wp--style--global--content-size);
--grid-wide-width: var(--wp--style--global--wide-size);

/* this should match the "Grid" size defined in the
Expand Down
9 changes: 9 additions & 0 deletions wp-content/themes/core/blocks/core/table/style.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@
that wraps the table element */
margin-bottom: 0;

/* overflow-x is already set on table elements by default in WP
so we don't need to set it here, but we do need to prevent
tables from being able to reduce their width so that the
overlfow actually applies on tables with minimal content.
This can be updated as needed per project. */
table {
min-width: var(--grid-content-width);
}

& th {
border-top: 0;
padding-top: 0;
Expand Down

0 comments on commit 14abe96

Please sign in to comment.