Menu icon Foundation
UnCss removing injected classes

Hi,

I'm working on the rebrand of a site at the moment and we've just done a test "production" build in Gulp to check that everything's ok.

It seems that UnCss is removing classes (both Foundation & custom classes) from our css. This causes some Foundation elements to break... e.g. the dropdown menu component.

I've edited the regular expression in the Gulp Sass task as follows and it seems to pick up the correct styles now.

    ignore: [
        new RegExp('^meta\..*'),
        new RegExp('.*\.is-.*'),
        new RegExp('.*\.has-.*')
    ]

         

I still need to do a bit more work as there are some other custom styles that are still missing. We need to prefix dynamically injected classes so that we can easily exclude them from UnCss.

Would be interested to hear if anyone else has has any similar issues, and what your solution was...

Happy coding!

Jason

gulpuncssproductioninjectedcss

Hi,

I'm working on the rebrand of a site at the moment and we've just done a test "production" build in Gulp to check that everything's ok.

It seems that UnCss is removing classes (both Foundation & custom classes) from our css. This causes some Foundation elements to break... e.g. the dropdown menu component.

I've edited the regular expression in the Gulp Sass task as follows and it seems to pick up the correct styles now.

    ignore: [
        new RegExp('^meta\..*'),
        new RegExp('.*\.is-.*'),
        new RegExp('.*\.has-.*')
    ]

         

I still need to do a bit more work as there are some other custom styles that are still missing. We need to prefix dynamically injected classes so that we can easily exclude them from UnCss.

Would be interested to hear if anyone else has has any similar issues, and what your solution was...

Happy coding!

Jason

Brandon Arnold almost 4 years ago

Thanks Jason, We'd love a PR for this over on github too if you have a moment. It's on our lost to fix, but it would be a huge help to speed up the process.