-
Notifications
You must be signed in to change notification settings - Fork 66
use table column alignments when available #441
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
Conversation
|
@swift-ci Please test |
dobromir-hristov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great. Left a small comment, which may not be a problem, seeing as the snapshots have been created properly.
src/components/ContentNode.vue
Outdated
| const cellAttrs = attrs; | ||
| const align = alignments[cellIndex] || TableColumnAlignments.unset; | ||
| if (align !== TableColumnAlignments.unset) cellAttrs.class = `${align}-cell`; | ||
| return createElement(element, { attrs: { ...cellAttrs, colspan, rowspan } }, ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think classes have their own dedicated key they should be passed through - https://v2.vuejs.org/v2/guide/render-function.html#The-Data-Object-In-Depth
| const cellAttrs = attrs; | |
| const align = alignments[cellIndex] || TableColumnAlignments.unset; | |
| if (align !== TableColumnAlignments.unset) cellAttrs.class = `${align}-cell`; | |
| return createElement(element, { attrs: { ...cellAttrs, colspan, rowspan } }, ( | |
| const align = alignments[cellIndex] || TableColumnAlignments.unset; | |
| let classes = null; | |
| if (align !== TableColumnAlignments.unset) classes = `${align}-cell`; | |
| return createElement(element, { attrs: { ...attrs, colspan, rowspan }, class: classes }, ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks nicer! I was wondering if there was a specific property for CSS classes, but i didn't dig deep enough to see it. I've pushed up this change. Thanks!
rdar://100337272
Co-authored-by: Dobromir Hristov <[email protected]>
1baf42d to
661095e
Compare
|
@swift-ci Please test |
Bug/issue #, if applicable: rdar://100337272
Summary
This PR takes a new
alignmentsproperty from Render JSON and adds new styles to table cells to control their text alignments.Dependencies
swiftlang/swift-docc#389
Testing
See the testing instructions from the linked Swift-DocC PR.
Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
npm test, and it succeeded