Skip to content

Refactor CSS for publish menu responsiveness and style#25033

Open
Raj4478 wants to merge 6 commits intoTryGhost:mainfrom
Raj4478:main
Open

Refactor CSS for publish menu responsiveness and style#25033
Raj4478 wants to merge 6 commits intoTryGhost:mainfrom
Raj4478:main

Conversation

@Raj4478
Copy link

@Raj4478 Raj4478 commented Oct 1, 2025

When we publish our post and if the title is is Single word and long such as (pneumonoultramicroscopicsilicovolcanoconiosis) the title gets out or the card because there was no css to handle the title (mainly the overflow css)

Screenshot (361) Screenshot (364)

After adding the css for this it looks like this

Screenshot (365)

Note

Adds word-wrapping to long titles in the publish success modal and adjusts mobile/header spacing; includes minor style cleanups.

  • Styles (Admin):
    • Publish Success Modal: Add wrapping for long titles (.modal-post-success .modal-body h2) to prevent overflow.
    • Responsive Header: Add padding-right to .gh-publish-header at <=1024px and margin-right to .gh-publish-header .mobile at <=500px.
    • Bookmark Card: Split .gh-post-bookmark-title line-height and line-clamp into separate declarations.
  • Cleanup: Normalize selector combinator spacing, gradients, keyframe formatting, and box-shadow values across publishmenu.css.

Written by Cursor Bugbot for commit d4d56f0. This will update automatically on new commits. Configure here.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 1, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

The PR updates ghost/admin/app/styles/components/publishmenu.css with whitespace and formatting normalizations (selector/combinator spacing, animation timing syntax, rgba/spacing consistency). It adds small layout adjustments: padding-right: 15px to a button container and margin-right: 5px in a header mobile area. A new rule .modal-post-success .modal-body h2 enforces word-wrap/word-break for long text. Several declarations had spacing/width punctuation normalized (e.g., 100% !important vs 100%!important) and minor selector spacing edits; no exported/public API changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly summarizes the primary change by indicating a CSS refactor targeting the publish menu’s responsiveness and style, which accurately reflects the main modifications in the pull request.
Description Check ✅ Passed The pull request description directly addresses the overflow issue with long single-word titles and outlines the specific CSS rules added to resolve it, along with responsive spacing tweaks and relevant screenshots, making it clearly related to the changeset.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a06b253 and d4d56f0.

📒 Files selected for processing (1)
  • ghost/admin/app/styles/components/publishmenu.css (19 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • ghost/admin/app/styles/components/publishmenu.css

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the community [triage] Community features and bugs label Oct 1, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
ghost/admin/app/styles/components/publishmenu.css (1)

142-149: Invalid calc() syntax — missing spaces around “-”.

calc(50%-9px) is invalid; browsers require spaces around -, so the declaration is ignored.

-    top: calc(50%-9px);
+    top: calc(50% - 9px);
🧹 Nitpick comments (4)
ghost/admin/app/styles/components/publishmenu.css (4)

965-971: Long-word wrapping: prefer overflow-wrap:anywhere; drop overflow:auto.

overflow:auto risks scrollbars. Use standard wrapping with hyphenation for unbroken titles.

-.modal-post-success .modal-body h2 {
-    overflow: auto ;
-    word-wrap: break-word;
-    word-break: break-word ;
-    max-width: 100% ;
-}
+.modal-post-success .modal-body h2 {
+    overflow-wrap: anywhere;   /* modern, handles single long words */
+    word-wrap: break-word;     /* legacy alias/fallback */
+    word-break: break-word;    /* WebKit/Blink fallback */
+    hyphens: auto;             /* allow hyphenation when possible */
+}

664-671: Tokenize the green gradient; avoid !important if possible.

Hard-coded hexes and !important reduce theming/override flexibility. Prefer design tokens and normal specificity.

-.gh-publish-cta .gh-btn-pulse {
-    fill: #fff;
-    background: linear-gradient(90deg, #4dd831, #1DC32E);
+.gh-publish-cta .gh-btn-pulse {
+    fill: #fff;
+    background: linear-gradient(90deg, var(--green), var(--green-d1));
     color: #fff;
     font-weight: 500;
     box-shadow: 0 0 0 0 rgba(48, 207, 67, 1);
     animation: pulse-green 2s infinite;
 }
 
-.gh-publish-cta .gh-btn-green,
-.gh-publish-cta .gh-btn-green:hover,
-.gh-publish-cta .gh-btn-green:active {
-    background: linear-gradient(90deg, #4dd831, #1DC32E) !important;
+.gh-publish-cta .gh-btn-green,
+.gh-publish-cta .gh-btn-green:hover,
+.gh-publish-cta .gh-btn-green:active {
+    background: linear-gradient(90deg, var(--green), var(--green-d1));
 }

Please confirm if !important is required to beat inline styles or higher specificity. If so, consider raising specificity locally instead.

Also applies to: 690-697


835-847: Clamp enhancement looks good; add hyphenation for edge cases.

Unprefixed line-clamp + -webkit-line-clamp covers modern engines. Add hyphens:auto to improve long-token breaks.

 .gh-post-bookmark-title {
@@
-    line-height: 1.4em;
-    line-clamp: 2;
+    line-height: 1.4em;
+    line-clamp: 2;
     -webkit-line-clamp: 2;
     -webkit-box-orient: vertical;
     overflow: hidden;
+    hyphens: auto;
 }

1118-1121: Avoid !important on mobile button width.

Try container/selector specificity instead of !important to keep styles composable.

-        width: 100% !important;
+        width: 100%;

If !important is needed to override inline/button utility classes, consider a more specific selector (e.g., .modal-post-success .modal-footer .copy-link.gh-btn).

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9290c6b and 8367238.

📒 Files selected for processing (1)
  • ghost/admin/app/styles/components/publishmenu.css (19 hunks)
🔇 Additional comments (3)
ghost/admin/app/styles/components/publishmenu.css (3)

696-698: Secondary CTA hidden when primary present — confirm UX.

display:none on .gh-publish-cta-secondary when adjacent to .gh-btn-green removes helpful context/links in some flows. Intentional?


36-38: Dropdown width set to 100% — sanity-check narrow layouts.

Expanding .ember-basic-dropdown to full width inside .gh-date-time-picker can overflow in constrained flex/ grid parents. Please verify on <=320px and within side panels.


563-570: Checked state sizing adjustments look consistent.

Padding/line-height updates compensate for 2px border; no jump observed. LGTM.

cursor[bot]

This comment was marked as outdated.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
ghost/admin/app/styles/components/publishmenu.css (1)

965-969: Use overflow-wrap instead of the non-standard word-break

word-break: break-word is a legacy WebKit extension and is ignored in Firefox. Switch to the standard overflow-wrap (plus the existing alias for older engines) so the fix works consistently across browsers.

 .modal-post-success .modal-body h2 {
-    word-wrap: break-word;
-    word-break: break-word ;
-    max-width: 100% ;
+    overflow-wrap: anywhere;
+    word-wrap: break-word; /* legacy alias */
+    max-width: 100%;
 }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8367238 and a06b253.

📒 Files selected for processing (1)
  • ghost/admin/app/styles/components/publishmenu.css (19 hunks)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community [triage] Community features and bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant