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
0
votes
1 answer

Ignore lines Gulp-Uncss

Im trying to use gulp-uncss with all my js and css files. Only with the css files works fines, the problem is that my application.js has this structure: "use strict"; (function () {})(); It seems that uncss doesn't recognize this line as js syntax…
0
votes
1 answer

UNCSS keeps aborting with "src files were empty" message

I keep getting this error with UNCSS: 'Warning: Destination (dist/css/main.css) not written because src files were empty. Use --force to contine. Aborted due to warnings. I believe it's running the task fine and is set up properly. I can use grunt…
Ghost Echo
  • 1,997
  • 4
  • 31
  • 46
0
votes
1 answer

npm install grunt-uncss and npm install grunt uncss

pretty new to grunt and just trying to use uncss. Notice their is 2 way to install it with npm: npm install uncss --save-dev and npm install grunt-uncss --save-dev. Besides one using phantom.js is their any difference ?? Pretty confused here.
Louis Philippe
  • 177
  • 1
  • 10
0
votes
1 answer

GRUNT UNCSS error

I keep getting error when I run grunt, dose anyone know how to use UNCSS with php ? Fatal error: spawn C:\Users\**.**\Desktop\PhpstormProjects\**\node_modules\phantomjs\lib\phantom\phantomjs.exe ENOENT Im not sure how to fix this problem, my UNCSS…
Beep
  • 2,737
  • 7
  • 36
  • 85
0
votes
1 answer

Why is uncss ignore not working right?

For my site i'm using uncss to remove not used bootstrap-css. But there are two elements- the bootstrap carousel slide animation and an active-state in my navigation, which do not work properly after uncss generated the new css-file. Heres my…
moeses
  • 497
  • 1
  • 6
  • 21
0
votes
0 answers

How to get Grunt UnCss to compile based on the homepage

I am trying to get UnCss to produce a cut down version of my master CSS file, for now I only want to get this working on the homepage as a test. I am using the following code: uncss: { dist: { options: { stylesheets :…
lukehillonline
  • 2,430
  • 2
  • 32
  • 48
0
votes
2 answers

Remove unwanted css Using uncss in Responsive sites

I have uncss (A project on github) to remove unwanted css for responsive site . It also removes the css mentioned in the mobile.css file , but which actually affects the site in mobile view . I don't have any idea how the uncss works ? i.e weather…
Chaitanya Babar
  • 269
  • 3
  • 12
0
votes
1 answer

Insert a comment above a selector in a nested media query in Sass

I'm using UnCSS with Sass. UnCSS removes unused CSS automatically; however, sometimes it removes things you don't want removed. You can include a comment above a rule like so: /* uncss:ignore */ .example { color: red; } ...to tell UnCSS to ignore…
Adam Johnson
  • 129
  • 1
  • 10
0
votes
2 answers

Why I am not getting a new CSS file from gulp-uncss?

I am simply trying to further compress a css file. And I am getting an error which is peculiar. I wondered why I would get a ReferenceError: Can't find variable: jQuery for just a task which solely encompasses selectors from HTML & CSS? Unless it's…
Antonio Pavicevac-Ortiz
  • 7,239
  • 17
  • 68
  • 141
0
votes
1 answer

Regex for css data attribute selectors

Trying to post-process some CSS here and need a regex to select data-attribute selectors in CSS. It will need to select the following selectors (just the selector but in it's entirety): [data-attr] { // some css } .cool-class[data-another-attr] { …
Dave Lunny
  • 750
  • 8
  • 21
0
votes
1 answer

grunt-uncss removes dynamically added classes when it shouldn't

I was introduced to Node.js today and built a very simple Hello, World app. I also started using grunt to automate builds and deployments. I am using the Bootstrap framework and colors.css.

Hello, World

I add a…
duci9y
  • 4,128
  • 3
  • 26
  • 42
0
votes
2 answers

How can I properly config the uncss in grunt?

I've tried to configure uncss using grunt I've installed npm install grunt-uncss --save-dev npm install grunt-processhtml --save-dev Configuration uncss: { dist: { files: { 'dist/css/clean.css': ['index.php'] } } } at the end I…
code-8
  • 54,650
  • 106
  • 352
  • 604
0
votes
1 answer

grunt-uncss - multiple css files

I wrote simple code, which remove unused css rules with grunt-uncss task: uncss: main: files: 'src/css/style.css': 'src/**/*.html' Is it possible to use it with multiple css files? I mean something like this: uncss: main: …
Mateusz Jagiełło
  • 6,854
  • 12
  • 40
  • 46
0
votes
1 answer

Fatal error: UnCSS: could not open

I'm trying to remove all of the unused css in the framework I'm using by using uncss. But when I try I get the error: file:///C:/Users/Angus/Desktop/FTTL%20website%20submit/index.html:15 in onload Fatal error: UnCSS: could not open…
user3709389
  • 55
  • 1
  • 1
  • 5
0
votes
1 answer

Gulp-uncss ignore option

The ignore option doesn't seem to be working for me. I'm doing the following: .pipe(plugins.uncss({ html: glob.sync('./**/*.{csh,h}tml'), ignore: ['.active'] }) Can anyone help?
Jimmy
  • 428
  • 5
  • 19