embermap/ember-cli-tailwind

ember-cli-tailwind should use the path to css defined by the host application

Closed this issue · 4 comments

ember-cli-tailwind looks for the app/styles/app.css entry point. Is it not possible to use whatever path configured by the host application?

If for example I override the default configuration in my ember-cli-build:

  let app = new EmberApp(defaults, {
    // Add options here
    outputPaths: {
      app: {
        css: {
          'app': '/assets/application-name.css'
        }
      }
    }
  })

I would expect ember-cli-tailwind to respect my configuration when looking for the entry point.

I didn't know about this config option! Yes this should work.

Is it just a bug in the blueprint (i.e. when you install e-c-tailwind, it tries to add @import to app.css)? Does it work if you add that line to your application-name.css?

Hi @samselikoff! In reality I actually want to achieve something else. I want to change the input path of css. In this case I want the app.css to reside in the app root and not in styles/app.css. I realize this now has turned into an ember-cli question.

But of course it would be good if ember-cli-tailwind respected whatever inputPath and outputPath configured into the application.

If ember-cli-tailwind gets the input path to the main css file in a non-hardcoded way, then you could just close this issue.

Ah I see. Yes going outside of treeForStyles will require some custom Ember CLI work.

I don't think Ember CLI Tailwind needs an input path to your app's main css file... the default blueprint tries its best to add an @import 'tailwind.css' line to the right file, but if it's in a non-standard spot you should be able to just add that line yourself. (Ember CLI Tailwind puts your built tailwind.css file into the root of your treeForStyles, so it should be accessible from that location regardless of how you're consuming it.)

Yes, I guess most people will not mess with the defaults and so it is not worth checking this in a less hard-coded fashion. I will really enjoy when the new file layout comes.

Please feel free to close this.