ember-cli-addon-docs icon indicating copy to clipboard operation
ember-cli-addon-docs copied to clipboard

WIP: Optional preflight styles

Open psbanka opened this issue 6 years ago • 2 comments

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.js to creates a tailwind.config.js file 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.js file 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?

psbanka avatar Dec 17 '19 00:12 psbanka

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

josemarluedke avatar Dec 19 '19 00:12 josemarluedke

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');

samselikoff avatar Dec 19 '19 15:12 samselikoff