Skip to content

Refactor: Centralize Markdown table Tailwind CSS classes in config file #2

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

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

Conversation

claudemyburgh
Copy link
Member

This commit refactors the custom Markdown table renderers to fetch their Tailwind CSS class strings from a dedicated configuration file (config/tailwind_tables.php) instead of having them hardcoded.

Key changes:

  • Created config/tailwind_tables.php to store all Tailwind CSS classes for different table elements (wrapper, table, thead, tbody_row, th_head, th_body_row_header, td_cell).
  • Updated TailwindTableRenderer.php, TailwindTableSectionRenderer.php, TailwindTableRowRenderer.php, and TailwindTableCellRenderer.php to use Laravel's config() helper to retrieve these classes.
  • Fallback values (the original hardcoded classes) are provided in the config() calls to ensure stability if the config file or keys are missing.

This change improves maintainability by making it easier to view and modify table styles from a single, centralized location.

This commit refactors the custom Markdown table renderers to fetch their
Tailwind CSS class strings from a dedicated configuration file
(`config/tailwind_tables.php`) instead of having them hardcoded.

Key changes:
- Created `config/tailwind_tables.php` to store all Tailwind CSS classes
  for different table elements (wrapper, table, thead, tbody_row,
  th_head, th_body_row_header, td_cell).
- Updated `TailwindTableRenderer.php`, `TailwindTableSectionRenderer.php`,
  `TailwindTableRowRenderer.php`, and `TailwindTableCellRenderer.php` to
  use Laravel's `config()` helper to retrieve these classes.
- Fallback values (the original hardcoded classes) are provided in the
  `config()` calls to ensure stability if the config file or keys are missing.

This change improves maintainability by making it easier to view and modify
table styles from a single, centralized location.
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