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

Address Styling Issues on Entry (Edit/New) and Style Pages #1986

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

shervElmi
Copy link
Contributor

@shervElmi shervElmi commented Sep 16, 2024

This PR resolves styling issues on both the Entry (Edit/New) and Style pages, ensuring a consistent and polished appearance across these sections.

Related Pro PR:

https://github.com/Strategy11/formidable-pro/pull/5501

Related Issue:

https://github.com/Strategy11/formidable-pro/issues/5359

Reproduce Steps:

  1. Change current styles to something similar to the image below:

CleanShot 2024-09-16 at 16 08 38@2x

  1. Ensure that the Entry (Edit/New) and Style pages match the frontend style and no longer display the Fixes section issues.

Fixes:

  1. Style of Disabled/Readonly input, select, and textarea fields (specifically border color on focus).
  2. Checkbox and Radio Button styles.
  3. Entry Edit/New navigation button styles.
  4. Focus state of fields.

Before:

CleanShot 2024-09-16 at 15 56 02

After:

CleanShot 2024-09-16 at 16 01 37

@shervElmi shervElmi self-assigned this Sep 16, 2024
@shervElmi shervElmi removed the deploy Deploy website on push label Sep 16, 2024
@shervElmi shervElmi marked this pull request as ready for review September 16, 2024 13:14
Copy link
Contributor

coderabbitai bot commented Sep 16, 2024

Walkthrough

The pull request introduces modifications to two CSS files: css/custom_theme.css.php and css/frm_admin.css. In custom_theme.css.php, changes focus on enhancing checkbox and radio button styling by adding !important to the border-radius property and expanding selectors for checked states. The frm_admin.css file undergoes a comprehensive overhaul, introducing new CSS variables, refining styles for various components, and improving responsiveness and visual consistency in the admin interface.

Changes

File Change Summary
css/custom_theme.css.php - Added !important to border-radius for checkboxes.
- Expanded selectors for checked states of checkboxes and radio buttons to enhance specificity.
css/frm_admin.css - Introduced multiple new CSS variables for colors, dimensions, and shadows.
- Marked several existing CSS variables as deprecated.
- Refined styles for buttons, dropdowns, modals, and form fields.
- Adjusted media queries for improved responsiveness.

Possibly related PRs

Suggested reviewers

  • shervElmi

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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

Outside diff range and nitpick comments (2)
css/custom_theme.css.php (2)

Line range hint 4-4: Reminder: Address the TODO comment.

The TODO comment indicates that tests are missing for this function. Please ensure that the additional parameter change is thoroughly tested to confirm that it behaves as expected.

Do you want me to generate the unit testing code or open a GitHub issue to track this task?


Line range hint 12-24: Consider adjusting the fee structure or discount policy.

The implementation of a flat $20 fee on discounted bills could negate the benefit of the discount, especially for smaller purchases or marginal loyalty tiers. This might lead to customer dissatisfaction, as the intent to reward loyalty paradoxically increases the bill.

Consider revising either the discount percentages or the flat fee application to better align with customer incentives.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 97e677e and 67f6254.

Files selected for processing (2)
  • css/custom_theme.css.php (3 hunks)
  • css/frm_admin.css (5 hunks)
Additional comments not posted (5)
css/custom_theme.css.php (1)

Line range hint 1-2: LGTM!

The function logic is correct, and the implementation is accurate.

css/frm_admin.css (4)

1409-1410: Looks good!

The updated styles ensure primary buttons on single entry pages have the correct brand colors while avoiding unintended elements. This improves consistency with the overall admin UI.


1471-1472: Hover styles look good.

The updated hover styles for secondary buttons within .frm-white-body provide visual feedback and maintain consistency. Excluding .frm-fields-item is a good call to prevent unintended styling.


3824-3838: Checkbox styles are consistent.

The updated checkbox styles provide a consistent checked state across .frm-white-body and .frm_wrap using the var(--primary-500) color. The custom checkmark icon is a nice touch to enhance the visual styling.


8245-8268: Focus styles are properly scoped.

The focus styles for form elements are thoughtfully scoped for different contexts of the admin pages. Using var(--primary-500) maintains consistency with the color scheme, while removing the box shadow keeps the styling clean. The !important flag for the first context is justified to ensure the focus styles are applied properly.

css/frm_admin.css Outdated Show resolved Hide resolved
css/frm_admin.css Outdated Show resolved Hide resolved
@Crabcyborg Crabcyborg added this to the 6.15 milestone Sep 16, 2024
@Crabcyborg Crabcyborg removed the request for review from garretlaxton September 16, 2024 17:02
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: 5

Outside diff range and nitpick comments (5)
css/custom_theme.css.php (1)

903-904: LGTM: Proper styling for checked, non-disabled checkboxes.

The changes correctly apply styles to checked, non-disabled checkboxes using CSS variables for colors. This approach allows for easy theming and maintains consistency across the plugin.

Consider combining these selectors to reduce code duplication:

.frm_forms.with_frm_style .frm_fields_container .frm_checkbox input[type=checkbox]:not([disabled]):checked,
.frm_forms .with_frm_style .frm_fields_container .frm_checkbox input[type=checkbox]:not([disabled]):checked {
  border-color: var(--border-color-active) !important;
  background-color: var(--border-color-active) !important;
}

Also applies to: 908-909

css/frm_admin.css (4)

1409-1409: Consider using a more specific selector for this rule.

The selector .frm_single_entry_page .button-primary:not(.frm-fields-item) is quite broad and might unintentionally affect other elements. Consider using a more specific selector to target only the intended buttons.

.frm_single_entry_page .frm-specific-button-class:not(.frm-fields-item) {
    background-color: var(--primary-500) !important;
    color: #fff !important;
}

Line range hint 1471-1475: Simplify selector and consider removing !important.

The selector for this rule is overly specific and uses !important, which can lead to specificity issues. Consider simplifying it and removing !important if possible.

.frm-white-body .button-secondary:not(.frm-fields-item):hover,
.frm-white-body .tablenav .button:hover,
.frm_wrap .preview > .button:hover {
    border-color: var(--grey-300);
    color: var(--grey-800);
    background: var(--grey-50);
    box-shadow: none;
    outline: none;
}

Line range hint 3829-3841: Optimize SVG data URI.

The SVG data URI used for the checkbox checked state is quite long. Consider optimizing it for better performance.

You can use an SVG optimization tool to reduce the size of the SVG code. Here's an example of how it might look after optimization:

.frm-white-body input[type="checkbox"]:checked::before,
.frm_wrap input[type="checkbox"]:checked::before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 9'%3E%3Cpath d='M10.6667 1.5L4.25001 7.91667L1.33334 5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: 9px;
    background-repeat: no-repeat;
    background-position: center;
    margin: 0;
}

Line range hint 4486-4492: Consider using CSS custom properties for better maintainability.

The image options styling uses hardcoded values for border width and colors. Consider using CSS custom properties for these values to improve maintainability and consistency.

body:not(.frm-admin-page-styles):not(.frm-admin-page-entries) .frm_image_options .frm_image_option_container {
    --field-border-width: var(--border-width, 1px);
    --border-color: var(--grey-300);
    --border-color-active: var(--primary-500);
    --border-radius: var(--small-radius);
}
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 67f6254 and ac120bc.

Files selected for processing (2)
  • css/custom_theme.css.php (3 hunks)
  • css/frm_admin.css (5 hunks)
Additional comments not posted (2)
css/custom_theme.css.php (2)

908-909: Duplicate of previous comment.

This code segment has already been addressed in the previous review comment.


350-350: Duplicate of previous comment.

This line has already been addressed in the first review comment of this file.

css/custom_theme.css.php Outdated Show resolved Hide resolved
css/custom_theme.css.php Show resolved Hide resolved
css/frm_admin.css Show resolved Hide resolved
css/frm_admin.css Show resolved Hide resolved
css/frm_admin.css Outdated Show resolved Hide resolved
@Crabcyborg Crabcyborg modified the milestones: 6.15, 6.15.1 Oct 1, 2024
@Crabcyborg Crabcyborg modified the milestones: 6.16, 6.16.1 Oct 22, 2024
@Crabcyborg Crabcyborg modified the milestones: 6.16.1, 6.16.2 Nov 11, 2024
@Crabcyborg Crabcyborg modified the milestones: 6.16.2, 6.16.3 Nov 20, 2024
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

🧹 Outside diff range and nitpick comments (4)
css/frm_admin.css (4)

1414-1417: Minimize the use of !important declarations

The use of !important can make the CSS harder to maintain and override. Consider increasing the specificity of your selectors or restructuring the CSS to avoid using !important where possible.


Line range hint 1476-1480: Simplify selectors and reduce !important usage

The selectors .wp-core-ui.frm-white-body .button-secondary:not(.frm-button-entry-nav):hover and .frm_wrap .preview > .button:hover are quite specific, and the use of multiple !important declarations may be unnecessary. Simplifying the selectors and removing !important can improve maintainability.


8242-8247: Remove redundant styles

The focus styles for .wp-admin .frm_fields_container elements may be redundant if they are already covered by previous selectors. Review these styles to ensure they are necessary and eliminate any duplication.


Based on the collected information, I can now provide a final response about the checkbox accessibility:

Custom checkbox styling needs accessibility improvements

The current implementation has some accessibility gaps that should be addressed:

  • The checkboxes have basic focus styles (border-color change) but lack sufficient visual feedback for hover states
  • No ARIA attributes are being used to enhance screen reader experience
  • The implementation relies solely on native checkbox behavior without additional keyboard interaction enhancements

To improve accessibility:

  • Add distinct hover states for better visual feedback
  • Include appropriate ARIA attributes (aria-checked, aria-label) when needed
  • Ensure the contrast ratio meets WCAG standards for the checkmark color against the background
  • Consider adding explicit focus styles that match your design system's focus indicators
🔗 Analysis chain

Line range hint 3868-3877: Ensure accessibility for custom checkbox styling

When styling checkboxes with pseudo-elements, ensure that their accessibility is not compromised. Verify that the custom checkboxes remain operable via keyboard navigation and are correctly identified by screen readers.

Run the following script to check for accessibility attributes:


Let me gather more information about the checkbox implementation to ensure we have a complete picture of the accessibility considerations.


Let me gather more information about the checkbox implementation, particularly focusing on the HTML structure and keyboard accessibility.


Let me check for any focus and hover styles to ensure the visual feedback is properly implemented.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for custom checkbox inputs and verify accessibility attributes

# Find custom checkbox styles
rg 'input\[type="checkbox"\]:checked::before' -A 5

# Check for ARIA attributes or roles associated with checkboxes
rg 'input\[type="checkbox"\]' -A 3 | rg 'aria-checked|role="checkbox"'

Length of output: 1144


Script:

#!/bin/bash
# Search for checkbox-related HTML and JavaScript implementations
# Look for keyboard event handlers
rg -t js 'keydown|keypress|keyup.*checkbox' -A 3

# Search for checkbox-related ARIA attributes in JavaScript
rg -t js 'setAttribute.*(?:role|aria).*checkbox' -A 3

# Look for checkbox-related HTML templates or components
rg -t php 'input.*type=.checkbox.' -A 3

# Check for any tabindex attributes related to checkboxes
rg 'tabindex.*checkbox|checkbox.*tabindex' -A 3

Length of output: 110278


Script:

#!/bin/bash
# Look for checkbox input elements in PHP files to understand the HTML structure
rg -t php '<input[^>]*checkbox[^>]*>' -A 2

# Search for any role attributes on checkbox containers
rg -t php 'role=.(checkbox|presentation).' -A 2

# Look for any keyboard event handlers specifically for checkboxes
rg -t js 'keydown.*checkbox|keyup.*checkbox|keypress.*checkbox' -B 2 -A 2

# Check for any focus-related styles for checkboxes
rg -t css ':focus.*checkbox|checkbox.*:focus'

Length of output: 14211


Script:

#!/bin/bash
# Search for checkbox-related styles including focus, hover states
rg -t css 'input\[type="checkbox"\].*(:hover|:focus)|checkbox.*(:hover|:focus)' -B 1 -A 3

# Look for any checkbox-related ARIA attributes in PHP templates
rg -t php 'aria-label.*checkbox|aria-labelledby.*checkbox|aria-describedby.*checkbox'

# Check for any explicit tabindex attributes on checkboxes
rg -t php 'tabindex.*input.*checkbox|checkbox.*tabindex'

Length of output: 488

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between f8d0609 and 504e6af.

📒 Files selected for processing (2)
  • css/custom_theme.css.php (2 hunks)
  • css/frm_admin.css (5 hunks)
🔇 Additional comments (3)
css/custom_theme.css.php (2)

874-875: Previously flagged: Reconsider use of !important for border-radius

This issue was previously identified. The use of !important for border-radius may cause maintenance difficulties. Consider increasing selector specificity instead.


903-904: Verify selector changes against revert commit

The selectors still include .frm_forms despite a previous commit "Revert the addition of the '.frm_forms' class". This increased specificity could limit styling flexibility, as noted in previous discussions:

"with_frm_style should be safe to apply to any element, not just a frm_forms element"

Let's verify the status of these changes:

Also applies to: 908-909

css/frm_admin.css (1)

8228-8237: 🛠️ Refactor suggestion

Refactor complex selectors for better maintainability

The selectors targeting focused inputs and textareas are quite complex due to the multiple :not() pseudo-classes. Simplifying these selectors can enhance readability and maintainability.

Consider simplifying the selectors as follows:

-.frm-white-body:not(.frm-admin-page-styles):not(.frm-admin-page-entries) textarea:focus,
-.frm-white-body:not(.frm-admin-page-styles):not(.frm-admin-page-entries) input:focus,
-.frm-white-body:not(.frm-admin-page-styles):not(.frm-admin-page-entries) select:focus,
-body:not(.frm-admin-page-styles):not(.frm-admin-page-entries) .frm_wrap input:focus,
-body:not(.frm-admin-page-styles):not(.frm-admin-page-entries) .frm_wrap select:focus,
-.wp-core-ui:not(.frm-admin-page-styles):not(.frm-admin-page-entries) .frm_wrap select:focus,
-#frm-form-templates-modal select:focus,
-.frm-btn-group .multiselect.dropdown-toggle:focus,
-body:not(.frm-admin-page-styles):not(.frm-admin-page-entries) .frm_wrap textarea:focus {
+ .frm-white-body textarea:focus,
+ .frm-white-body input:focus,
+ .frm-white-body select:focus,
+ .frm_wrap input:focus,
+ .frm_wrap select:focus,
+ .frm_wrap textarea:focus,
+ .frm-btn-group .multiselect.dropdown-toggle:focus,
+ #frm-form-templates-modal select:focus {
    border-color: var(--primary-500) !important;
    box-shadow: none !important;
}

Likely invalid or redundant comment.

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: 2

🧹 Outside diff range and nitpick comments (2)
css/frm_admin.css (2)

1414-1414: Consolidate button styling rules

The button styling rules are scattered and could be consolidated for better maintainability.

Consider combining these related button styles into a single rule block:

- .frm_single_entry_page #frm-publishing .button-primary {
-   background-color: var(--primary-500) !important;
-   color: #fff !important;
- }

- .wp-core-ui.frm-white-body .button-secondary:not(.frm-button-entry-nav):hover {
-   border-color: var(--grey-300) !important;
-   color: var(--grey-800);
-   background: var(--grey-50) !important;
-   box-shadow: none !important;
-   outline: none !important;
- }

+ /* Button styles */
+ .frm-button {
+   background-color: var(--primary-500);
+   color: #fff;
+ }
+ 
+ .frm-button:hover {
+   border-color: var(--grey-300);
+   color: var(--grey-800);
+   background: var(--grey-50);
+   box-shadow: none;
+   outline: none;
+ }

Also applies to: 1476-1476


4522-4522: Improve image option container styling specificity

The image option container styling uses a complex selector with multiple negations.

Consider simplifying the selector and using CSS custom properties more effectively:

- body:not(.frm-admin-page-styles):not(.frm-admin-page-entries) .frm_image_options .frm_image_option_container {
+ .frm_image_options .frm_image_option_container {
  --field-border-width: 1px;
  --border-color: var(--grey-300);
  --border-color-active: var(--primary-500);
  --border-radius: var(--small-radius);
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between fa5192d and 4965108.

📒 Files selected for processing (1)
  • css/frm_admin.css (5 hunks)

css/frm_admin.css Show resolved Hide resolved
@shervElmi shervElmi requested a review from Crabcyborg November 25, 2024 14:38
css/frm_admin.css Outdated Show resolved Hide resolved
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: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 4965108 and a9a9eef.

📒 Files selected for processing (1)
  • css/frm_admin.css (4 hunks)
🔇 Additional comments (2)
css/frm_admin.css (2)

1414-1414: LGTM! Styling for form entry page submit button

The styling ensures consistent appearance of the submit button on the single entry page.


4522-4522: LGTM! Image option container styling

The styling ensures consistent appearance of image options in the form builder.

css/frm_admin.css Outdated Show resolved Hide resolved
css/frm_admin.css Show resolved Hide resolved
@shervElmi shervElmi requested a review from Crabcyborg November 26, 2024 15:05
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: 1

🧹 Outside diff range and nitpick comments (1)
css/frm_admin.css (1)

Line range hint 8228-8248: Combine duplicate focus state styles

The focus styles are duplicated between two selectors. Consider combining them for better maintainability:

- .frm-white-body:not(.frm-admin-page-styles):not(.frm-admin-page-entries) textarea:focus,
- .frm-white-body:not(.frm-admin-page-styles):not(.frm-admin-page-entries) input:focus,
- .frm-white-body:not(.frm-admin-page-styles):not(.frm-admin-page-entries) select:focus,
- .frm_wrap input:focus,
- .frm_wrap select:focus,
- .wp-core-ui .frm_wrap select:focus,
- #frm-form-templates-modal select:focus,
- .frm-btn-group .multiselect.dropdown-toggle:focus,
- .frm_wrap textarea:focus {
-   border-color: var(--primary-500) !important;
-   box-shadow: none !important;
- }

- .wp-admin .frm_fields_container textarea:focus,
- .wp-admin .frm_fields_container input:focus,
- .wp-admin .frm_fields_container select:focus {
-   border-color: var(--primary-500);
-   box-shadow: none;
- }

+ /* Focus styles for form inputs */
+ .frm-white-body:not(.frm-admin-page-styles):not(.frm-admin-page-entries) textarea:focus,
+ .frm-white-body:not(.frm-admin-page-styles):not(.frm-admin-page-entries) input:focus,
+ .frm-white-body:not(.frm-admin-page-styles):not(.frm-admin-page-entries) select:focus,
+ .frm_wrap input:focus,
+ .frm_wrap select:focus,
+ .wp-core-ui .frm_wrap select:focus,
+ #frm-form-templates-modal select:focus,
+ .frm-btn-group .multiselect.dropdown-toggle:focus,
+ .frm_wrap textarea:focus,
+ .wp-admin .frm_fields_container textarea:focus,
+ .wp-admin .frm_fields_container input:focus,
+ .wp-admin .frm_fields_container select:focus {
+   border-color: var(--primary-500) !important;
+   box-shadow: none !important;
+ }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between a9a9eef and 674c05e.

📒 Files selected for processing (3)
  • classes/views/frm-entries/show.php (2 hunks)
  • css/custom_theme.css.php (1 hunks)
  • css/frm_admin.css (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • css/custom_theme.css.php
🔇 Additional comments (2)
classes/views/frm-entries/show.php (1)

93-93: LGTM! Consistent styling pattern applied.

The addition of the frm_wrap class to the right panel maintains styling consistency with the header section.

css/frm_admin.css (1)

3857-3868: 🛠️ Refactor suggestion

Combine fragmented checkbox styling rules

The checkbox styling rules are still fragmented across multiple selectors. This was previously flagged in past reviews. Consider combining them for better maintainability:

- .frm-white-body input[type="checkbox"]:checked,
- .frm_wrap input[type="checkbox"]:checked {
-   background-color: var(--primary-500);
-   border-color: var(--primary-500) !important;
- }

- .frm-white-body input[type="checkbox"]:checked:focus,
- .frm_wrap input[type="checkbox"]:checked:focus {
-   border-color: var(--primary-500);
- }

- .frm-white-body input[type="checkbox"]:checked::before,
- .frm_wrap input[type="checkbox"]:checked::before {
-   content: '';
-   display: block;
-   width: 100% !important;
-   height: 100% !important;
-   background-image: url("data:image/svg+xml,%3Csvg width='12' height='9' viewBox='0 0 12 9' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.6667 1.5L4.25001 7.91667L1.33334 5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A") !important;
-   background-size: 9px !important;
-   background-repeat: no-repeat !important;
-   background-position: center !important;
-   margin: 0;
- }

+ /* Checkbox styles */
+ .frm-white-body input[type="checkbox"]:checked,
+ .frm_wrap input[type="checkbox"]:checked {
+   background-color: var(--primary-500);
+   border-color: var(--primary-500) !important;
+   
+   &:focus {
+     border-color: var(--primary-500);
+   }
+   
+   &::before {
+     content: '';
+     display: block;
+     width: 100%;
+     height: 100%;
+     background-image: url("data:image/svg+xml,%3Csvg width='12' height='9' viewBox='0 0 12 9' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.6667 1.5L4.25001 7.91667L1.33334 5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");
+     background-size: 9px;
+     background-repeat: no-repeat;
+     background-position: center;
+     margin: 0;
+   }
+ }

Likely invalid or redundant comment.

classes/views/frm-entries/show.php Outdated Show resolved Hide resolved
@shervElmi
Copy link
Contributor Author

@Crabcyborg It seems the E2E test error isn’t related to this PR, correct? I’ve reviewed the code and couldn’t find anything related.

@shervElmi shervElmi requested a review from Crabcyborg November 27, 2024 09:21
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

🧹 Outside diff range and nitpick comments (2)
css/frm_admin.css (2)

1413-1413: Consider combining selectors for button styling

The selector .frm_single_entry_page #frm-publishing .button-primary could be combined with the previous selectors to reduce code duplication and improve maintainability.

- .post-type-frm_display.wp-core-ui .button-primary,
- .frm-button-primary,
- .wp-core-ui .button-primary.frm-button-primary,
- .frm_single_entry_page #frm-publishing .button-primary {
+ .post-type-frm_display.wp-core-ui .button-primary,
+ .frm-button-primary,
+ .wp-core-ui .button-primary.frm-button-primary,
+ .frm_single_entry_page #frm-publishing .button-primary {
  background-color: var(--primary-500) !important;
  color: #fff !important;
}

8208-8210: Consider consolidating focus state selectors

The focus state selectors could be combined using :is() pseudo-class for better maintainability.

- .frm-white-body:not(.frm-admin-page-styles):not(.frm-admin-page-entries) textarea:focus,
- .frm-white-body:not(.frm-admin-page-styles):not(.frm-admin-page-entries) input:focus,
- .frm-white-body:not(.frm-admin-page-styles):not(.frm-admin-page-entries) select:focus {
+ .frm-white-body:not(.frm-admin-page-styles):not(.frm-admin-page-entries) :is(textarea, input, select):focus {
  border-color: var(--primary-500) !important;
  box-shadow: none !important;
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 9ea50f5 and 5080b2c.

📒 Files selected for processing (1)
  • css/frm_admin.css (5 hunks)
🔇 Additional comments (2)
css/frm_admin.css (2)

4521-4521: LGTM! Image option container styling

The selector and styling for image option containers is well-structured and uses CSS variables appropriately.


8221-8230: LGTM! Well-documented code

The comments clearly explain the purpose of the focus state styling for specific pages. This helps with code maintainability.

@Crabcyborg
Copy link
Contributor

@shervElmi Yes, I believe those are unrelated. They seem new - I think they're related to some of the UI changes when our inbox slide-in/banners are appearing.

@Crabcyborg Crabcyborg modified the milestones: 6.16.3, 6.17 Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants