0

I am trying to optimize my website and have found one issue of minification with the CSS file:
http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css

I thought of minifiying the script normally using minification tools but no effect. Tried to minify with the help of plugins but there is nothing changed in the Google insights result.

Hence would like to know hwat could be done to minify such css files.

1
  • @MoisheLipsker Yes I did. Actually, the minification can be done but where I need to put it. As the css is external it is a bit difficult to locate where exactly it have been used. The website is too large and code bulky. Hence searching for the finest way to resolve it. Commented Sep 1, 2017 at 6:44

2 Answers 2

1

Download the code from the url and then paste it to a local css file. Call the css file on your code after doing minification. You're done.

Sign up to request clarification or add additional context in comments.

2 Comments

Do I need to link it somewhere, as I do not want to disturb my other css files. I would like to keep it isolated but still functioning.
You can link it with another local css file and don't forget to delete the original link from the main code. No need to add the code in the main css file. Mostly I do minification for external css files in this way though it's not a good idea as google update their code frequently. But it saves my time and helps me to do speed optimization.
1

There are some options you may choose from:

  1. Very Basic: Use an online minifier like https://cssminifier.com/. You can enter the css content in a text area and minify it or you could it's API and

  2. Extend your bulid pipeline to use a plugin that handles css: gulp-cssmin or gulp-clean-css are examples for gulp.

    Int this answer you see an easy usage example on how to compile less to css and then minify it. Using less is of course optional.

  3. Some editors like atom support minifying a css file without any plugins. Other editors like Visual Studio Code may need an extension to support that.

Regarding that you want to minify an external file:

I'd try to minify it when building your project and not on client side since the client would likely have to download your script before minifying, making the minifying useless.

I recommend just downloading it, maybe with bower, and then minifying it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.