Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds fixed table layout to table block #18870

Closed
wants to merge 3 commits into from
Closed

Conversation

karmatosed
Copy link
Member

I have added this to both the editor and also to the front styles. It might be a point for discussion along with should this be done, but also would the editor and theme show it?

Fixes #16045

I have added this to both the editor and also to the front styles. It might be a point for discussion along with should this be done, but also would the editor and theme show it?

Fixes #16045
@karmatosed karmatosed added the Needs Decision Needs a decision to be actionable or relevant label Dec 2, 2019
@talldan talldan added the [Block] Table Affects the Table Block label Dec 3, 2019
@talldan
Copy link
Contributor

talldan commented Dec 3, 2019

Hey @karmatosed - what are your thoughts on the existing option for Fixed Table Cells:
Screen Shot 2019-12-03 at 11 36 28 am

Is that something you think could be removed?

@karmatosed
Copy link
Member Author

@talldan I do and let me remove that from the PR.

@@ -6,6 +6,7 @@
height: auto;

table {
table-layout: fixed;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this unnecessary since style.scss is loaded in the editor?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In testing it was for me, feel free to iterate on PR if you don't find it is in testing @ZebulanStanphill

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @ZebulanStanphill is right, it shouldn't be required.

This builds on previous PR and removes option for fixed width, as it's now default.
@karmatosed karmatosed removed the Needs Decision Needs a decision to be actionable or relevant label Dec 5, 2019
Copy link
Contributor

@talldan talldan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@karmatosed This looks pretty close, a few things around the tests and deprecations might need a bit of extra work. Let me know if you'd like me to take a look at those few items.

@@ -15,10 +15,6 @@ const supports = {
const deprecated = [
{
attributes: {
hasFixedLayout: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fixed layout option shouldn't be removed from the block deprecation, it's important it remains so that old versions of the block don't receive a validation error.

theme(button) 72%
);
background-image:
linear-gradient(-45deg, theme(button) 28%, color(theme(button) shade(20%)) 28%, color(theme(button) shade(20%)) 72%, theme(button) 72%);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this shouldn't have been updated given the comment above.

@@ -4,7 +4,6 @@
"name": "core/table",
"isValid": true,
"attributes": {
"hasFixedLayout": false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should remain so that the deprecation is tested correctly.

@@ -26,7 +25,6 @@ export default function save( { attributes } ) {
const backgroundClass = getColorClassName( 'background-color', backgroundColor );

const classes = classnames( backgroundClass, {
'has-fixed-layout': hasFixedLayout,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will have to test whether this change to the save output requires a further block deprecation to be added. Often if it's only a class name change it doesn't seem to require a deprecation.

@@ -18,11 +18,6 @@ exports[`Table allows adding and deleting columns across the table header, body
<!-- /wp:table -->"
`;

exports[`Table allows cells to be selected when the cell area outside of the RichText is clicked 1`] = `
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The snapshot shouldn't have been removed as the test is still present. Instead it needs to be updated.

@@ -6,6 +6,7 @@
height: auto;

table {
table-layout: fixed;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @ZebulanStanphill is right, it shouldn't be required.

@karmatosed
Copy link
Member Author

@talldan what do you think about closing this as it's sat so long? I can always close this and we could start a fresh PR, if easier.

Base automatically changed from master to trunk March 1, 2021 15:42
@annezazu
Copy link
Contributor

Closing this out -- welcome folks to open a new one to keep it fresh, as said above!

@annezazu annezazu closed this Jul 27, 2022
@sirreal sirreal deleted the try/fixed-width-tables branch June 20, 2024 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Table Affects the Table Block
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Block Library: Table: Consider "Fixed width table cells" as default
4 participants