In this tutorial from Hostfa’s knowledge base going to address how to fix the Avoid expressions error in GTmetrix. Using this tutorial, you can fix this error if you had it while testing the site with GTmetrix.
Tutorial on how to fix the Avoid CSS expressions error in GTmetrix
As mentioned, this command is for changing WordPress features dynamically. For example, let’s assume that you changed the background of the site to the desired color using the following CSS color code.
Now, if you have used the CSS expressions function to change the background color of the site hourly and in the desired time frame, you are using such a command in CSS.
background-color: expression( (new Date()).getHours( )%2 ? "#eaa22f" : "#F08A00" );
As you can see, two colors have been specified, which according to the order of the background color of the site will be constantly changing to these two colors, which will be done in the form of animation like this color change. Now, in order to be able to fix this error in GT Matrix, it is enough to find the file that contains CSS expressions and change the background color of the site in any section that is similar to the code above, edit it and remove this part of the code from the file. delete
If you are unable to find this file, you can search for a folder using Notepad ++ so that all the files are checked, and you can easily find the file by searching expression and deleting this part of the CSS problem code. Fix expression from GT Matrix.