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

Tailwindcss directives do not work with multiline #91

Open
marceloclp opened this issue Oct 10, 2021 · 3 comments
Open

Tailwindcss directives do not work with multiline #91

marceloclp opened this issue Oct 10, 2021 · 3 comments

Comments

@marceloclp
Copy link

marceloclp commented Oct 10, 2021

Hi, I can't get the tailwindcss @apply directive to work with multilines:

The following works:

@layer components
  .input
    @apply px-10 // Works with single classes on a single line
    @apply border border-gray-300 // Works with multiple classes on the same line

The following breaks:

@layer components
  .input
    // One class per line doesnt work
    @apply
      px-10
      border
      border-gray-300
    // Using parenthesis doesn't work
    @apply (
      px-10
      border
      border-gray-300)
    // Using \ doesn't work
    @apply \
      px-10 \
      border \
      border-gray-300
    // Using a semicolon at the end of each line doesn't work
    @apply px-10,
      border,
      border-gray-300

I am wondering if I am doing something wrong here?

@ai
Copy link
Member

ai commented Oct 10, 2021

Nope. We just have not support for multiline at-rules.

Do you want to send PR with parenthesis, \ and semicolon at the end features for at-rules?

@marceloclp
Copy link
Author

marceloclp commented Oct 10, 2021

Yes, could you point me on where to look?

@ai
Copy link
Member

ai commented Oct 10, 2021

Sure.

  1. I recommend starting from test. Then with npx jest -t 'TEST NAME' you will be able to debug some specific case.
  2. Check out what atrule() method parser.js accepts. Try to find how decl() method handle multiline values and back-port it to atrule().

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