nasa-jpl / explorer-1

JPL's Design System
https://nasa-jpl.github.io/explorer-1/
MIT License
51 stars 9 forks source link

Rethink purge settings and dist #7

Open stephiescastle opened 3 years ago

stephiescastle commented 3 years ago

Right now, the compiled CSS is purged according to usage in www-frontend. (note: I think we'd change this to purge against our HTML stories once those are ready.)

This means that other tailwind classes are removed from explorer-1.min.css. Should we also provide a version that doesn't purge them? The file would be much larger, but then users could have access to other Tailwind classes that we aren't using and purge them on their own.

I noticed this when testing BaseCarouselCards in index.html. I used p-28 for each slide. When testing this same HTML with the purged CSS, p-28 was purged, so some formatting was lost.

stephiescastle commented 3 years ago

Response from @Scotchester:

This means that other tailwind classes are removed from explorer-1.min.css. Should we also provide a version that doesn't purge them? The file would be much larger, but then users could have access to other Tailwind classes that we aren't using and purge them on their own.

I think it could be nice to offer this as an extra CSS distribution, like explorer-1_tailwind-complete.min.css or something.

Or at least offer advice on how a consumer of Explorer 1 can get access to those. I think the options for this would be:

Does that sound right?

stephiescastle commented 3 years ago

I think the options for this would be:

  • Including a Tailwind CSS dist if they're using the Explorer 1 CSS dist

  • By overriding the purge settings if you're using Explorer 1 in conjunction with your own front-end build process

Does that sound right?

@Scotchester Yes, I agree with that approach!

stephiescastle commented 2 years ago

Another approach that users can take that would eliminate this problem:

stephiescastle commented 2 years ago

Other versions of compiled CSS we should consider providing: