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

Prefix option does not work with custom properties #7874

Closed
bakura10 opened this issue Mar 17, 2022 · 3 comments · Fixed by #8125
Closed

Prefix option does not work with custom properties #7874

bakura10 opened this issue Mar 17, 2022 · 3 comments · Fixed by #8125
Assignees

Comments

@bakura10
Copy link
Contributor

bakura10 commented Mar 17, 2022

What version of Tailwind CSS are you using?

v3.0.23

Hi !

I am trying to use the prefix option, but I have found a problem that prevents it to work for more complex patterns. For instance, here is a simple code without any prefix:

.button {
  @apply text-[color:rgb(var(--button-background,var(--primary-button-background)))];
}

This properly generates the following markup:

.button {
  color: rgb(var(--button-background,var(--primary-button-background)));
}

When using a prefix (in my example "tw-"), if I change the apply:

.button {
    @apply tw-text-[color:rgb(var(--button-background,var(--primary-button-background)))];
  }

Then the following incorrect CSS is generated (note the lack of selector):

 {
  color: rgb(var(--button-background,var(--primary-button-background)));
}
@bakura10 bakura10 changed the title Prefix option does not work with complex CSS variables Prefix option does not work with custom properties Mar 17, 2022
@bakura10
Copy link
Contributor Author

To complement this issue, here are a few other use cases where CSS generation fails with prefix:

.accordion-content {
    @apply tw-ease-[cubic-bezier(0.77,0,0.175,1)];
  }

Generates this incorrect markup:

 {
  transition-timing-function: cubic-bezier(0.77,0,0.175,1);
}

While the same without the prefix configured generate the correct markup.

@bakura10
Copy link
Contributor Author

Hi,

Here are a few other cases where Tailwind generate incorrect CSS with prefix:

.foo {
  @apply tw-rounded-[min(4px,var(--input-border-radius))];
}

It generates the following incorrect code (notice the lack of selector):

{
  border-radius: min(4px,var(--input-border-radius));
}

@Hammond555

This comment was marked as spam.

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 a pull request may close this issue.

3 participants