Skip to content

fix: Card width issue #383 #384

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

ogzcode
Copy link
Contributor

@ogzcode ogzcode commented May 11, 2025

A solution made for this issue #383

I changed the max-w-sm class in the Card component with min-w-sm. In this way, the Card gets the width of the container in which it is located and the desired width can be given with the class.

New way:

//Small Size
fwb-card href="#" class="w-sm">
      <div class="p-5">
        <h5 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white">
          Noteworthy technology acquisitions 2021
        </h5>
        <p class="font-normal text-gray-700 dark:text-gray-400">
          Here are the biggest enterprise technology acquisitions of 2021 so far, in reverse chronological order.
        </p>
      </div>
    </fwb-card>

//Medium size
fwb-card href="#" class="w-md">
      <div class="p-5">
        <h5 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white">
          Noteworthy technology acquisitions 2021
        </h5>
        <p class="font-normal text-gray-700 dark:text-gray-400">
          Here are the biggest enterprise technology acquisitions of 2021 so far, in reverse chronological order.
        </p>
      </div>
    </fwb-card>

//Customize Size
fwb-card href="#" class="w-[320px]">
      <div class="p-5">
        <h5 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white">
          Noteworthy technology acquisitions 2021
        </h5>
        <p class="font-normal text-gray-700 dark:text-gray-400">
          Here are the biggest enterprise technology acquisitions of 2021 so far, in reverse chronological order.
        </p>
      </div>
    </fwb-card>

Please check and give feedback. I will be waiting, good day. @Sqrcz @cogor @zoltanszogyenyi

Summary by CodeRabbit

  • Documentation

    • Updated card component examples to include explicit width utility classes for improved clarity on sizing options.
  • Style

    • Card components now use minimum width constraints instead of maximum width constraints, affecting how cards display across different variants.

ogzcode added 3 commits May 11, 2025 09:45
Adjusted card classes in useCardClasses to use min-w-sm and min-w-xl for better layout consistency across variants.
Added responsive width classes to card components for better layout across different screen sizes.
Added specific width classes to card examples to improve layout adaptability across various screen sizes.
Copy link

netlify bot commented May 11, 2025

Deploy Preview for sensational-seahorse-8635f8 ready!

Name Link
🔨 Latest commit e380eef
🔍 Latest deploy log https://app.netlify.com/sites/sensational-seahorse-8635f8/deploys/682049b8679a6f00083e8c98
😎 Deploy Preview https://deploy-preview-384--sensational-seahorse-8635f8.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

coderabbitai bot commented May 11, 2025

Walkthrough

Width utility classes were added to the documentation examples for the FwbCard Vue component, specifying explicit sizing for default, image, and horizontal variants. In the component logic, Tailwind CSS classes were updated to use minimum width (min-w-*) instead of maximum width (max-w-*) constraints for card sizing.

Changes

File(s) Change Summary
docs/components/card.md Updated documentation examples to include width utility classes (w-sm, w-md, w-lg) on card components.
docs/components/card/examples/FwbCardExample.vue Added class="w-sm" to the <fwb-card> in the default card example.
docs/components/card/examples/FwbCardExampleImage.vue Added class="w-md" to the <fwb-card> in the image card example.
docs/components/card/examples/FwbCardExampleHorizontal.vue Added class="w-lg" to the <fwb-card> in the horizontal card example.
src/components/FwbCard/composables/useCardClasses.ts Replaced all max-w-* and md:max-w-xl classes with min-w-* and md:min-w-xl for card sizing logic.

Suggested labels

🔧 enhancement

Poem

Cards now stretch with min-width pride,
From docs to code, their forms grow wide.
Smalls and mediums, larges too—
Each card now fits the view for you!
A hop, a skip, a sizing cheer,
The rabbit grins: "Your cards look clear!"
🐇🃏

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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

🧹 Nitpick comments (1)
docs/components/card/examples/FwbCardExample.vue (1)

3-3: Fix attribute formatting to match style guidelines.

The added class attribute should follow the project's linting guidelines by placing attributes on separate lines.

-    <fwb-card href="#" class="w-sm">
+    <fwb-card 
+      href="#" 
+      class="w-sm"
+    >
🧰 Tools
🪛 GitHub Check: lint (18.x)

[warning] 3-3:
'class' should be on a new line

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 570e238 and e380eef.

📒 Files selected for processing (5)
  • docs/components/card.md (3 hunks)
  • docs/components/card/examples/FwbCardExample.vue (1 hunks)
  • docs/components/card/examples/FwbCardExampleHorizontal.vue (1 hunks)
  • docs/components/card/examples/FwbCardExampleImage.vue (1 hunks)
  • src/components/FwbCard/composables/useCardClasses.ts (1 hunks)
🧰 Additional context used
🪛 GitHub Check: lint (18.x)
docs/components/card/examples/FwbCardExample.vue

[warning] 3-3:
'class' should be on a new line

🔇 Additional comments (7)
src/components/FwbCard/composables/useCardClasses.ts (1)

17-17: Excellent width constraint improvements!

Changing from max-w-sm to min-w-sm (and similar for other variants) is a smart solution that allows cards to expand with their container while maintaining a minimum width. This change directly addresses issue #383 by providing more flexible width control through additional classes.

The implementation is consistent across all card variants (image, default, and horizontal), ensuring a uniform behavior throughout the component.

Also applies to: 21-21, 23-23

docs/components/card/examples/FwbCardExampleImage.vue (1)

7-7: Good example of the new width class usage.

Adding class="w-md" demonstrates how users can now control card width using Tailwind width utilities. This example clearly shows the medium-width card variant that was mentioned in the PR description.

docs/components/card/examples/FwbCardExample.vue (1)

3-3: Good example of the small width card variant.

Adding class="w-sm" demonstrates the small card width variant mentioned in the PR description. This provides a clear example of the new component usage.

🧰 Tools
🪛 GitHub Check: lint (18.x)

[warning] 3-3:
'class' should be on a new line

docs/components/card/examples/FwbCardExampleHorizontal.vue (1)

7-7: Good example of the large width card variant.

Adding class="w-lg" to the horizontal card variant provides a comprehensive set of examples for the new width control system. Combined with the other examples, users now have a clear reference for all common width variants.

docs/components/card.md (3)

23-23: Verify custom w-sm utility class exists.

The default Tailwind CSS configuration does not include a w-sm width utility. Please ensure that w-sm is defined in the project's Tailwind config (or documented) so that this example renders correctly.


49-49: Verify custom w-md utility class exists.

Similarly, confirm that w-md is defined in the Tailwind configuration. Without this class, the image variant example will not apply the intended width.


76-76: Verify custom w-lg utility class exists.

Ensure that w-lg is available in the Tailwind config or documentation. If absent, the horizontal variant example won’t reflect the desired width.

@ogzcode ogzcode changed the title Card width issue #383 fix: Card width issue #383 May 16, 2025
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