Skip to content

[AX] <table> should be taken out of <figure> and the <figcaption> should become the table’s <caption> #692

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

Closed
wants to merge 5 commits into from

Conversation

marinaaisa
Copy link
Member

Bug/issue #30234820, if applicable:

Summary

Tables were contained within a <figure> element. However, there is no need for this and it was making the tables much less accessible. Tables should stand on their own with the previous <figcaption> as the table’s <caption>.

This is a improved implementation of #40 that was not taking into account #404 and had to be reverted.

Dependencies

NA

Testing

Use the provided fixture folder:
manual-fixtures.zip

Steps:

  1. Run VUE_APP_DEV_SERVER_PROXY=/path/to/manual-fixtures/ npm run serve
  2. Go to http://localhost:8080/documentation/framework/sloth
  3. Assert that tables' markup is as described in the Summary.

Checklist

  • Added tests
  • Ran npm test, and it succeeded
  • Updated documentation if necessary

@marinaaisa
Copy link
Member Author

@swift-ci test

Copy link
Contributor

@dobromir-hristov dobromir-hristov left a comment

Choose a reason for hiding this comment

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

Left a few minor comments, but I think we are in a good shape here.

Copy link
Contributor

@dobromir-hristov dobromir-hristov left a comment

Choose a reason for hiding this comment

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

LGTM

@marinaaisa
Copy link
Member Author

@swift-ci test

@marinaaisa
Copy link
Member Author

@swift-ci test

Copy link
Contributor

@mportiz08 mportiz08 left a comment

Choose a reason for hiding this comment

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

I think this resolves the previous issue with crashing regression for certain content.

I did find a couple of very minor styling regressions with the font and spacing that we should fix before merging.

@@ -53,4 +58,8 @@ export default {
/deep/ p {
display: inline-block;
}

caption {
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 we only want a top margin to be applied if it is preceded by some other content, right?

It might be worth looking at the way this is/was done for the figcaption/figure spacing in Figure.vue. It sounds like we would want to do something similar for the caption element and the contents within a table.

Copy link
Member Author

Choose a reason for hiding this comment

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

Because we are adding the caption inside the table, I couldn't apply the margin to its siblings, it won't work in a display table, so I applied it to the component itself checking if there are siblings, using the has pseudo-class. It's widely supported now (only Firefox is missing) https://caniuse.com/css-has d814cd8

Can we use has?

Copy link
Contributor

@mportiz08 mportiz08 Jun 30, 2023

Choose a reason for hiding this comment

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

I started reviewing this again, but I found out that the <caption> element has to be the first element of the <table>, regardless of whether or not it is displayed on the top or the bottom. 🤦‍♂️🥲

I was going to make some suggestions to this PR, but it turned out to be easier to just create a new PR. Hopefully we finally have it right now! #706

I also ran into issues you probably did where our normal block-level spacing helpers don't work due to specific issues with certain elements, but I was able to address them without :has().

@marinaaisa marinaaisa force-pushed the r30234820/table-caption branch from b04f493 to ce09aba Compare June 29, 2023 14:49
@marinaaisa
Copy link
Member Author

Closing in favor of #706 (review)

@marinaaisa marinaaisa closed this Jul 3, 2023
@marinaaisa marinaaisa deleted the r30234820/table-caption branch July 3, 2023 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants