Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

🔧 .container.is-fluid to tailwind #11391

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

Conversation

roiLeo
Copy link
Contributor

@roiLeo roiLeo commented Feb 4, 2025

part of:

Summary by CodeRabbit

  • Style
    • Standardized container styling across pages and components by replacing inconsistent class names, resulting in a more uniform and full-width presentation.
    • Enhanced navigation bar and header layouts for a cleaner, more modern appearance with improved responsiveness on both desktop and mobile devices.
    • Introduced a new full-width styling utility, streamlining the overall design and ensuring a consistent user experience across the site.

@roiLeo roiLeo requested a review from a team as a code owner February 4, 2025 11:09
@roiLeo roiLeo requested review from vikiival and Jarsen136 and removed request for a team February 4, 2025 11:09
Copy link

netlify bot commented Feb 4, 2025

Deploy Preview for koda-canary ready!

Name Link
🔨 Latest commit b43a339
🔍 Latest deploy log https://app.netlify.com/sites/koda-canary/deploys/67b5c3c4add3e5000864dc59
😎 Deploy Preview https://deploy-preview-11391--koda-canary.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

netlify bot commented Feb 11, 2025

Deploy Preview for polkadot ready!

Name Link
🔨 Latest commit b43a339
🔍 Latest deploy log https://app.netlify.com/sites/polkadot/deploys/67b5c3c46c479a00085a7c5c
😎 Deploy Preview https://deploy-preview-11391--polkadot.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.

@vikiival vikiival requested review from preschian and hassnian and removed request for vikiival February 14, 2025 12:02
Copy link
Contributor

@hassnian hassnian left a comment

Choose a reason for hiding this comment

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

@roiLeo I think we should add container-fluid as a utility class

https://v3.tailwindcss.com/docs/adding-custom-styles#adding-custom-utilities

It's much cleaner and more maintainable, wdyt?

@roiLeo
Copy link
Contributor Author

roiLeo commented Feb 18, 2025

@roiLeo I think we should add container-fluid as a utility class

https://v3.tailwindcss.com/docs/adding-custom-styles#adding-custom-utilities

It's much cleaner and more maintainable, wdyt?

IMO, best solution would be to create a container wrapper component but that not the point of this PR.

@hassnian
Copy link
Contributor

@roiLeo I think we should add container-fluid as a utility class
https://v3.tailwindcss.com/docs/adding-custom-styles#adding-custom-utilities
It's much cleaner and more maintainable, wdyt?

IMO, best solution would be to create a container wrapper component but that not the point of this PR.

i'm not opposed to that, feel free to raise a pr.

Copy link

coderabbitai bot commented Feb 19, 2025

Walkthrough

This pull request unifies the layout styling across various components and layouts by replacing the "container is-fluid" class with a simplified "container-fluid" class. It also removes mobile-specific CSS rules from the global stylesheet and updates component structures—most notably in the navbar and gallery item layout—to adjust conditional class bindings. A new Tailwind utility is added to support the updated container style, and one layout now uses device-type detection via a new composable.

Changes

File(s) Change Summary
assets/styles/global.scss Removed CSS rules for .container.is-fluid and mobile-specific .column-padding adjustments.
libs/ui/src/scss/tailwind.scss Added new .container-fluid utility class with full-width, responsive, and padding styles.
components/ExploreLayoutWithSidebar.vue, components/collection/CollectionHeader.vue, components/.../CollectionBanner.vue, components/landing/HeroBanner.vue, components/landing/LandingPage.vue, components/swap/layout/index.vue, components/swap/review.vue, layouts/default.vue, layouts/explore-layout.vue, layouts/no-footer.vue, layouts/teleport-layout.vue, pages/[prefix]/explore/collectibles.vue Updated class names from "container is-fluid" to "container-fluid".
components/Navbar.vue Modified navbar structure with additional layout classes and positional tweaks.
layouts/gallery-item-layout.vue Revised layout structure with new conditional class bindings using useDevice (replacing useWindowSize) for device-specific styling.

Sequence Diagram(s)

sequenceDiagram
    participant GIL as GalleryItemLayout
    participant UD as useDevice Composable
    GIL->>UD: Request device type (isMobileOrTablet)
    UD-->>GIL: Return isTouch status
    GIL->>GIL: Apply conditional classes based on isTouch
    GIL->>Template: Render updated layout
Loading

Poem

I'm a rabbit hopping through lines of code,
Changing containers to a simpler mode.
From "is-fluid" to "fluid" the classes now glide,
With new utilities standing right by my side.
I nibble on updates and smile with delight, 🥕
Celebrating new styles from morning 'til night.


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. (Beta)
  • @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

@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 (2)
layouts/gallery-item-layout.vue (1)

6-7: Consider extracting container styles into a reusable component.

The class combinations are duplicated in Navbar.vue. Consider creating a wrapper component to promote reusability.

libs/ui/src/scss/tailwind.scss (1)

151-153: Attention: Validate !important Usage Syntax in .container-fluid Utility

The new .container-fluid utility class correctly aggregates the desired Tailwind CSS utilities. However, the usage of #{!important} in line 152 to enforce the !important flag is nonstandard and may lead to SCSS compilation issues. Typically, if you want to enforce !important, you would append it directly (e.g., px-5 !important) or handle this via Tailwind’s configuration. Please verify that your build system processes this interpolation as intended, and consider revising it if any issues arise.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 207ccf0 and b43a339.

📒 Files selected for processing (16)
  • assets/styles/global.scss (1 hunks)
  • components/ExploreLayoutWithSidebar.vue (1 hunks)
  • components/Navbar.vue (1 hunks)
  • components/collection/CollectionHeader.vue (1 hunks)
  • components/collection/CollectionHeader/CollectionBanner.vue (1 hunks)
  • components/landing/HeroBanner.vue (2 hunks)
  • components/landing/LandingPage.vue (1 hunks)
  • components/swap/layout/index.vue (1 hunks)
  • components/swap/review.vue (1 hunks)
  • layouts/default.vue (1 hunks)
  • layouts/explore-layout.vue (1 hunks)
  • layouts/gallery-item-layout.vue (2 hunks)
  • layouts/no-footer.vue (1 hunks)
  • layouts/teleport-layout.vue (1 hunks)
  • libs/ui/src/scss/tailwind.scss (1 hunks)
  • pages/[prefix]/explore/collectibles.vue (1 hunks)
✅ Files skipped from review due to trivial changes (11)
  • components/swap/review.vue
  • components/swap/layout/index.vue
  • components/collection/CollectionHeader.vue
  • components/collection/CollectionHeader/CollectionBanner.vue
  • layouts/default.vue
  • components/ExploreLayoutWithSidebar.vue
  • pages/[prefix]/explore/collectibles.vue
  • components/landing/HeroBanner.vue
  • layouts/no-footer.vue
  • layouts/teleport-layout.vue
  • components/landing/LandingPage.vue
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: Redirect rules
  • GitHub Check: Header rules
  • GitHub Check: Pages changed
  • GitHub Check: test
  • GitHub Check: build
  • GitHub Check: build-cf
  • GitHub Check: shard (1, 10)
  • GitHub Check: runner / eslint
🔇 Additional comments (8)
layouts/gallery-item-layout.vue (1)

39-39: LGTM! Good use of device detection.

The change from useWindowSize to useDevice is a better approach for responsive design.

layouts/explore-layout.vue (2)

16-16: LGTM! Consistent with container class changes.

The change from container is-fluid to container-fluid aligns with the PR objectives.


16-16: LGTM!

The class name change from container is-fluid to container-fluid aligns with the PR's objective to migrate to Tailwind CSS.

components/Navbar.vue (4)

11-12: Consider extracting container styles into a reusable component.

The class combinations are duplicated in gallery-item-layout.vue. Consider creating a wrapper component to promote reusability.


15-15: LGTM! Good use of negative margin.

The negative margin adjustment improves the brand logo positioning.


11-12: LGTM! Improved responsive layout using Tailwind utilities.

The changes enhance layout control and responsiveness by:

  • Using flex utilities for better spacing and alignment
  • Adding responsive padding adjustments
  • Implementing touch-specific conditional classes

15-15:

❓ Verification inconclusive

Verify the negative margin adjustment.

The negative margin ml-[-0.75rem] on the navbar brand might affect the layout on different screen sizes.

Please verify that:

  1. The logo remains properly aligned across all breakpoints
  2. There's no content overflow or clipping
  3. The spacing remains consistent with the design system

🏁 Script executed:

#!/bin/bash
# Description: Search for other instances of negative margins in the codebase to ensure consistency

# Search for negative margin patterns in style files
rg -A 2 'ml-\[-.*\]|margin-left: -' --type css --type scss --type vue

Length of output: 100


Action Required: Re-run the Verification Script with Updated File Type Handling

The original script did not account for SCSS files properly (resulting in the “unrecognized file type: scss” error). Please re-run the following updated script, which adds SCSS support explicitly, to verify that the negative margin usage is consistent across the codebase:

Once this script executes successfully, please manually verify that:

  • The logo remains correctly aligned at all breakpoints.
  • No content overflow or clipping occurs.
  • The spacing stays consistent with the design system.

🏁 Script executed:

[run_scripts]
#!/bin/bash
# Re-run the search for negative margins with correct SCSS support
rg -A 2 'ml-\[-.*\]|margin-left: -' --type-add "scss:*.scss" --type scss --type css --type vue

Length of output: 246


Re-run Verification for Negative Margin on Navbar Brand

The current script encountered an error due to the unrecognized vue file type. Please re-run the following updated script using file globs to ensure that all relevant files (Vue, SCSS, CSS) are checked for negative margin usage:

Once executed, please manually verify that:

  • The logo remains properly aligned across all breakpoints.
  • There is no content overflow or clipping.
  • The spacing is consistent with the design system.

🏁 Script executed:

[run_scripts]
#!/bin/bash
# Re-run search for negative margins across Vue, SCSS, and CSS files using file globs
rg -A 2 'ml-\[-.*\]|margin-left: -' -g '*.vue' -g '*.scss' -g '*.css'

Length of output: 376


Double-check Negative Margin Impact on Navbar Layout

The negative margin ml-[-0.75rem] in components/Navbar.vue (line 15) is the only occurrence in the codebase. Please verify that:

  • The logo remains properly aligned across all responsive breakpoints.
  • There is no content overflow or clipping.
  • The spacing is consistent with the design system.

Manually confirm the layout behavior on different screen sizes to ensure no unexpected issues arise.

assets/styles/global.scss (1)

203-203: LGTM! Clean removal of legacy container styles.

The removal of .container.is-fluid and mobile-specific styles aligns with the transition to Tailwind utility classes.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants