Css Compression Css Validation

Post your questions and problem reports here

Moderator: kfury77

Forum rules
Please try to follow these guidelines. This will help to receive faster and more accurate response.
  • Check the Support section of the corresponding product first. Chances are you will find your answer there;
  • Do not create new topics for already reported problems. Add your comments to the existing topics instead;
  • Create separate topic for each problem request. Do NOT post a number of non-related problem reports in a single topic;
  • Give your topic a meaningful title. Titles such as "A question," "Bug report" and "Help!" provide others no clue what your message is about;
  • Include the version number of the software you are using;
  • This is not an official customer support helpdesk. If you need a prompt and official response, please contact our support team directly instead. It may take a while until you receive a reply in the forum;
Post Reply
BackuPs
Posts: 1
Joined: Wed Apr 11, 2018 9:54 am

Css Compression Css Validation

Post by BackuPs »

Hi

I have two issues.

CSS Compression is not removing the LF after each element. This is how css compression should be https://csscompressor.com/

How to get the LF element also removed in the css compression.

Css validation is telling me that max-width:none; is invalid. This is incorrect as none is a valid value for max-width https://www.w3schools.com/cssref/pr_dim_max-width.asp

How to resolve that?

See image attached.Image

https://cl.ly/3M1h1A0s3j2m

https://cl.ly/3M1h1A0s3j2m


Looking forward to your reply.

Best regards,
BackuPs
User avatar
Aivars
Blumentals Software Developer
Posts: 2462
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: Css Compression Css Validation

Post by Aivars »

Our CSS compressor has always worked that way. When CSS is compressed like this, there are only a few bytes lost by not removing the newlines between rulesets but you can view, debug and overview your CSS much easier. However, if we start receiving lots of requests regarding this, we might change that policy.

We will fix the validator issue with max-width/height: none in the next update.
Blumentals Software Programmer
User avatar
pmk65
Posts: 678
Joined: Sun Dec 20, 2009 9:58 pm
Location: Copenhagen, Denmark

Re: Css Compression Css Validation

Post by pmk65 »

The compression "problem" could be solved by writing a small plugin that calls the build-in compressor, and then removes the linefeeds afterwards.

Code: Select all

function CompressCSSCode(Sender) {
    Actions.Execute("ActCSSCompress");
    Script.TimeOut(10, "RemoveLinefeeds");
}

function RemoveLinefeeds() {
    if (Document.DocType == dtCSS) {
        Editor.Text = RegexReplace(Editor.Text, "\\r?\\n|\\r", "", false);
    }
}

Script.RegisterAction("", "Compress CSS Code+", "", "CompressCSSCode");
There are 10 types of people in the world: Those who understand binary and those who don't.
Post Reply