Skip to content

fix: made tailwind classes compatible with all versions of consumers …#34

Merged
Zahnentferner merged 6 commits into
AOSSIE-Org:mainfrom
rahul-vyas-dev:fix/tailwind-and-UI
Jul 20, 2026
Merged

fix: made tailwind classes compatible with all versions of consumers …#34
Zahnentferner merged 6 commits into
AOSSIE-Org:mainfrom
rahul-vyas-dev:fix/tailwind-and-UI

Conversation

@rahul-vyas-dev

@rahul-vyas-dev rahul-vyas-dev commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Screenshots/Recordings:

Before: -
image
image

After: -
image

image

Summary

This PR simplifies the package build process by removing the Tailwind CSS PostCSS/Rollup integration and introduces compatibility for both Tailwind CSS v3 and Tailwind CSS v4+ consumers.

Changes

Build System

  • Removed the Tailwind CSS build dependency on Rollup/PostCSS.
  • Added a dedicated Tailwind CLI build step to generate the compiled stylesheet.
{
  "scripts": {
    "build:css": "npx @tailwindcss/cli -i ./src/styles/style.css -o ./dist/style.css --minify",
    "build:js": "rollup -c",
    "build": "npm run build:css && npm run build:js",
    "dev": "rollup -c -w",
    "prepublishOnly": "npm run build"
  }
}
  • Added @tailwindcss/cli as a development dependency.
  • Removed the previous Tailwind/PostCSS integration from the build pipeline.

Tailwind CSS Compatibility

This package now supports both Tailwind CSS v3 and Tailwind CSS v4+, accounting for the breaking changes introduced in Tailwind v4.

Tailwind CSS v4+

Consumers should import the precompiled stylesheet:

import "support-us-button/style.css";

Since Tailwind v4 supports importing compiled CSS directly, the package's generated stylesheet from dist/style.css is used without requiring consumers to compile the package's Tailwind classes.

Tailwind CSS v3 (and earlier)

Consumers should not import the compiled stylesheet.

Instead, they should include the package in their tailwind.config.js content array:

module.exports = {
  content: [
    "./src/**/*.{js,ts,jsx,tsx}",
    "./node_modules/support-us-button/dist/**/*.{js,ts,jsx,tsx}",
  ],
  theme: {
    extend: {},
  },
  plugins: [],
};

In this case, the consumer's own Tailwind v3 compiler detects and compiles the utility classes from the package, ensuring full compatibility with Tailwind v3.

Why?

Tailwind CSS v4 introduced breaking changes that make a single distribution strategy incompatible with both versions.

This PR provides the appropriate integration path for each version:

  • Tailwind v4+: Use the package's precompiled CSS (dist/style.css).
  • Tailwind v3 and earlier: Let the consumer's Tailwind compiler generate the required CSS from the package source.

This approach allows the package to work seamlessly across both Tailwind versions while keeping the build process simpler and eliminating the previous Rollup/PostCSS dependency for Tailwind CSS.

  • Added className and border props to SupportUsButton for better customization.
  • Updated the rendering of border lines to use values from the border prop.
  • Refactored the component to improve readability and maintainability.

Checklist

  • My code follows the project's code style and conventions
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contributing Guidelines

⚠️ AI Notice - Important!

We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact.

Summary by CodeRabbit

  • New Features

    • Enhanced SupportUsButton with className for custom styling.
    • Added border support for rendering customizable page-border coordinates.
    • Improved responsive layout for the main and sponsor sections.
  • Documentation

    • Updated Tailwind CSS integration guidance for v3 and v4+.
    • Expanded the documented API to include Logo, className, border, and detailed border prop usage.
  • Build Improvements

    • Split the build into dedicated CSS and JS steps and removed PostCSS from the CSS pipeline.
    • Improved Tailwind content scanning for component and entry styling.

…and some UI fixes with new features.

- Added `className` and `border` props to SupportUsButton for better customization.
- Updated the rendering of border lines to use values from the `border` prop.
- Refactored the component to improve readability and maintainability.
- Removed postcss plugin from Rollup config as Tailwind CSS is now built separately.
- Introduced new build scripts for CSS and JS in package.json.
- Updated package.json to include @tailwindcss/cli as a dependency.
- Cleaned up style.css by removing unnecessary imports and added source references.
@github-actions github-actions Bot added no-issue-linked PR is not linked to any issue configuration Configuration file changes dependencies Dependency file changes documentation Changes to documentation files frontend Changes to frontend code javascript JavaScript/TypeScript code changes size/XL Extra large PR (>500 lines changed) repeat-contributor PR from an external contributor who already had PRs merged pending-coderabbit-review labels Jul 18, 2026
@socket-security

socket-security Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​tailwindcss/​cli@​4.3.31001007798100

View full report

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

SupportUsButton now accepts className and configurable border coordinates, with updated public types and SVG rendering. Tailwind CSS compilation moves to the Tailwind CLI, while README usage and API documentation are expanded.

Changes

SupportUsButton customization and build pipeline

Layer / File(s) Summary
SupportUsButton props and border rendering
src/types/index.ts, src/index.ts, src/components/SupportUsButton.tsx
Adds the borderAroundPage type, exports it publicly, applies className, renders configurable border coordinates, and updates SVG attributes, conditional content, and responsive layouts.
Tailwind CLI build integration
src/styles/style.css, package.json, rollup.config.js, src/index.ts, VERSION
Adds Tailwind source directives, separates CSS and JavaScript build scripts, updates build tooling and versions, and removes Rollup PostCSS processing.
Usage and API documentation
README.md
Documents Tailwind v4 and earlier setup paths and adds API details for Logo, className, and border.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested labels: Documentation, Typescript Lang

Suggested reviewers: zahnentferner, bhavik-mangla, m4dhav

Poem

I’m a rabbit with borders to draw,
While Tailwind builds CSS without flaw.
New classes hop in,
SVG lines begin—
Docs bloom with each paw!

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the Tailwind compatibility focus, though it underplays the build, docs, and prop changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Around line 57-59: Update the package.json dev script to watch both Tailwind
CSS through build:css and JavaScript through the existing Rollup watcher, using
the project's available parallel execution approach or adding the necessary
concurrently setup. Preserve the existing build:css and build:js scripts while
ensuring a single dev command runs both watchers.

In `@README.md`:
- Around line 338-345: Correct the README documentation for the border props:
replace the inaccurate call-to-action description with the proper border-related
description, and change the duplicated BottomX1 table entry to BottomX2 while
preserving its type, required status, and description.

In `@src/components/SupportUsButton.tsx`:
- Line 351: Fix the invalid Tailwind responsive class by replacing
md-justify-between with md:justify-between at src/components/SupportUsButton.tsx
lines 351-351 and 372-374.
- Around line 259-261: Update the className expression in the SupportUsButton
component to use the valid `md:container` class and replace the logical-and
interpolation with a ternary that returns the responsive classes when
`projectInformation?.name` exists and an empty string otherwise, preventing
`"undefined"` from entering the class string.
- Around line 373-374: The sponsors list in the sponsors?.map rendering should
use sponsor.name as the React key instead of the array index. Update the key on
the mapped sponsor element, preserving the existing layout and rendering
behavior.
- Around line 35-51: Mark the SupportUsButton component as a client component by
adding the Next.js client directive at the top of the file before imports,
preserving its existing onClick and window.open behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: c10a8cfb-aed1-4561-ac29-b004e61413d9

📥 Commits

Reviewing files that changed from the base of the PR and between cf16cea and e9305dc.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (7)
  • README.md
  • package.json
  • rollup.config.js
  • src/components/SupportUsButton.tsx
  • src/index.ts
  • src/styles/style.css
  • src/types/index.ts
💤 Files with no reviewable changes (1)
  • rollup.config.js

Comment thread package.json
Comment thread README.md
Comment thread src/components/SupportUsButton.tsx
Comment thread src/components/SupportUsButton.tsx
Comment thread src/components/SupportUsButton.tsx
Comment thread src/components/SupportUsButton.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
package.json (1)

60-60: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Update the dev script to watch CSS changes.

Since CSS compilation was moved to a separate build:css step, the existing dev script (rollup -c -w) will no longer rebuild Tailwind styles automatically when classes are added or modified during local development. Consider updating the dev script to concurrently watch both CSS and JS.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@package.json` at line 60, Update the package.json dev script to concurrently
run the existing Rollup watch process and the build:css watch process, ensuring
both JavaScript and Tailwind CSS changes rebuild during development. Reuse the
repository’s existing concurrency tooling or add the required command
consistently with available scripts.
♻️ Duplicate comments (4)
src/components/SupportUsButton.tsx (4)

353-353: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Fix the responsive class name typo.

The md-justify-between class is invalid; Tailwind CSS responsive modifiers require a colon (md:).

  • src/components/SupportUsButton.tsx#L353-L353: Replace md-justify-between with md:justify-between.
  • src/components/SupportUsButton.tsx#L374-L374: Replace md-justify-between with md:justify-between.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/SupportUsButton.tsx` at line 353, Fix the invalid responsive
Tailwind class by replacing md-justify-between with md:justify-between at both
affected sites in src/components/SupportUsButton.tsx: lines 353-353 and 374-374.

375-376: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use a unique identifier for the list key.

Using the array index as a React key can lead to rendering issues if the list ever reorders or filters.

  • src/components/SupportUsButton.tsx#L375-L376: Use sponsor.name instead of index.
  • src/components/SupportUsButton.tsx#L245-L247: Use link.name instead of index.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/SupportUsButton.tsx` around lines 375 - 376, Replace the
index-based React keys in both sponsor and link list mappings in
src/components/SupportUsButton.tsx: use sponsor.name at lines 375-376 and
link.name at lines 245-247, preserving the existing rendering logic.

28-35: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Add "use client" to the top of the file.

This component uses client-side APIs like onClick and window.open, so it must be a client component in Next.js. As per path instructions, ensure that "use client" is being used. Please verify if it is defined at the very top of the file (before the imports) and add it if it is missing.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/SupportUsButton.tsx` around lines 28 - 35, Add the Next.js
"use client" directive at the very top of the file, before all imports, so
SupportUsButton can use its onClick handler and window.open client-side APIs.

Source: Path instructions


261-263: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Fix the responsive class name typo and avoid "undefined" in the class string.

There are two issues in this expression:

  1. md-container is a typo for the valid Tailwind class md:container.
  2. Using the && logical operator inside a template literal stringifies a falsy value (like undefined) into the literal string "undefined". Use a ternary operator to safely output an empty string when the condition is not met.
💻 Proposed fix
-          className={`mt-28 flex flex-col gap-12 ${projectInformation?.name && "md-container md:flex-row"} md:gap-4`}
+          className={`mt-28 flex flex-col gap-12 ${projectInformation?.name ? "md:container md:flex-row" : ""} md:gap-4`}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/SupportUsButton.tsx` around lines 261 - 263, Update the
className expression in SupportUsButton to use the valid `md:container` class
and replace the logical-AND interpolation with a ternary that returns the
responsive classes when projectInformation?.name exists and an empty string
otherwise, preventing `"undefined"` from entering the class string.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/SupportUsButton.tsx`:
- Around line 218-225: Update the anchor in the SupportUsButton component to use
the existing validatedUrl variable for href instead of interpolating
organizationInformation.link. Preserve the validation behavior and avoid
rendering an undefined URL when no link is provided.

In `@VERSION`:
- Line 1: Update the version value in VERSION from 2.1.0 to match the
package.json version, 2.1.1.

---

Outside diff comments:
In `@package.json`:
- Line 60: Update the package.json dev script to concurrently run the existing
Rollup watch process and the build:css watch process, ensuring both JavaScript
and Tailwind CSS changes rebuild during development. Reuse the repository’s
existing concurrency tooling or add the required command consistently with
available scripts.

---

Duplicate comments:
In `@src/components/SupportUsButton.tsx`:
- Line 353: Fix the invalid responsive Tailwind class by replacing
md-justify-between with md:justify-between at both affected sites in
src/components/SupportUsButton.tsx: lines 353-353 and 374-374.
- Around line 375-376: Replace the index-based React keys in both sponsor and
link list mappings in src/components/SupportUsButton.tsx: use sponsor.name at
lines 375-376 and link.name at lines 245-247, preserving the existing rendering
logic.
- Around line 28-35: Add the Next.js "use client" directive at the very top of
the file, before all imports, so SupportUsButton can use its onClick handler and
window.open client-side APIs.
- Around line 261-263: Update the className expression in SupportUsButton to use
the valid `md:container` class and replace the logical-AND interpolation with a
ternary that returns the responsive classes when projectInformation?.name exists
and an empty string otherwise, preventing `"undefined"` from entering the class
string.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: e9ff0fba-00dc-42bd-9faf-1fe4a83a63e2

📥 Commits

Reviewing files that changed from the base of the PR and between e9305dc and e485644.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • VERSION
  • package.json
  • src/components/SupportUsButton.tsx

Comment thread src/components/SupportUsButton.tsx
Comment thread VERSION
@Zahnentferner
Zahnentferner merged commit f5d2d97 into AOSSIE-Org:main Jul 20, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

configuration Configuration file changes dependencies Dependency file changes documentation Changes to documentation files frontend Changes to frontend code javascript JavaScript/TypeScript code changes no-issue-linked PR is not linked to any issue pending-coderabbit-review repeat-contributor PR from an external contributor who already had PRs merged size/XL Extra large PR (>500 lines changed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants