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

fix: replacing the light mode bg and adding bg to nextui-pro section … #4355

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

Conversation

macci001
Copy link
Contributor

@macci001 macci001 commented Dec 13, 2024

Closes ENG-1636

πŸ“ Description

PR changes the background image for the nextui-pro section and adds the bg for the mobile.

⛳️ Current behavior (updates)

πŸš€ New behavior

πŸ’£ Is this a breaking change (Yes/No): No

Summary by CodeRabbit

  • New Features

    • Updated background gradient styles for mobile and web views.
    • Improved visibility of the Marquee component on mobile devices.
  • Bug Fixes

    • Simplified the duration prop for the Marquee component, ensuring consistent behavior.

Copy link

changeset-bot bot commented Dec 13, 2024

⚠️ No Changeset found

Latest commit: 3b3135a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Dec 13, 2024

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
nextui-docs-v2 βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Dec 13, 2024 7:04am
nextui-storybook-v2 βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Dec 13, 2024 7:04am

Copy link

linear bot commented Dec 13, 2024

Copy link
Contributor

coderabbitai bot commented Dec 13, 2024

Walkthrough

The changes in this pull request focus on the NextUIProSection component within the nextui-pro-section.tsx file. Key updates include a transition from radial to linear gradients for mobile backgrounds, the addition of an "ease-in-out" transition for web backgrounds, and modifications to the Marquee component's visibility and opacity settings. The duration prop for the Marquee has been simplified to a constant value, while the overall control flow of the component remains unchanged.

Changes

File Path Change Summary
apps/docs/components/marketing/nextui-pro-section.tsx Updated background gradient styles for mobile (linear) and web (radial with transition). Modified Marquee visibility and opacity settings, and simplified duration prop.

Possibly related PRs

Suggested reviewers

  • jrgarciadev

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 generate docstrings to generate docstrings for this PR. (Experiment)
  • @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.

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 (1)
apps/docs/components/marketing/nextui-pro-section.tsx (1)

41-42: Add transition duration for smoother effect

While the ease-in-out timing function is added, specifying a transition duration would make the effect more noticeable.

-    ? "ease-in-out h-full w-full bg-[radial-gradient(at_80%_50%,_rgba(255,255,255,_0)_20%,_rgba(0,0,0,_0.8)_40%,_rgba(0,0,0,1)_100%)]"
-    : "ease-in-out h-full w-full bg-[radial-gradient(at_80%_50%,_rgba(0,0,0,_0)_20%,_rgba(255,255,255,_0.9)_40%,_rgba(255,255,255,1)_100%)]";
+    ? "transition-all duration-300 ease-in-out h-full w-full bg-[radial-gradient(at_80%_50%,_rgba(255,255,255,_0)_20%,_rgba(0,0,0,_0.8)_40%,_rgba(0,0,0,1)_100%)]"
+    : "transition-all duration-300 ease-in-out h-full w-full bg-[radial-gradient(at_80%_50%,_rgba(0,0,0,_0)_20%,_rgba(255,255,255,_0.9)_40%,_rgba(255,255,255,1)_100%)]";
πŸ“œ Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between fd86056 and 3b3135a.

πŸ“’ Files selected for processing (1)
  • apps/docs/components/marketing/nextui-pro-section.tsx (2 hunks)
πŸ”‡ Additional comments (2)
apps/docs/components/marketing/nextui-pro-section.tsx (2)

37-38: Improved mobile gradient transition!

The switch from radial to linear gradient for mobile provides a better controlled fade effect, with appropriate transparency handling for both dark and light modes.


159-160: Verify contrast with reduced opacity

The changes improve the background handling with dynamic viewport height and simplified animation. However, please ensure that the 15% opacity on mobile provides sufficient contrast for content visibility.

βœ… Verification successful

Let me gather more information about the opacity and contrast usage in the codebase.


The opacity change is safe and well-implemented

The reduced opacity (15%) is applied to a background image element that has multiple safeguards ensuring content visibility:

  • The content is rendered in a separate z-indexed layer (z-30) above the background
  • There are gradient overlays that enhance contrast (mobileClassName and webClassName)
  • The opacity is only reduced on mobile, where the gradient overlay is stronger
  • Text elements have additional contrast enhancement with text shadow
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for any contrast-related accessibility guidelines in the codebase
rg -i "contrast|a11y|accessibility" --type md

Length of output: 510


Script:

#!/bin/bash
# Check for similar opacity patterns in the codebase
rg -i "opacity-\d+" --type tsx -A 2

# Check the parent component structure to understand the contrast context
ast-grep --pattern 'className="$$$opacity-15$$$"'

Length of output: 117


Script:

#!/bin/bash
# Check for similar opacity patterns in the codebase, using correct file extensions
rg -i "opacity-\d+" --type ts --type jsx --type tsx

# Check the component content to understand what's being rendered
cat "apps/docs/components/marketing/nextui-pro-section.tsx"

Length of output: 6416

@macci001
Copy link
Contributor Author

@jrgarciadev since this section was looking bit plain on mobile, I have added the bg to mobile as well.
We can remove it if it is not looking better.

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