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

[WIP] Change table to definition list in MetadataTable #774

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jwhitley
Copy link

This PR is a "proposal in code" that illustrates switching MetadataTable to use definition lists rather than tables. The current form is deliberately minimal to make absolutely clear what I'm proposing, but I wouldn't consider it complete. See below for possible additional work.

The benefits of using <dl> versus <table> include:

  • Description lists' default styling works better in a narrow column like Kanban's lists. See screenshots below
  • Can be styled exactly like table for backward compatibility
  • Allows obsidian-kanban, themes, and user custom styles greater flexibility in changing the presentation of MetadataTable

Motivating use case: When I discovered this feature, I was already using Kanban for project notes with a Complete when:: metadata tag. But the use of tables forces a side-by-side presentation of each key/value pair, which was visually awkward for long keys (like this one) AND for long value text.

Here's a "before" image of the current codebase (v1.5.2) using <table>:
Screenshot 2023-04-29 at 11 33 16 AM

For comparison, here's how it looks with <dl>, but zero styling work:
Screenshot 2023-04-29 at 11 33 18 AM

If this seems like a good direction, likely next steps are:

  • Fix the key styling, as the key's color: var(--text-muted) styling was dropped
  • If strong backward compatibility is desired, restyle the description list to match the existing table
  • (OPTIONAL) Add a simple switch to toggle between table-style (side by side) and dl-style (over-under) presentation
  • (OPTIONAL) Add a style selector to let the user choose between multiple out-of-the-box styles
  • Optimize the dl-style presentation specifically for Kanban's lists

Does this seem like a desirable approach? If so, what changes would you like to land this plugin?

This begins the process of switching MetadataTable to use definition
lists rather than tables.
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.

1 participant