Skip to content

@apply rule warning #381

Closed
Closed

Description

@uurcank

I get this warning from webpacker server in Rails environment

"You are using @apply rule and custom property sets. This feature won't be included in next the major release of postcss-next. This most likely won't get any more support from browser vendors as the spec is yet considered deprecated and alternative solutions are being discussed. "

Is there any other alternative to export classes in case @apply gets deprecated?

Activity

  1. adamwathan commented on Feb 11, 2018

    @adamwathan
    Contributor

    It sounds like you are running postcss-next before Tailwind; can you share your .postcssrc file or wherever it is that you setup your PostCSS plugins with Rails? Try moving postcss-next after Tailwind, I bet that will clear this warning.

    postcss-next has its own version of @apply (which Tailwind is compatible with) and that version is eventually being removed from postcss-next. That won't affect @apply in Tailwind at all though; that will continue to work forever.

  2. uurcank commented on Feb 11, 2018

    @uurcank
    Author

    thanks so much, good to know

    here is my .postcssrc file

    plugins: postcss-import: {} postcss-cssnext: {} tailwindcss: 'app/javascript/css/tailwind.js'

  3. adamwathan commented on Feb 11, 2018

    @adamwathan
    Contributor

    Got it! Yeah so change it to this:

    plugins:
      postcss-import: {}
      tailwindcss: 'app/javascript/css/tailwind.js'
      postcss-cssnext: {}
    

    ...and I bet that error will disappear unless you are using the postcss-next form of @apply in addition to how Tailwind uses it, ie:

    @apply --some-custom-ruleset; // postcss-next
    @apply .some-class; // Tailwind
    
  4. uurcank commented on Feb 11, 2018

    @uurcank
    Author

    yeap, that solves it, the error disappeared! thanks so much @adamwathan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions