Questions tagged [uncss]

UnCSS is a tool that removes unused CSS from your stylesheets. It works across multiple files and supports Javascript-injected CSS.

References

62 questions
7
votes
2 answers

Difference between uncss and purifycss

I'm already using uncss with grunt, but stumbled upon purifycss. I can't seem to find comparisons anywhere. Can anyone tell me the difference between the two to help me choose the right one?
Louis Philippe
  • 177
  • 1
  • 10
5
votes
1 answer

UNCSS not work propertly with multiple class selectors

I am using multiple class selector for certain elements in my angular js app like the following:

som text

in my CSS file I have .first and additional more specific properties for .first.second: .first{ …
xzegga
  • 3,051
  • 3
  • 25
  • 45
5
votes
1 answer

Uncss Ignore option isn't working

I'm trying remove the css with uncss but it's removing all the styles no matter if they are listed on the ignore array. The 2 files that I want to compare are just the index and the app.min.js which contains all the templates embedded in the…
pedrommuller
  • 15,741
  • 10
  • 76
  • 126
4
votes
1 answer

Can I use ReactJS with UnCSS?

I have a project that uses React and I would like to trim my CSS build file. React has no html files so I'm not sure how to get UnCSS working with React. Can I use React with UnCSS? If yes how would I proceed?
Jonathan de M.
  • 9,721
  • 8
  • 47
  • 72
4
votes
1 answer

How to use gulp-uncss to also look into javascript file and .dust templates

My application is using dust template, HTML template and also javascript to build the view. I have lot of code in javascript which add/remove the css class based on the business logic. Also this application is quite old therefore I wanted to get rid…
joy
  • 3,669
  • 7
  • 38
  • 73
3
votes
2 answers

Configuring postcss-uncss for Laravel Mix

I am trying to remove unused css rules from one or more of my sass files. Research led me to postcss-uncss as the best option for removing unused css if you do not use server-side rendering (see:…
kp123
  • 1,250
  • 1
  • 14
  • 24
3
votes
1 answer

Running uncss against Angular templates?

With uncss we can remove unused css from our stylesheets. It works by looking at the html files to be deployed and only packaging the css rules used. Angular 4 has directives that apply conditional css like this:
  • Ole
    • 41,793
    • 59
    • 191
    • 359
  • 3
    votes
    0 answers

    How to Use UnCSS with NPM Scripts

    Right now I am able to search a single html file using a custom script using NPM scripts. In particular, the following: "scripts": { "uncss": "uncss index.html > ./lib/css/app.css" } What I can't figure out is how to create a script which…
    Moshe
    • 551
    • 3
    • 7
    • 17
    3
    votes
    2 answers

    What string should I ignore on UnCSS plugin to make the responsive menu of Foundation 6 works?

    I installed Foundation 6 with NPM, started a new project with foundation new command and started building a new website. But when I build it on production with the command foundation build --production, the .top-bar class is always collapsed even…
    Edie Johnny
    • 513
    • 2
    • 5
    • 14
    3
    votes
    1 answer

    Uncss Twitter Bootstrap Modal

    I want to make use of the grunt plugin "uncss". But I still misses some classes of the bootstrap modal. Right now my grunt setup for uncss looks like this: uncss: { dist: { options: { ignore: [ ".fade", …
    Bene
    • 1,251
    • 6
    • 19
    • 34
    3
    votes
    1 answer

    How to configure grunt uncss on a php file?

    I'm new to grunt, and I'm trying to learn it. It kind of simple if I have index.html file to deal with, but I don't have it, I have index.php instead - so I've tried : uncss: { dist: { options: { ignore :…
    code-8
    • 54,650
    • 106
    • 352
    • 604
    2
    votes
    1 answer

    Is there any way to use purgecss on php files?

    I have a project where I'm not using any framework or template engine, just plain php. I came across this PurgeCSS plugin that I would like to try as all the pages in the project follow a very similar theme and I think are not using much css rules…
    Akash Sarode
    • 387
    • 2
    • 13
    2
    votes
    0 answers

    Gulp unCSS - problem with bootstrap JS classes

    I have a problem with Gulp unCSS task. The problem is that the task is cutting out bootstrap css classes (those which appear after JS events, ex. collapse, show, collapsed, collapsing etc.). I know I can put every single class in ignore option as…
    Hermi
    • 21
    • 1
    2
    votes
    1 answer

    gulp uncss - ignore via regex won´t work

    I am trying to add uncss for my gulp workflow. To ignore some classes, which are added via javascript for example, i am declaring these classes with "ignore" (in my case, i am trying to uncss the css from the jquery plugin magnific-popup). my…
    Lardo
    • 23
    • 5
    2
    votes
    1 answer

    Specify a different output css file name with gulp postcss-uncss

    Is it possible to specify a different css file name as the output using the gulp plugin postcss-uncss?
    mizanur
    • 33
    • 5
    1
    2 3 4 5