vendredi 12 juillet 2019

Ember / PostCSS / Tailwind - where do directives get parsed?

I've assembled a vanilla combination of ember, postcss, and tailwind, and for the life of me, I cannot understand why this code works.

For a generic ember app with postcss and tailwind:

ember new poc-tailwind --yarn
ember install ember-cli-postcss
yarn add tailwindcs

Then to configure postcss in ember-cli-build:

module.exports = function(defaults) {
  let app = new EmberApp(defaults, {
    postcssOptions: {
      compile: {
        plugins: [
          require('tailwindcss')
        ]
      }
    }
  });

  return app.toTree();
};

And then finally in app.css:

@tailwind base;

@tailwind components;

@tailwind utilities;

Again, the strange thing is this works.

Can anyone explain why those directives are working? And how they're getting glued together?




Aucun commentaire:

Enregistrer un commentaire