Skip to content

refactor: prepare for tailwind v4 #11500

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

Merged
merged 3 commits into from
Apr 1, 2025
Merged

Conversation

preschian
Copy link
Member

@preschian preschian commented Mar 25, 2025

Thank you for your contribution to the Koda - Generative Art Marketplace.

👇 __ Let's make a quick check before the contribution.

PR Type

  • Bugfix
  • Feature
  • Refactoring

Context

Summary by CodeRabbit

  • Style
    • Enhanced visual consistency across key UI components such as cards, modals, tooltips, carousels, navigation menus, and wallet interfaces.
    • Transitioned from utility-first CSS to explicit property declarations for improved clarity and maintainability.
    • Improved typography, spacing, and positioning to deliver a cleaner, more cohesive experience.
    • Refined responsiveness and layout precision for seamless interaction on both desktop and mobile devices.

Copy link

coderabbitai bot commented Mar 25, 2025

Walkthrough

This pull request eliminates the use of Tailwind CSS utility classes by removing all instances of the @apply directive and replacing them with explicit CSS property declarations. Multiple SCSS files across various directories—including components, layouts, global styles, and pages—were updated to define properties such as alignment, display, spacing, borders, shadows, and responsiveness directly. No changes were made to exported or public declarations.

Changes

File(s) Change Summary
assets/styles/abstracts/_animations.scss Replaced @apply text-center inline-block with explicit text-align: center; and display: inline-block; in the .dots class.
assets/styles/components/_{card,carousel-arrows,carousel,collection-card,connect-wallet,gallery-item,keyboard-shortcut,modal,nft-card,search,tippy,toast}.scss Removed Tailwind CSS @apply directives and replaced them with individual CSS property declarations for layout, spacing, borders, shadows, positioning, and responsiveness.
assets/styles/global.scss Substituted @apply with explicit CSS properties and CSS custom properties (variables) for typography, links, ellipsis styling, modals, and tables.
assets/styles/layouts/_{footer,main-navigation}.scss Converted utility classes into standard CSS declarations to define layout, z-index, spacing, element positioning, and responsive behavior.
assets/styles/pages/create.scss Updated the .form-addons class by replacing Tailwind utilities with direct CSS rules for text alignment, sizing, and border properties.

Suggested reviewers

  • Jarsen136
  • hassnian

Poem

I’m a little rabbit in the code garden,
Hopping through styles with each new line.
From Tailwind magic to explicit shifts,
My hops celebrate every design.
Clean code blooms—happy trails, dear devs! 🐇✨


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between db2ee8c and de4935a.

📒 Files selected for processing (17)
  • assets/styles/abstracts/_animations.scss (1 hunks)
  • assets/styles/components/_card.scss (1 hunks)
  • assets/styles/components/_carousel-arrows.scss (2 hunks)
  • assets/styles/components/_carousel.scss (1 hunks)
  • assets/styles/components/_collection-card.scss (4 hunks)
  • assets/styles/components/_connect-wallet.scss (3 hunks)
  • assets/styles/components/_gallery-item.scss (2 hunks)
  • assets/styles/components/_keyboard-shortcut.scss (1 hunks)
  • assets/styles/components/_modal.scss (1 hunks)
  • assets/styles/components/_nft-card.scss (3 hunks)
  • assets/styles/components/_search.scss (5 hunks)
  • assets/styles/components/_tippy.scss (1 hunks)
  • assets/styles/components/_toast.scss (1 hunks)
  • assets/styles/global.scss (4 hunks)
  • assets/styles/layouts/_footer.scss (5 hunks)
  • assets/styles/layouts/_main-navigation.scss (8 hunks)
  • assets/styles/pages/create.scss (1 hunks)

🪧 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 plan to trigger planning for file edits and PR creation.
  • @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

netlify bot commented Mar 25, 2025

Deploy Preview for koda-canary ready!

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

cloudflare-workers-and-pages bot commented Mar 25, 2025

Deploying koda-art-prod with  Cloudflare Pages  Cloudflare Pages

Latest commit: de4935a
Status: ✅  Deploy successful!
Preview URL: https://cd27e95e.kodaart-production.pages.dev
Branch Preview URL: https://refactor--prepare-for-tailwi.kodaart-production.pages.dev

View logs

@preschian preschian marked this pull request as ready for review March 25, 2025 15:15
@preschian preschian requested a review from a team as a code owner March 25, 2025 15:15
@preschian preschian requested review from vikiival, Jarsen136 and hassnian and removed request for a team March 25, 2025 15:15
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 (21)
assets/styles/pages/create.scss (1)

9-16: Border Property Ordering in .form-addons
The explicit conversion to standard CSS properties is clear, but note that border-left: none; is declared before the shorthand border: 1px solid var(--card-border-color);. Because the shorthand resets all four sides, the intended removal of the left border may be negated. If your intent is to remove the left border, consider placing the border-left: none; declaration after the full border property.

 .form-addons {
   text-align: center;
   line-height: 3rem;
   height: 3rem;
   width: 4rem;
-  border-left: none;
-  border: 1px solid var(--card-border-color);
+  border: 1px solid var(--card-border-color);
+  border-left: none;
 }
assets/styles/components/_carousel.scss (1)

57-62: Explicit .dot Styling in Carousel
The .dot class now clearly defines its dimensions, cursor, margin, padding, and border properties. This makes the styling self-contained and easier to adjust. Ensure these values are in line with the design system across the application.

assets/styles/components/_carousel-arrows.scss (1)

90-93: Consistent Styling for Small-Size Arrows
The explicit properties added for the .arrow-small-size .arrow class (position, transform, cursor, top) mirror the main arrow styles. This consistency is good; consider whether a shared mixin could further reduce duplication if similar styling is used elsewhere.

assets/styles/components/_search.scss (8)

6-12: Explicit Properties in .search-bar-collection-search

Replaced Tailwind utility classes with direct CSS values (e.g. z-index, position, height, etc.). The values seem intentional and clear. Please verify that these explicit measurements (such as height: 1.5rem and positional offsets) align with the design specifications.


15-17: Explicit Sizing for Inner <span> in .search-bar-collection-search

The <span> now directly defines height, padding, and border-radius. These clear declarations improve maintainability compared to utility classes. Double-check that the border-radius: 4rem produces the intended fully rounded appearance.


23-28: Direct Positioning in .search-bar-bg

The conversion from utility classes to explicit CSS (with properties like position: absolute, full width/height, and precise left/top offsets) is well executed. Ensure the slight offset values (0.25rem) are consistent with the overall spacing logic.


33-38: Clear Declaration in .search-bar-keyboard-icon

The explicit styles—such as z-index: 2, absolute positioning, and pixel-based dimensions—effectively replace the Tailwind classes. Confirm that the mix of px (e.g. height: 23px) and rem units elsewhere meets the project's design consistency.


53-53: Set z-index for .gallery-search

Assigning z-index: 1 directly is straightforward. This clear declaration helps control stacking context without relying on a utility class.


64-69: Explicit Input Styling in .gallery-search input

The input now uses explicit values for height, padding, and border-radius. While the values are clear, note that the padding is specified in pixels (42px, 50px), whereas other dimensions use rem. Consider whether consistent unit usage (e.g. converting padding to rem) could enhance scalability.


119-119: Cursor Declaration in .link-item

The change to cursor: pointer; replaces the Tailwind cursor utility. This explicit declaration is clear and improves the code’s self-documentation.


171-171: Enabling Pointer Interaction for .search-history

Adding cursor: pointer; for .search-history items reinforces the interactive intent. This explicit style aligns well with the refactoring objective.

assets/styles/layouts/_main-navigation.scss (10)

68-72: Refined Fullpage Navbar Item Styling

Explicitly setting position: fixed, height: 100vh, width: 100%, and z-index: 100 for the &--fullpage class replaces the previous utility classes effectively. Verify that these values ensure the full-page overlay behaves as intended on all devices.


105-111: Explicit Button Styles for Connect Wallet

The .button-connect-wallet now clearly defines properties such as width, height, display, text-transform, margin, and border-radius. This improves clarity over prior utility abstractions. Confirm that the fixed dimensions (e.g. height: 67px) align with responsive design expectations.


153-153: Direct z-index Setting on .navbar

Replacing a Tailwind utility class with z-index: 999 !important; provides a clear stacking order for the navbar. Ensure this high z-index does not inadvertently overlap other elements.


183-188: Navbar Item Styling Adjustments

The explicit declarations for text-transform: capitalize, font-weight: normal, cursor: pointer, and border-radius: 0 !important on .navbar-item remove ambiguity from utility classes. These changes improve readability; however, double-check that resetting the border-radius does not conflict with any desired rounded corners elsewhere in the design.


241-242: Avatar Icon Border Radius

Specifying border-radius: 24.5px; directly for &__avatar-icon is clear and intentional. Just verify that this value produces the expected circular appearance across different screen resolutions.


246-246: Button Border Radius Correction

Removing border radius on buttons with border-radius: 0; in .button.is-bordered-light is a straightforward change. Ensure consistency with similar buttons throughout the codebase.


258-259: Explicit Cursor for Navbar Menu Item

Declaring cursor: pointer; in .menu-item reinforces interactivity. This replacement of the Tailwind cursor utility is clear.


274-275: Disabled Menu Item Interaction

The change cursor: not-allowed; for .menu-item.is-disabled clearly communicates the disabled state. This explicit declaration improves accessibility cues.


282-289: Fixed Stack Container Styling

The explicit properties for .fixed-stack—including box-sizing: border-box, position: fixed, full width, precise z-index, overflow: hidden, border-radius: 0, and positioning—make the intent unmistakable. This robust declaration helps isolate the element, though please verify that these fixed styles do not limit future flexibility in layout adjustments.


312-314: Cancel Button Styling Refinements

The clear definition for .cancel-btn with cursor: pointer, text-transform: capitalize, and border: none replaces Tailwind utilities and improves readability. This explicit style is well aligned with the refactoring goals.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0564f4a and 89ee68d.

📒 Files selected for processing (17)
  • assets/styles/abstracts/_animations.scss (1 hunks)
  • assets/styles/components/_card.scss (1 hunks)
  • assets/styles/components/_carousel-arrows.scss (2 hunks)
  • assets/styles/components/_carousel.scss (1 hunks)
  • assets/styles/components/_collection-card.scss (4 hunks)
  • assets/styles/components/_connect-wallet.scss (3 hunks)
  • assets/styles/components/_gallery-item.scss (2 hunks)
  • assets/styles/components/_keyboard-shortcut.scss (1 hunks)
  • assets/styles/components/_modal.scss (1 hunks)
  • assets/styles/components/_nft-card.scss (3 hunks)
  • assets/styles/components/_search.scss (5 hunks)
  • assets/styles/components/_tippy.scss (1 hunks)
  • assets/styles/components/_toast.scss (1 hunks)
  • assets/styles/global.scss (4 hunks)
  • assets/styles/layouts/_footer.scss (5 hunks)
  • assets/styles/layouts/_main-navigation.scss (8 hunks)
  • assets/styles/pages/create.scss (1 hunks)
🔇 Additional comments (24)
assets/styles/components/_card.scss (1)

8-9: Explicit Styling for Bordered Card
Replacing the Tailwind utility classes with explicit CSS properties (border-radius: 0.25rem; and box-shadow: none;) improves clarity and maintainability. Ensure that this explicit definition is consistent with similar components (e.g., where !important may have been used) if there’s an intentional override.

assets/styles/abstracts/_animations.scss (1)

97-100: Clear Removal of @apply in .dots Class
Switching from @apply text-center inline-block; to explicit declarations (text-align: center; and display: inline-block;) enhances readability and avoids potential conflicts with Tailwind v4.

assets/styles/components/_modal.scss (1)

1-3: Explicit z-index Declaration for Active Modal
Replacing @apply z-[998] with z-index: 998; results in clearer and more maintainable styling. Verify that this hardcoded value fits with the overall modal stacking strategy in the project.

assets/styles/components/_gallery-item.scss (2)

3-3: Consistent Avatar Styling
Replacing the utility class for a rounded avatar with border-radius: 50%; is a clean, explicit declaration that better communicates the intended design.


63-63: Explicit Cursor Styling for Tooltip
Using cursor: pointer; directly in .buy-tooltip a reinforces the interactive behavior without relying on utility classes.

assets/styles/components/_toast.scss (1)

7-12: Refined Snackbar Styling
Replacing the Tailwind @apply directive with explicit CSS properties (display: inline-flex;, align-items: center;, justify-content: space-around;, min-height: 3em;, pointer-events: auto;, and margin: 0.5em 0;) makes the styling more transparent and maintainable.

assets/styles/components/_keyboard-shortcut.scss (1)

6-13: Refined Explicit CSS for Keyboard Shortcut
Replacing the @apply directive with explicit CSS properties (e.g., display: inline-block;, font-weight: bold;, line-height: 1;, etc.) improves clarity and control over the styling. The changes are succinct and align with the overall refactoring approach.

assets/styles/components/_tippy.scss (1)

4-6: Explicit Styling for Tippy Tooltip
The removal of the @apply directive in favor of explicit declarations (display: inline-block;, text-align: left;, and padding: 0;) is straightforward and consistent with the broader refactoring effort.

assets/styles/components/_nft-card.scss (3)

2-5: Clear Refactoring of .nft-card Styling
Converting from Tailwind utility classes to explicit properties for position, height, background-color, and border enhances readability and maintainability. The property values look appropriate for establishing the card’s layout.


33-37: Ensuring Correct Stacking for Hover Elements
Adding z-index: 10; to the .show-on-hover and .show-always elements ensures they appear above other content when visible. Verify that this stacking order meshes well with other components within the card to avoid any unintended overlap issues.


62-66: Explicit Positioning for .card-icon
The updated explicit declarations (position: absolute;, z-index: 1;, right: 1rem;, and top: 1rem;) improve clarity. Double-check that the z-index value aligns with the desired visual stacking relative to other elements (e.g., hover indicators) within the card.

assets/styles/components/_carousel-arrows.scss (1)

7-10: Explicit CSS Declarations for Arrow Base Styles
Replacing the Tailwind @apply directives with explicit CSS properties improves clarity. The new declarations (position, transform, cursor, top) are clear and align well with the intended design.

assets/styles/components/_collection-card.scss (4)

3-4: Direct Replacement of Utility Classes for Box-Shadow and Border Radius
Removing @apply for shadow-none and rounded-none in favor of box-shadow: none; and border-radius: 0; is straightforward and improves maintainability.


15-17: Cursor Style for Interactive State
Explicitly defining cursor: pointer; for non-loading states enhances the component’s interactivity clarity. Ensure that this behavior is consistent with other interactive components in the codebase.


57-64: Pseudo-Element Styling with Explicit Properties
The replacement of @apply in the pseudo-elements with properties such as content, position, width, height, z-index, left, and top is well executed. This explicit declaration improves the readability of the CSS.


73-80: Detailed Text Styling in the &__name Class
Replacing the utility class with properties for text-overflow, font-weight, font-size, overflow, white-space, and padding clarifies the intent and simplifies future adjustments.

assets/styles/components/_connect-wallet.scss (1)

64-68: Explicit Button Styling in Wallet Menu Items
Using explicit CSS for the button within .wallet-menu-item (width, font-size, border-radius, border, and transition) is a clean replacement for the previous @apply usage. This approach increases style clarity; please verify that these settings harmonize with the rest of the UI's button styles.

assets/styles/global.scss (2)

29-35: Clear Definition of Body and Anchor Styles
The conversion from @apply text-text-color to directly using color: var(--text-color); (and similarly for anchors with hover state) improves transparency. This explicit styling makes it easier to see how colors are applied throughout the app.


100-103: Explicit Ellipsis Styling for Text Overflow
The .is-ellipsis class now explicitly declares overflow, white-space, and text-overflow, which removes ambiguity that stems from utility classes. This change aids in understanding and future modifications.

assets/styles/layouts/_footer.scss (5)

12-14: Simplified Container Styling
Replacing Tailwind’s @apply for z-[1] and gap-[30px] with z-index: 1; and gap: 30px; in the .container class is clean and easy to follow. This refactor directly communicates the intended layout behavior.


32-34: Clear Styling for Inner Footer Elements
The .footer-container-inner block now explicitly defines z-index, position, and gap, which improves clarity over previous utility class usage. The use of explicit properties here benefits future maintenance and potential debugging.


81-85: Responsive Social Icons List Styling
The converted styles for the &-socials-list—including cursor, display, flex-wrap, and gap—offer a clear and maintainable approach compared to the previous @apply usage. Ensure these values align with the overall design responsiveness.


104-109: Custom Substack Widget Flex Layout
The replacement of the @apply directive with explicit flex properties (display, flex-direction, flex-wrap, height, border-radius) in the #custom-substack-embed .custom-substack-widget block is effective. This approach makes the component’s layout intentions obvious.


119-126: Detailed Input Styling within the Substack Widget
The explicit definition of font weight, font size, line height, padding, and border-radius for inputs within the custom substack widget increases clarity. This change ensures that input elements are styled precisely as desired without reliance on Tailwind’s abstraction.

Copy link

@vikiival vikiival added this pull request to the merge queue Apr 1, 2025
Merged via the queue into main with commit b3f76fc Apr 1, 2025
28 checks passed
@vikiival vikiival deleted the refactor--prepare-for-tailwind-v4 branch April 1, 2025 13:29
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.

4 participants