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

Update templates and dark mode styles #8187

Merged
merged 13 commits into from Dec 28, 2023
Merged

Update templates and dark mode styles #8187

merged 13 commits into from Dec 28, 2023

Conversation

javierjulio
Copy link
Member

@javierjulio javierjulio commented Dec 26, 2023

This moves the main navigation into a dedicated partial with improvements. The html head partials have now been consolidated into a single partial. The title tag is now inlined in the layout files. This revamps the dark mode styles across the board and uses a darker set of colors. The default breadcrumb links now pass html_options to link_to call so we can apply classes. The default comments resource has been updated so specific columns have a minimum width and the body is now truncated.

Copy link

codecov bot commented Dec 26, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (72385cf) 99.03% compared to head (ccba7c6) 99.03%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8187      +/-   ##
==========================================
- Coverage   99.03%   99.03%   -0.01%     
==========================================
  Files         151      151              
  Lines        4164     4150      -14     
==========================================
- Hits         4124     4110      -14     
  Misses         40       40              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This is a work in progress.
This adds some min widths and truncates the comment body.
We were setting default background color but its not needed since we prefer to take on the inherited background color and just apply an explicit background color on hover.
Since these are not used by the paginator we can safely delete these. Forgot to do so when combining the two original themes we had (active_admin and active_admin_countless) for a simpler, modern pagination layout.
This way we can style the default breadcrumbs from the view with Tailwind classes. If providing custom breadcrumb, since full links are given, caller should provide any classes for styling. This improves colors for light and dark modes.
@javierjulio javierjulio force-pushed the main-navigation branch 2 times, most recently from 07f07c9 to fafd67c Compare December 27, 2023 15:05
@javierjulio javierjulio changed the title Update main navigation and dark mode styles Update templates and dark mode styles Dec 27, 2023
Still some elements to update with better dark mode styles but this gets most of the contents on the page.

Updated the main navigation layout and hover/selected states.

Updated the data-table and attributes-table styles, not just dark mode but spacing, borders and other styles.

Imrpoved the empty-value style for all modes too.
The content was going off screen due to h-screen usage. This was fine originally since we had the menu always be full screen vertically but we've changed that now so have to adjust the top offset based on breakpoint.
Otherwise these styles are purged which we don't want.
Use whitespace nowrap so multi word status tags don't wrap in a table. Use pill shaped badges instead. No need to duplicate styles here since the second selector is just for updating the color based on the data attribute.
This will be required for now with cssbundling-rails. Another option is to copy and paste the plugin.js file to the host app and run it and it will work. That could be an option for tailwindcss-rails users. At the moment there isn't another alternative. I've tried requiring the plugin from the gem path but it doens't seem that Tailwind can find its own modules if required that way. It has to be local.
Originally, we needed this as we didn't extract other views in the layout to partials. No need for specific partials now since chances are if someone wants to edit this, they will want to edit most of the HTML head anyway so easier to extract a single partial with everything already there as its not that many lines.

Since we've improved many of the layout helpers, we'll just inline the title tag now and not sanitize since this is commonly extracted, its much easier now for users to add that in if they want it. We added sanitized due to testing the site title with a link but we've since changed that so the site title really should just be plain text for situations like this. The link was used because often it doubled as the site title in the site header HTML but that is expected to be fully customized and branded now.
@javierjulio javierjulio merged commit 54bcf81 into master Dec 28, 2023
30 checks passed
@javierjulio javierjulio deleted the main-navigation branch December 28, 2023 01:38
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.

None yet

1 participant