hugopipes-tailwindcss icon indicating copy to clipboard operation
hugopipes-tailwindcss copied to clipboard

Avoid PurgeCSS to remove added classes

Open rolojf opened this issue 5 years ago • 4 comments

Classes and formats defined in stie.css or classes used in the md files

rolojf avatar Feb 04 '20 14:02 rolojf

I had to do this to make it work. For your consideration, if it is useful to you. Regards. Thanks for sharing this repo.

rolojf avatar Feb 04 '20 14:02 rolojf

Hey, @rolojf I'm not sure I understand this PR. Are you adding classes to your MD files? Might be an edge case.

budparr avatar Feb 05 '20 16:02 budparr

Well, yes. It is typically what tailwindcss is for. Is it not?

To use the utility classes to modify css during content (html) creation I mean.

I agree that sometimes, classes are going to be stated in templates in the layout folder. But some other times, be used as needed during content creation in md files.

On the other hand, custom base styles will typically be defined with @apply and they are going to be on the site.css file. And it has to be scaned for classes that are used.

At least is what I think.

rolojf avatar Feb 07 '20 01:02 rolojf

If you are using css classes in your md-files it is probably better to implement shortcodes instead. I understand what you are trying to do, but imagine on a big site, it would not be very good to have to search through all the content files on build time.

olafghanizadeh avatar May 02 '20 08:05 olafghanizadeh