WIP: Optional preflight styles
Pursuant to this comment from @samselikoff , I have been attempting to modify the build process to optionally include Tailwind's base/preflight styles. This PR makes an attempt at this. While I believe this is close, it does not currently work. Any suggestions would be greatly appreciated:
- I used some broccoli build-tweaking in
ember-cli-build.jsto creates atailwind.config.jsfile with the necessary configuration options set. However, despite the fact that this file is built properly, that file does not seem influence whether or not preflight styles actually get included. - Something seems to be wrong with respect to when the postcss/tailwind files are run
versus when the
tailwind.config.jsfile is processed.
I decided to go ahead and post the PR up to see if anyone might be able to provide advice for how to tackle this build problem or even suggest completely different approaches for how to configure the tailwinds.config.js at build-time?
I haven't given much thought on this, but maybe using Embroider Macros could help here.
Note that Embroider Macros works with traditional ember-cli, it's not required to have embroider.
https://github.com/embroider-build/embroider/tree/master/packages/macros
I'm wondering if there's a different approach we could take, where AddonDocs can make the different parts of its styling available to the host addon to app.import as they please. That way they can just choose which pieces to include or not.
app.import('ember-cli-addon-docs/styles/tailwind-base');
app.import('ember-cli-addon-docs/styles/tailwind-components');
app.import('ember-cli-addon-docs/styles/tailwind-utilities');
app.import('ember-cli-addon-docs/styles/component-styles');