Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Optional preflight styles #438

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

psbanka
Copy link
Contributor

@psbanka psbanka commented Dec 17, 2019

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?

- Current system *does not work*: the build creates a
`tailwind.config.js` file properly, but that file does not 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.
@josemarluedke
Copy link
Contributor

josemarluedke commented Dec 19, 2019

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

@samselikoff
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants