Skip to content

contribution page ui#1664

Open
tarunnjoshi wants to merge 1 commit into
devfrom
contribution-ui-change
Open

contribution page ui#1664
tarunnjoshi wants to merge 1 commit into
devfrom
contribution-ui-change

Conversation

@tarunnjoshi
Copy link
Copy Markdown
Member

@tarunnjoshi tarunnjoshi commented May 7, 2026

Summary by CodeRabbit

  • Style
    • Improved the layout of contribution form profile fields with a responsive two-column grid design that automatically adapts to a single column on mobile devices for better usability across all screen sizes.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

Review Change Stack

Walkthrough

This PR adds responsive two-column grid layout styling to CRM contribution form profile fields. Both the SCSS source (goonj-main.scss) and compiled stylesheet (style.css) are updated with identical grid rules, including a mobile breakpoint that collapses to single-column on screens ≤768px wide.

Changes

CRM Profile Grid Layout

Layer / File(s) Summary
Responsive Two-Column Grid Styling
wp-content/themes/goonj-crm/assets/styles/goonj-main.scss, wp-content/themes/goonj-crm/style.css
Converts .crm-profile layout from block to CSS grid with two equal columns and fixed gap; forces textarea, checkbox, radio, multiple-option groups, and street-address fields to span full width; adds media query to switch to single-column layout at max-width 768px.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • ColoredCow/goonj#440: Modifies CRM contribution form grid layout rules for .crm-profile and related sections.
  • ColoredCow/goonj#706: Directly modifies .crm-profile display properties; this PR replaces earlier flex layout with grid.
  • ColoredCow/goonj#1330: Adjusts .crm-profile child section styling and positioning in the same stylesheet context.

Suggested labels

status : ready for review

Suggested reviewers

  • pokhiii
  • nishant22029

Poem

Two columns dance in perfect time, 🎨
Profile fields align so fine,
On mobile screens they bow and bend,
A grid layout from start to end! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'contribution page ui' is vague and lacks specificity about the actual changes made to the layout or styling. Revise the title to be more descriptive, such as 'Convert contribution page profile fields to two-column grid layout' or 'Update contribution form layout with responsive grid design'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch contribution-ui-change

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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.

Copy link
Copy Markdown

@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: 3

🧹 Nitpick comments (1)
wp-content/themes/goonj-crm/style.css (1)

202-221: 💤 Low value

Missing row-gap leaves vertically stacked field pairs without explicit spacing.

column-gap: 24px is set, but there is no row-gap. Unless the individual .crm-section elements already carry sufficient margin-bottom, form field rows may sit flush against each other in the two-column layout.

♻️ Proposed addition
 `#crm-main-content-wrapper` form .crm-block.crm-contribution-main-form-block .crm-public-form-item .crm-profile {
   display: grid !important;
   grid-template-columns: 1fr 1fr;
   column-gap: 24px;
+  row-gap: 16px; /* adjust to match design */
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@wp-content/themes/goonj-crm/style.css` around lines 202 - 221, Add an
explicit vertical gap to the grid by adding a row-gap to the selector
"#crm-main-content-wrapper form .crm-block.crm-contribution-main-form-block
.crm-public-form-item .crm-profile" (and mirror in the mobile `@media` rule if
needed); ensure row-gap (e.g., 24px or a theme spacing variable) is set so
stacked two-column rows (.crm-section) have consistent vertical spacing between
rows as well as the existing column-gap.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@wp-content/themes/goonj-crm/assets/styles/goonj-main.scss`:
- Around line 283-285: The media query breakpoint for the new grid-reset is off
by 1px; update the rule that currently uses `@media` (max-width: 768px) so it
matches the existing mobile range by using max-width: 769px (or change both
queries to a consistent boundary), ensuring the single-column grid rule and the
existing `.crm-profile div { width: 82vw !important; }` breakpoint align and
prevent the brief two-column/82vw layout at exactly 769px.
- Around line 260-286: Add a mobile override in this SCSS to prevent the global
`.crm-block .crm-public-form-item .crm-profile div { width: 82vw !important }`
rule from breaking the contribution two-column grid: inside the existing `@media`
(max-width: 768px) block, add a rule targeting the contribution selector
`#crm-main-content-wrapper form .crm-block.crm-contribution-main-form-block
.crm-public-form-item .crm-profile > div` and set `width: auto !important;` (or
`width: 100% !important;`) so contribution-page profile fields respect the grid
instead of the global 82vw rule.

In `@wp-content/themes/goonj-crm/style.css`:
- Around line 202-221: The mobile 82vw rule is overriding your grid sizing; add
an explicit override to reset width inside the contribution form context so grid
items don't get forced to 82vw—for example, within the
.crm-contribution-main-form-block scope (targeting `#crm-main-content-wrapper`
form .crm-block.crm-contribution-main-form-block .crm-public-form-item
.crm-profile and its direct .crm-section children) add a rule that sets width:
auto !important (and/or max-width: 100% !important) for the inner divs/elements
(e.g., the selector matching .crm-profile > .crm-section div or .crm-profile
.crm-section) and include that override inside your existing `@media` (max-width:
768px) block so it neutralizes the 82vw rule on small screens.

---

Nitpick comments:
In `@wp-content/themes/goonj-crm/style.css`:
- Around line 202-221: Add an explicit vertical gap to the grid by adding a
row-gap to the selector "#crm-main-content-wrapper form
.crm-block.crm-contribution-main-form-block .crm-public-form-item .crm-profile"
(and mirror in the mobile `@media` rule if needed); ensure row-gap (e.g., 24px or
a theme spacing variable) is set so stacked two-column rows (.crm-section) have
consistent vertical spacing between rows as well as the existing column-gap.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c3a862f5-ec80-4ef0-a073-89f6039920ff

📥 Commits

Reviewing files that changed from the base of the PR and between 215fe95 and 2822abf.

📒 Files selected for processing (2)
  • wp-content/themes/goonj-crm/assets/styles/goonj-main.scss
  • wp-content/themes/goonj-crm/style.css

Comment on lines +260 to +286
// Two-column layout for contribution-page profile fields. Pairs simple text
// inputs (First/Last Name, Email/Mobile, State/City, etc.) and keeps wide
// fields (street address, checkboxes/radios) full-width via :has() rather
// than pinning custom-field IDs (which differ between staging and prod).
// Selector specificity matches the existing `.crm-profile { display: block }`
// rule above to override it without !important on the grid setup.
#crm-main-content-wrapper form .crm-block.crm-contribution-main-form-block .crm-public-form-item .crm-profile {
display: grid !important;
grid-template-columns: 1fr 1fr;
column-gap: 24px;

> .crm-section {
width: auto !important;
}

> .crm-section:has(textarea),
> .crm-section:has(input[type="checkbox"]),
> .crm-section:has(input[type="radio"]),
> .crm-section:has(.crm-multiple-checkbox-radio-options),
> .crm-section[class*="street_address"] {
grid-column: 1 / -1;
}

@media (max-width: 768px) {
grid-template-columns: 1fr;
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Root cause of the mobile grid conflict lives here — fix it in the SCSS.

The width: 82vw !important rule at the existing mobile query (line 469–479 in this file) targets .crm-block .crm-public-form-item .crm-profile div, which covers contribution pages. The fix should be applied in this file so the compiled style.css stays in sync automatically (no manual edits to the compiled output):

🛡️ Proposed SCSS fix
   `@media` (max-width: 768px) {
     grid-template-columns: 1fr;
+
+    // Neutralise the generic 82vw rule that applies to all .crm-profile div
+    > .crm-section {
+      width: auto !important;
+    }
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Two-column layout for contribution-page profile fields. Pairs simple text
// inputs (First/Last Name, Email/Mobile, State/City, etc.) and keeps wide
// fields (street address, checkboxes/radios) full-width via :has() rather
// than pinning custom-field IDs (which differ between staging and prod).
// Selector specificity matches the existing `.crm-profile { display: block }`
// rule above to override it without !important on the grid setup.
#crm-main-content-wrapper form .crm-block.crm-contribution-main-form-block .crm-public-form-item .crm-profile {
display: grid !important;
grid-template-columns: 1fr 1fr;
column-gap: 24px;
> .crm-section {
width: auto !important;
}
> .crm-section:has(textarea),
> .crm-section:has(input[type="checkbox"]),
> .crm-section:has(input[type="radio"]),
> .crm-section:has(.crm-multiple-checkbox-radio-options),
> .crm-section[class*="street_address"] {
grid-column: 1 / -1;
}
@media (max-width: 768px) {
grid-template-columns: 1fr;
}
}
// Two-column layout for contribution-page profile fields. Pairs simple text
// inputs (First/Last Name, Email/Mobile, State/City, etc.) and keeps wide
// fields (street address, checkboxes/radios) full-width via :has() rather
// than pinning custom-field IDs (which differ between staging and prod).
// Selector specificity matches the existing `.crm-profile { display: block }`
// rule above to override it without !important on the grid setup.
`#crm-main-content-wrapper` form .crm-block.crm-contribution-main-form-block .crm-public-form-item .crm-profile {
display: grid !important;
grid-template-columns: 1fr 1fr;
column-gap: 24px;
> .crm-section {
width: auto !important;
}
> .crm-section:has(textarea),
> .crm-section:has(input[type="checkbox"]),
> .crm-section:has(input[type="radio"]),
> .crm-section:has(.crm-multiple-checkbox-radio-options),
> .crm-section[class*="street_address"] {
grid-column: 1 / -1;
}
`@media` (max-width: 768px) {
grid-template-columns: 1fr;
// Neutralise the generic 82vw rule that applies to all .crm-profile div
> .crm-section {
width: auto !important;
}
}
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@wp-content/themes/goonj-crm/assets/styles/goonj-main.scss` around lines 260 -
286, Add a mobile override in this SCSS to prevent the global `.crm-block
.crm-public-form-item .crm-profile div { width: 82vw !important }` rule from
breaking the contribution two-column grid: inside the existing `@media`
(max-width: 768px) block, add a rule targeting the contribution selector
`#crm-main-content-wrapper form .crm-block.crm-contribution-main-form-block
.crm-public-form-item .crm-profile > div` and set `width: auto !important;` (or
`width: 100% !important;`) so contribution-page profile fields respect the grid
instead of the global 82vw rule.

Comment on lines +283 to +285
@media (max-width: 768px) {
grid-template-columns: 1fr;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Breakpoint boundary (768 px) is 1 px off the existing mobile query (769 px).

The existing media query is (min-width: 340px) and (max-width: 769px); the new one is (max-width: 768px). At exactly 769 px the old .crm-profile div { width: 82vw !important; } still fires but the new single-column reset does not, so a two-column grid with 82 vw items is briefly possible. Align both breakpoints:

♻️ Proposed fix
-  `@media` (max-width: 768px) {
+  `@media` (max-width: 769px) {
     grid-template-columns: 1fr;
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@media (max-width: 768px) {
grid-template-columns: 1fr;
}
`@media` (max-width: 769px) {
grid-template-columns: 1fr;
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@wp-content/themes/goonj-crm/assets/styles/goonj-main.scss` around lines 283 -
285, The media query breakpoint for the new grid-reset is off by 1px; update the
rule that currently uses `@media` (max-width: 768px) so it matches the existing
mobile range by using max-width: 769px (or change both queries to a consistent
boundary), ensuring the single-column grid rule and the existing `.crm-profile
div { width: 82vw !important; }` breakpoint align and prevent the brief
two-column/82vw layout at exactly 769px.

Comment on lines +202 to +221
#crm-main-content-wrapper form .crm-block.crm-contribution-main-form-block .crm-public-form-item .crm-profile {
display: grid !important;
grid-template-columns: 1fr 1fr;
column-gap: 24px;
}
#crm-main-content-wrapper form .crm-block.crm-contribution-main-form-block .crm-public-form-item .crm-profile > .crm-section {
width: auto !important;
}
#crm-main-content-wrapper form .crm-block.crm-contribution-main-form-block .crm-public-form-item .crm-profile > .crm-section:has(textarea),
#crm-main-content-wrapper form .crm-block.crm-contribution-main-form-block .crm-public-form-item .crm-profile > .crm-section:has(input[type=checkbox]),
#crm-main-content-wrapper form .crm-block.crm-contribution-main-form-block .crm-public-form-item .crm-profile > .crm-section:has(input[type=radio]),
#crm-main-content-wrapper form .crm-block.crm-contribution-main-form-block .crm-public-form-item .crm-profile > .crm-section:has(.crm-multiple-checkbox-radio-options),
#crm-main-content-wrapper form .crm-block.crm-contribution-main-form-block .crm-public-form-item .crm-profile > .crm-section[class*=street_address] {
grid-column: 1/-1;
}
@media (max-width: 768px) {
#crm-main-content-wrapper form .crm-block.crm-contribution-main-form-block .crm-public-form-item .crm-profile {
grid-template-columns: 1fr;
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Existing mobile width: 82vw !important rule will conflict with the new grid on small screens.

At lines 350–352 (later in the cascade), the existing rule:

`#crm-main-content-wrapper` form .crm-block .crm-public-form-item .crm-profile div {
  width: 82vw !important;
}

applies to any .crm-section inside .crm-profile (they are divs), and it fires on .crm-contribution-main-form-block pages as well because the selector is a superset. On mobile screens this overrides the grid item sizing — in a 1-column grid items are forced to 82vw regardless of the container width, potentially causing overflow. At exactly 769px (where the old query fires but the new 768px breakpoint does not), 82vw is applied to each half-column of a still two-column grid.

Consider adding an explicit override inside the new grid rule, or expanding the existing mobile block to neutralise the 82vw constraint for this context:

🛡️ Proposed fix
 `@media` (max-width: 768px) {
   `#crm-main-content-wrapper` form .crm-block.crm-contribution-main-form-block .crm-public-form-item .crm-profile {
     grid-template-columns: 1fr;
   }
+  /* Prevent the generic 82vw rule from breaking grid items */
+  `#crm-main-content-wrapper` form .crm-block.crm-contribution-main-form-block .crm-public-form-item .crm-profile div {
+    width: auto !important;
+  }
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@wp-content/themes/goonj-crm/style.css` around lines 202 - 221, The mobile
82vw rule is overriding your grid sizing; add an explicit override to reset
width inside the contribution form context so grid items don't get forced to
82vw—for example, within the .crm-contribution-main-form-block scope (targeting
`#crm-main-content-wrapper` form .crm-block.crm-contribution-main-form-block
.crm-public-form-item .crm-profile and its direct .crm-section children) add a
rule that sets width: auto !important (and/or max-width: 100% !important) for
the inner divs/elements (e.g., the selector matching .crm-profile > .crm-section
div or .crm-profile .crm-section) and include that override inside your existing
`@media` (max-width: 768px) block so it neutralizes the 82vw rule on small
screens.

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