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

[Bug] tailwind prefix="richtext-" Causing No Style Applied on the Component #80

Open
salaarkhan-dev opened this issue Oct 20, 2024 · 2 comments

Comments

@salaarkhan-dev
Copy link

I'm currently working on an ongoing project that uses Tailwind CSS along with ShadeCN. We recently integrated a rich text editor, but the styles are not aligning with our theme. After investigating, it appears that the issue is related to the prefix configuration in Tailwind.

Expected Behavior:

The editor should apply the Tailwind styles according to our theme, with the prefix richtext- functioning correctly.

Actual Behavior:

No Tailwind styles are being applied to the component due to the prefix configuration in the build.

Steps to Reproduce:

  1. Set up a project using Tailwind CSS and ShadeCN with custom tailwind theme.
  2. Integrate the rich text editor.
  3. Observe that styles do not apply as expected.
@hunghg255
Copy link
Owner

@salaarkhan-dev I'm not sure about this problem, you can fork my repo and implement it

@salaarkhan-dev
Copy link
Author

I did work around using my own custom CSS styles and then import this CSS file where importing this component.

/* Styles for the rich text editor container */
.richtext-rounded-\[0\.5rem\] {
  @apply rounded-lg; /* Using 0.5rem (8px) rounding */
}

.richtext-bg-background {
  @apply bg-background; /* Apply your preferred background color */
}

.richtext-shadow {
  @apply shadow-lg; /* Adds a large shadow around the container */
}

.richtext-overflow-hidden {
  @apply overflow-hidden; /* Ensures content is clipped to bounds */
}

.richtext-outline {
  @apply outline-none focus:outline-blue-500; /* Default and focus outline styles */
}

.richtext-outline-1 {
  @apply outline-1; /* Sets the outline thickness */
}

/* Flex layout and size styles */
.richtext-flex {
  @apply flex;
}

.richtext-flex-col {
  @apply flex-col;
}

.richtext-w-full {
  @apply w-full;
}

.richtext-max-h-full {
  @apply max-h-full;
}

/* Editor content specific styles */
.richtext-relative {
  @apply relative; /* Sets position relative for inner components */
}

/* Character count styling */
.richtext-character-count {
  @apply text-foreground-400 text-sm; /* Use subtle color and smaller font */
}

/* Bubble menu styles */
.richtext-bubble-menu {
  @apply absolute bg-background rounded-md shadow-md p-2;
  /* Adjust padding, background, and shadow for a custom popup style */
}

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

No branches or pull requests

2 participants