Giter VIP home page Giter VIP logo

cssmin's People

Contributors

alostale avatar barryvan avatar caristu avatar discob avatar sbracegirdle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cssmin's Issues

Handle parentheses inside quoted URLs

Currently, if we have a quoted string inside a url() that contains a closing parenthesis, this will close off the url(), causing issues. It's uncommon, but can happen.

transform-origin property is not properly minimized

The CSSMin class is not handling properly the "transform-origin" property.
This property can have up three arguments (one per axis)[1]. The default value is "50% 50% 0".

If not all the parameters are defined it does not mean that the remaining ones have the same value, i.e., the 'simplified' version generated after minimize it is not equivalent.

Therefore, the same fix applied for the "background-size"[1] should be applied for the "transform-origin" property.

[1] https://www.w3schools.com/cssref/css3_pr_transform-origin.asp
[2] 24d4ed9

Some parameters shouldn't be simplified

Reported by a colleague:

The simplifyParameters function in CSSMin.java is designed to reduce the number of parameters as it can. So something like 'width: 100% 100%' gets reduced to 'width: 100%', as the second item was unneeded. Although this usually makes sense, this causes problems with the background-size property, with 'background-size: 100% 100%' not being equivalent to 'background-size: 100%'. The latter case is actually considered as 'background-size: 100% auto'; although Chrome seems to show that as we intend, Firefox does not, hence the jagged edge.

I think the solution is just to include "if (this.property.equals("background-size")) return;" as the first line of simplifyParameters

CSS Hacks

Hacks like this one:

html{
height:100%;
max-height:100%;
/* hide overflow:hidden from IE5/Mac /
/
*/
overflow: hidden;
/* */
}

need to be accounted for and worked around.

Nested selectors, space before closing bracket in new line

bug1

I am pretty sure that both are valid CSS. The first example with a space before the closing bracket raises an out of bounds exception. Its not a critical bug, but a fix is welcome :-)

java.lang.ArrayIndexOutOfBoundsException: 6
at Selector.(CSSMin.java:204)
at CSSMin.formatFile(CSSMin.java:142)
at CSSMin.formatFile(CSSMin.java:76)
at CSSMin.formatFile(CSSMin.java:64)
at CSSMin.main(CSSMin.java:54)

Regards,
Michael

webkit-keyframes declarations throw errors and are removed

Given code like this:
@-webkit-keyframes 'fadeUp' {
from { opacity: 0; }
to { opacity: 1; }
}

The compiler throws the following error:
Unterminated selector: @-webkit-keyframes 'fadeUp' { from { opacity: 0; }
Warning: Incomplete selector: }

The resulting output has the declaration removed entirely. This makes the compressor unusable if any webkit keyframes are declared.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.