google / closure-stylesheets Goto Github PK
View Code? Open in Web Editor NEWA CSS+ transpiler that lints, optimizes, and I18n-izes
License: Apache License 2.0
A CSS+ transpiler that lints, optimizes, and I18n-izes
License: Apache License 2.0
Originally reported on Google Code with ID 17
In the ClosureCommandLineCompiler class the default constructor is protected, but one
of its parameter OutputInfo is private, which will not allow any other class to call
this constructor.
I'm building a system that will call the compiler directly in java without using the
command line itself, but this situation will block my call.
Reported by terciofilho
on 2012-04-12 00:12:13
Originally reported on Google Code with ID 33
New command line option '--input-rename-css-map-file'.
Ability to load a renaming css-map from external properties file added.
This is necessary if we need to create more than one compressed css-files that have
the same classes.
Reported by igor.demyanov
on 2013-04-10 12:44:01
Originally reported on Google Code with ID 10
What steps will reproduce the problem?
1. whenever css media type is used, parser is throwing GssParserException
2. Reference http://www.w3schools.com/css/css_mediatypes.asp
3. Input
---
@media print{ html { background:#fff; } }
---
What is the expected output?
@media print{html{background:#fff;}}
What version of the product are you using? On what operating system?
closure-stylesheets-20111215.jar, Windows XP Professional
Please provide any additional information below.
Reported by palam.c
on 2011-12-23 08:38:24
The divide function seems locale sensitive.
On a computer with fr_FR as the locale (Windows 7 pro) the compiled CSS for say:
width: divide(BIG_MARGIN, 2);
Where BIG_MARGIN equals "25px" is "12,5px" (a comma). One would expect "12.5px" (a dot)
Originally reported on Google Code with ID 40
What steps will reproduce the problem?
1. d:\Work\test>java -jar bin/closure-stylesheets.jar --rename CLOSURE --output-file
build/outputcompiled.css css/test.css
Contents of test.css:
.test{
width: calc(100% - 1px);
}
What is the expected output?
Expect to see minified css in file named outputcompiled.css
What do you see instead?
Compiler parsing error: Parse error in css/test.css at line 2 column 22:
width: calc(100% - 1px);
^
com.google.common.css.compiler.ast.GssParserException: Parse error in css/test.css
at line 2 column 22:
width: calc(100% - 1px);
^
at com.google.common.css.compiler.ast.GssParserCC.parse(GssParserCC.java:176)
at com.google.common.css.compiler.ast.GssParser.parse(GssParser.java:46)
at com.google.common.css.compiler.commandline.DefaultCommandLineCompiler.parseAndPrint(DefaultCommandLineCompiler.ja
va:104)
at com.google.common.css.compiler.commandline.DefaultCommandLineCompiler.compile(DefaultCommandLineCompiler.java:94)
at com.google.common.css.compiler.commandline.DefaultCommandLineCompiler.execute(DefaultCommandLineCompiler.java:129
)
at com.google.common.css.compiler.commandline.ClosureCommandLineCompiler.executeJob(ClosureCommandLineCompiler.java:
290)
at com.google.common.css.compiler.commandline.ClosureCommandLineCompiler.main(ClosureCommandLineCompiler.java:356)
Caused by: com.google.common.css.compiler.ast.ParseException: Encountered " <S> "
"" at line 2, column 22.
Was expecting:
<NUMBER> ...
at com.google.common.css.compiler.ast.GssParserCC.generateParseException(GssParserCC.java:3756)
at com.google.common.css.compiler.ast.GssParserCC.jj_consume_token(GssParserCC.java:3635)
at com.google.common.css.compiler.ast.GssParserCC.term(GssParserCC.java:1562)
at com.google.common.css.compiler.ast.GssParserCC.slash_term(GssParserCC.java:1494)
at com.google.common.css.compiler.ast.GssParserCC.assign_term(GssParserCC.java:1446)
at com.google.common.css.compiler.ast.GssParserCC.composite_term(GssParserCC.java:1397)
at com.google.common.css.compiler.ast.GssParserCC.expr(GssParserCC.java:1379)
at com.google.common.css.compiler.ast.GssParserCC.function(GssParserCC.java:2092)
at com.google.common.css.compiler.ast.GssParserCC.term(GssParserCC.java:1682)
at com.google.common.css.compiler.ast.GssParserCC.slash_term(GssParserCC.java:1494)
at com.google.common.css.compiler.ast.GssParserCC.assign_term(GssParserCC.java:1446)
at com.google.common.css.compiler.ast.GssParserCC.composite_term(GssParserCC.java:1397)
at com.google.common.css.compiler.ast.GssParserCC.expr(GssParserCC.java:1370)
at com.google.common.css.compiler.ast.GssParserCC.standardDeclaration(GssParserCC.java:1335)
at com.google.common.css.compiler.ast.GssParserCC.styleDeclaration(GssParserCC.java:1193)
at com.google.common.css.compiler.ast.GssParserCC.ruleSet(GssParserCC.java:463)
at com.google.common.css.compiler.ast.GssParserCC.block(GssParserCC.java:2856)
at com.google.common.css.compiler.ast.GssParserCC.start(GssParserCC.java:2903)
at com.google.common.css.compiler.ast.GssParserCC.parse(GssParserCC.java:174)
... 6 more
What version of the product are you using? On what operating system?
Latest from git, windows 7.
Please provide any additional information below.
option
--allowed_non_standard_function calc()
won't help.
Reported by alexeykofficial
on 2013-10-11 09:49:30
What steps will reproduce the problem?
1.Clone the latest closure-stylesheets and compile
2.specify output-source-map when building gss
java -jar build/closure-stylesheets.jar --allow-unrecognized-properties --output-renaming-map-format CLOSURE_UNCOMPILED --rename CLOSURE --output-renaming-map renaming_map.js --output-source-map test.source.map --output-file test.css test.gss
What is the expected output? What do you see instead?
I got an error:
Compiler internal error: null
java.lang.IllegalStateException
at com.google.common.base.Preconditions.checkState(Preconditions.java:133)
at com.google.common.css.compiler.passes.DefaultGssSourceMapGenerator.endSourceMapping(DefaultGssSourceMapGenerator.java:157)
at com.google.common.css.compiler.passes.CodePrinter.leave(CodePrinter.java:103)
at com.google.common.css.compiler.passes.UniformVisitor.leaveImportBlock(UniformVisitor.java:266)
at com.google.common.css.compiler.ast.DefaultVisitController$RootVisitImportBlockState.doVisit(DefaultVisitController.java:387)
at com.google.common.css.compiler.ast.DefaultVisitController.startVisit(DefaultVisitController.java:2028)
at com.google.common.css.compiler.passes.CompactPrinter.runPass(CompactPrinter.java:473)
at com.google.common.css.compiler.commandline.DefaultCommandLineCompiler.parseAndPrint(DefaultCommandLineCompiler.java:127)
at com.google.common.css.compiler.commandline.DefaultCommandLineCompiler.compile(DefaultCommandLineCompiler.java:110)
at com.google.common.css.compiler.commandline.DefaultCommandLineCompiler.execute(DefaultCommandLineCompiler.java:149)
at com.google.common.css.compiler.commandline.ClosureCommandLineCompiler.executeJob(ClosureCommandLineCompiler.java:335)
at com.google.common.css.compiler.commandline.ClosureCommandLineCompiler.main(ClosureCommandLineCompiler.java:400)
What version of the product are you using? On what operating system?
Latest clone from github, mac os x and java 1.8
Please provide any additional information below.
I generated a gss file that contains comma in the property value and enable output-source-map both, then closure stylesheets throw an exception above.
i also generated a gss file(test2.gss) that not contains comma in the property value, then compile it using same parameter, it works fine.
test.gss:
.test {
font-family: Helvetica, Tahoma;
}
test2.gss
.test2 {
font-family: Helvetica;
}
Originally reported on Google Code with ID 34
What steps will reproduce the problem?
1. java -jar closure-stylesheets-20130114.jar style.css
2. style.css contains multiple declarations of background property in same rule definition
3. error occurs
What is the expected output? What do you see instead?
Expected output would be correctly compiled css file:
body{background:white;background:red}
Instead of that I see following error output:
Detected multiple identical, non-alternate declarations in the same ruleset. If this
is intentional please use the /* @alternate */ annotation. background:[red] in style.css
at line 4 column 1:
}
^
1 error(s), 0 warning(s)
What version of the product are you using? On what operating system?
closure-stylesheets-20130114.jar
jdk-7u17-linux-x64
Ubuntu 11.10 x64
Please provide any additional information below.
Please provide command line argument which can turn off identical declarations check.
Many popular css components / frameworks uses identical property declarations (css3please.com,
jquery mobile, ...). So anytime I am integrating / upgrading such tool I have to fix
their css files with /* @alternate */ command. Would be better to just turn off this
check and save my time.
Reported by martin.sznapka
on 2013-04-11 14:57:33
Originally reported on Google Code with ID 38
Added new functions.
Reported by GoLocalTeam
on 2013-09-04 12:26:49
The Project Home page at https://code.google.com/p/closure-stylesheets/ had a good summary of Closure Stylesheets' features, but github has no README and doesn't point to any equivalent documentation that I can find. Any reason not to convert the Project Home from code.google.com to a README.md?
Originally reported on Google Code with ID 8
It is not possible to specify the OptimizeStrategy in JobDescriptionBuilder because
there is no setter for it.
Working with current HEAD (1 Dec 2011).
Reported by martin.grigorov
on 2011-12-01 14:45:14
Originally reported on Google Code with ID 24
Source files:
--- menu.gss ---
li.social {
@mixin debug_italics();
padding-left: 15px;
}
--- 00-debug.gss ---
@if (DEBUG) {
@defmixin debug_italics() {
font-style: italics;
}
} @else {
@defmixin debug_italics() {
/* Nothing. */
}
}
-- OR --
li.social {
@if (DEBUG) {
font-style: italic;
}
padding-left: 15px;
}
-------------------------------
Neither work, the first example results in:
Compiler internal error: com.google.common.css.compiler.ast.CssMixinNode cannot be
cast to com.google.common.css.compiler.ast.CssDeclarationNode
java.lang.ClassCastException: com.google.common.css.compiler.ast.CssMixinNode cannot
be cast to com.google.common.css.compiler.ast.CssDeclarationNode
at com.google.common.css.compiler.passes.DisallowDuplicateDeclarations.enterRuleset(DisallowDuplicateDeclarations.java:64)
at com.google.common.css.compiler.ast.DefaultVisitController$VisitRulesetState.doVisit(DefaultVisitController.java:762)
at com.google.common.css.compiler.ast.DefaultVisitController.startVisit(DefaultVisitController.java:1762)
at com.google.common.css.compiler.passes.DisallowDuplicateDeclarations.runPass(DisallowDuplicateDeclarations.java:75)
at com.google.common.css.compiler.passes.PassRunner.runPasses(PassRunner.java:142)
at com.google.common.css.compiler.commandline.DefaultCommandLineCompiler.parseAndPrint(DefaultCommandLineCompiler.java:106)
at com.google.common.css.compiler.commandline.DefaultCommandLineCompiler.compile(DefaultCommandLineCompiler.java:94)
at com.google.common.css.compiler.commandline.DefaultCommandLineCompiler.execute(DefaultCommandLineCompiler.java:129)
at com.google.common.css.compiler.commandline.ClosureCommandLineCompiler.executeJob(ClosureCommandLineCompiler.java:286)
at com.google.common.css.compiler.commandline.ClosureCommandLineCompiler.main(ClosureCommandLineCompiler.java:359)
--------------------
The second results in:
Compiler internal error: com.google.common.css.compiler.ast.CssUnknownAtRuleNode cannot
be cast to com.google.common.css.compiler.ast.CssDeclarationNode
java.lang.ClassCastException: com.google.common.css.compiler.ast.CssUnknownAtRuleNode
cannot be cast to com.google.common.css.compiler.ast.CssDeclarationNode
at com.google.common.css.compiler.passes.DisallowDuplicateDeclarations.enterRuleset(DisallowDuplicateDeclarations.java:64)
at com.google.common.css.compiler.ast.DefaultVisitController$VisitRulesetState.doVisit(DefaultVisitController.java:762)
at com.google.common.css.compiler.ast.DefaultVisitController.startVisit(DefaultVisitController.java:1762)
at com.google.common.css.compiler.passes.DisallowDuplicateDeclarations.runPass(DisallowDuplicateDeclarations.java:75)
at com.google.common.css.compiler.passes.PassRunner.runPasses(PassRunner.java:142)
at com.google.common.css.compiler.commandline.DefaultCommandLineCompiler.parseAndPrint(DefaultCommandLineCompiler.java:106)
at com.google.common.css.compiler.commandline.DefaultCommandLineCompiler.compile(DefaultCommandLineCompiler.java:94)
at com.google.common.css.compiler.commandline.DefaultCommandLineCompiler.execute(DefaultCommandLineCompiler.java:129)
at com.google.common.css.compiler.commandline.ClosureCommandLineCompiler.executeJob(ClosureCommandLineCompiler.java:286)
at com.google.common.css.compiler.commandline.ClosureCommandLineCompiler.main(ClosureCommandLineCompiler.java:359)
------------------
I've tried this with the tip-of-the-tree version, the latest downloadable version,
and the version before that, all with the same errors. What do?
Reported by SeligArkin
on 2012-07-22 22:23:27
Originally reported on Google Code with ID 3
Would like to be able to have default mixin argument values:
{{{
@defmixin roundedBorder(SIZE = 3px) {
-moz-border-radius: SIZE;
-webkit-border-radius: SIZE;
border-radius: SIZE;
}
}}}
Reported by Zoramite
on 2011-11-15 20:38:49
Originally reported on Google Code with ID 5
The compiler seems to stumble when running across this line:
@font-face {
font-family: 'MetaSerifMedium';
src: url('/font/MetaSerifWeb-Medium.eot?') format('eot'), url('/font/
MetaSerifWeb-Medium.woff') format('woff');
}
With this error:
Compiler parsing error: Parse error in gss/app.gss at line 2 column
16:
font-family: 'MetaSerifMedium';
^
com.google.common.css.compiler.ast.GssParserException: Parse error in
gss/app.gss at line 2 column 16:
font-family: 'MetaSerifMedium';
^
at
com.google.common.css.compiler.ast.GssParserCC.parse(GssParserCC.java:
162)
at com.google.common.css.compiler.ast.GssParser.parse(GssParser.java:
46)
at
com.google.common.css.compiler.commandline.DefaultCommandLineCompiler.parseAndPrint(DefaultCommandLineCompiler.java:
107)
at
com.google.common.css.compiler.commandline.DefaultCommandLineCompiler.compile(DefaultCommandLineCompiler.java:
96)
at
com.google.common.css.compiler.commandline.DefaultCommandLineCompiler.execute(DefaultCommandLineCompiler.java:
132)
at
com.google.common.css.compiler.commandline.ClosureCommandLineCompiler.executeJob(ClosureCommandLineCompiler.java:
274)
at
com.google.common.css.compiler.commandline.ClosureCommandLineCompiler.main(ClosureCommandLineCompiler.java:
347)
Is it possible to use @font-face w/ the compiler? Perhaps using a
different syntax? If it's not, is there planned support?
Reported by patrick.hawks
on 2011-11-21 17:33:40
Originally reported on Google Code with ID 4
Ability to import mixins from another gss file.
For example, if the borderRadius
mixin was defined in the commonMixins.gss
file:
@import commonMixins.gss
.myBox {
@mixin borderRadius(3px);
}
Reported by Zoramite
on 2011-11-15 20:42:41
Originally reported on Google Code with ID 16
I am using css with Qt, I have a css as follow:
QSlider::sub-page:horizontal
{
background: qlineargradient(x1:1, y1:0, x2:0, y2:0, stop: 0 COLOR8, stop: 1 COLOR6);
margin-top: 5px;
margin-bottom: 5px;
}
COLOR8 and COLOR6 are defined already.
The parser has errors as follow:
Compiler parsing error: Parse error in ShivaQt.gss at line 150 column 35:
background: qlineargradient(x1:1, y1:0, x2:0, y2:0, stop: 0 COLOR8, stop: 1 COLOR6);
^
com.google.common.css.compiler.ast.GssParserException: Parse error in ShivaQt.gss at
line 150 column 35:
background: qlineargradient(x1:1, y1:0, x2:0, y2:0, stop: 0 COLOR8, stop: 1 COLOR6);
I used option " --allow-unrecognized-functions" but not works. I only want the closure-stylesheets
pars "COLOR8" and "COLOR6" for me, the version I use is closure-stylesheets-20111230.jar.
Is there any other way I can avoid this issue or it is a limitation currently for such
function "qlineargradient" from Qt?
Reported by machangan0514
on 2012-04-05 08:02:12
Originally reported on Google Code with ID 30
What steps will reproduce the problem?
1. Set a box-shadow with multiple shadows, using @def or @defmixin parameters.
2. All but the last shadow set will quote the names literally in the compiled output.
What is the expected output? What do you see instead?
All the colour constants should be evaluated, eg:
@def FG_LIGHT rgb(255,255,255);
@def FG_MID rgb(128,128,128);
@def FG_DARK rgb(71,71,71);
@defmixin boxshadow(COL1,COL2,COL3) {
box-shadow: inset 0px 0px 0px 1px COL1, inset 0px 2px 1px 0px COL2, inset 0px 0px 0px
2px COL3;
}
@mixin boxshadow(FG_DARK,FG_LIGHT,FG_MID);
or
box-shadow: inset 0px 0px 0px 1px FG_DARK, inset 0px 2px 1px 0px FG_LIGHT, inset 0px
0px 0px 2px FG_MID;
Both should produce:
box-shadow: inset 0px 0px 0px 1px rgb(71,71,71), inset 0px 2px 1px 0px rgb(255,255,255),
inset 0px 0px 0px 2px rgb(128,128,128);
however, both actually produce, respectively:
box-shadow: inset 0px 0px 0px 1px COL1, inset 0px 2px 1px 0px COL2, inset 0px 0px 0px
2px rgb(128,128,128);
and
box-shadow: inset 0px 0px 0px 1px FG_DARK, inset 0px 2px 1px 0px FG_LIGHT, inset 0px
0px 0px 2px rgb(128,128,128);
What version of the product are you using? On what operating system?
Latest compiler (packaged 12/12/12), Windows 7 x64 with Java 7
Please provide any additional information below.
Reported by zulaxia
on 2013-01-18 10:12:00
Originally reported on Google Code with ID 12
What steps will reproduce the problem?
1. set "--output-file" to a non-existent file path
2. error message "The compiler encountered an unhadled error condition."
What is the expected output? What do you see instead?
"The compiler encountered an unhandled error condition."
What version of the product are you using? On what operating system?
Build date 20111215. Windows XP
Please provide any additional information below.
Cheers :)
Reported by rviscomi
on 2012-02-04 02:18:55
Originally reported on Google Code with ID 28
What steps will reproduce the problem?
Compiling following test stylesheet:
*:focus {
outline-offset: -1px;
outline: 1px solid black;
}
result was:
*:focus{outline:1px solid black}
outline-offset property simply omitted without error.
However, when properties places exchanged (outline property on top),
i got following error:
outline-offset is an unrecognized property in test.css at line 3 column 2:
outline-offset: -1px;
^
1 error(s), 0 warning(s)
What is the expected output? What do you see instead?
Error from compiler or outline-offset option in compiled css.
What version of the product are you using? On what operating system?
Revision: c9f1228275dc
Reported by vbatichko
on 2012-10-02 20:48:22
Originally reported on Google Code with ID 23
What steps will reproduce the problem?
1. source file:
body{border: 1px blue solid;}
#id{
width: 10px;
height: 20px;
}body{border: 1px blue solid;}
#id2{
width: 10px;
height: 20px;
}body{border: 1px blue solid;}
#id3{
width: 10px;
height: 20px;
}
out-file:
#id,#id2{width:10px;height:20px}body{border:1px blue solid}#id3{width:10px;height:20px}
What is the expected output? What do you see instead?
expected :: #id,#id2,#id3{width:10px;height:20px}body{border:1px blue solid}
What version of the product are you using? On what operating system?
:: use stylesheets-20111230.jar
Reported by weirhp
on 2012-06-27 06:47:59
Originally reported on Google Code with ID 15
Added support for some new CSS Properties for text(from the W3C Working Draft)
Reported by blub201087
on 2012-03-24 21:12:10
Originally reported on Google Code with ID 6
Add customer ant task for building css from one or more gss source file.
similar solution exists for javascript closure.
http://code.google.com/p/closure-compiler/wiki/BuildingWithAnt
Reported by songyunhui2008
on 2011-11-22 02:48:23
Originally reported on Google Code with ID 1
In order to easier adoption of the library, please publish it in maven central repo
(same as closure compiler).
Thanks,
Alex
Reported by alex.objelean
on 2011-11-13 09:08:17
Hi,
in the bootstrap css
input[type="checkbox"] {
margin: 4px 0 0;
margin-top: 1px \9;
line-height: normal; }
I think it is a the same issue as described here on google code
https://code.google.com/p/closure-stylesheets/issues/detail?id=20
Any idea how to work around this without modify the source css?
Parameter source_map_output_level cannot be specified.
I took a look at ClosureCommandLineCompiler.java, the following code caused issue:
@option(name = "source_map_output_level", usage = "The level to generate "
+ "source maps. You could choose between DEFAULT, which will generate "
+ "source map only for selectors, blocks, rules, variables and symbol "
+ "mappings, and ALL, which outputs mappings for all elements.")
private SourceMapDetailLevel sourceMapLevel = SourceMapDetailLevel.DEFAULT;
The Option name does not starts with "--" so we unable to pass it to args4j.
I add double hash before parameter name to fix it: #13
Originally reported on Google Code with ID 31
What steps will reproduce the problem?
When a string contains a unicode character specification, it does not parse properly.
Specifically, it works when it is 6 digits long, but not if it is less.
This works:
.rule:after { content: " \00203a "; }
This breaks:
.rule:after { content: " \203a "; }
This should be allowed according to the CSS2 spec:
http://www.w3.org/TR/CSS2/syndata.html#characters
Reported by [email protected]
on 2013-03-15 15:13:13
Originally reported on Google Code with ID 36
What steps will reproduce the problem?
1. create the following css style
.cssButton {background-color: #00853f; background: linear-gradient(0deg, #00853f, #7BAE3B
); }
2. Run the google closure compiler (version 20111230.jar) against this style
3. The background-color style is ignored without warning and excluded from the compiled-output-file
4. If you place the background-color AFTER the background: linear-gradient(...) style...
then the compiler at least puts both styles into the compiled output
What is the expected output? What do you see instead?
expected output is a possible warning or error indicating that the
background-color attribute will be ignored or excluded from the output-file
What version of the product are you using? On what operating system?
(version 20111230.jar) running on SunOS 5.10 with jre1.6.0_33
Please provide any additional information below.
it's possible that the compiler is correct in excluding the background-color in favor
of the abbreviated syntax "background:...." style but there should be a warning or
error thrown.
Reported by ericjrickard
on 2013-06-21 18:00:36
Originally reported on Google Code with ID 14
What steps will reproduce the problem?
1. Use text-justify CSS3 property.
What is the expected output? What do you see instead?
The compiler doesn't support the text-justify property:
text-justify is an unrecognized property in main.gss at line 387 column 3:
text-justify: auto;
^
1 error(s)
What version of the product are you using? On what operating system?
closure-stylesheets-20111230.jar
Please provide any additional information below.
Reported by ltrabuco
on 2012-03-18 14:14:36
Originally reported on Google Code with ID 26
CSS syntax for @keyframes, @-ms-keyframes and @-o-keyframes is not supported.
What steps will reproduce the problem?
1. java -jar closure-stylesheets-20111230.jar test.css --allow-unrecognized-properties
--allow-unrecognized-functions
2. An error is given for 0% syntax, which is correct.
What is the expected output? What do you see instead?
Minified css expected, instead - parser error.
What version of the product are you using? On what operating system?
20111230, Windows 7
Reported by [email protected]
on 2012-08-07 19:23:40
There should be some way to process mixin parameters in conditional way, e.g.
@defmixin test(AAA) {
@if (AAA == 5) {...}
@else {...}
}
As simpler solution, may be selectFrom should be extended to be like Oracle decode() http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions040.htm
Originally reported on Google Code with ID 32
What steps will reproduce the problem?
1. create a one-line css file "bug.css", containing only the following line:
LI.trail:before { content: "> "; }
2. run losure-stylesheets as follows:
java -jar closure-stylesheets.jar bug.css
3. get the following output:
LI.trail:before{content:"\00003e "}
There are several issues with the output:
- The space after "\00003e" needs to be doubled. See section 4.1.4
of http://www.w3.org/TR/CSS21/syndata.html for reference:
Only one white space character is ignored after a hexadecimal
escape. Note that this means that a "real" space after the escape
sequence must be doubled.
This problem causes html pages using the minified style sheet
to render differently from pages which use the original style sheet.
- The trailing zeros in "\00003e" seem unnecessary. Four characters
could be saved by writing "\3e" instead.
- Does the ">" need escaping at all?
The problem is present in current git (commit id
86bb800d79a32bfc0328bbf74bfeb772c6eb73b0)
I hope this helps,
Jochen
Reported by jochen.voss
on 2013-03-22 15:17:14
Originally reported on Google Code with ID 27
What steps will reproduce the problem?
1. pick a stylesheet
2. somewhere in that stylesheet put a class called 'a'
3. put a in --exluded-classes-from-renaming
What is the expected output? What do you see instead?
it is expected that no class will be renamed to 'a' as it is already in use
What version of the product are you using? On what operating system?
the latest
Please provide any additional information below.
came across this when adblock was hiding our site because 'body' was being renamed
to 'Ad' which was in the filters. Tried creating a class called 'Ad' but that was being
renamed and body was still 'Ad' so added it to the exclude renaming but would be worse
as 'body' was still 'Ad' and now we have two class definitions for 'Ad'
Reported by rhysbrettbowen
on 2012-08-31 21:02:46
Originally reported on Google Code with ID 19
Example:
/* Does not generate error. */
@def RANDOM_COLOR randomColor('light');
/* Correctly generates error: Unknown function "randomColor". */
button {
color: randomColor('light');
}
Reported by cpeisert
on 2012-05-29 02:48:58
Originally reported on Google Code with ID 25
What steps will reproduce the problem?
1. Define a variable e.g: @def width 10
2. Use this variable in style as .style1 { width: width; }
3. width is not replaced with the value 10.
What is the expected output? What do you see instead?
Expected output is width to be assigned value 10 which instead is being set as width.
What version of the product are you using? On what operating system?
closure-stylesheet version: using jar closure-stylesheets-20111230.jar
OS: windows7
Please provide any additional information below.
It is no where documented that variable name must be in upper case. It is documented
only for mixins. In code, the condition isDefinitionReference of CssConstantReferenceNode
class is used both for mixins and variable verification and only throws error for mixins
and not variables. Hence, the pareser silently moves forward without replacing the
lower case variable values and we get the issues at later stages.
Reported by nitu.mca
on 2012-08-07 10:44:57
The following media query produces a parsing exception
@media screen and (color),(max-width: 60em) {
.stuff {
background-color: red;
}
}
com.google.common.css.compiler.ast.GssParserException: Parse error in /../../style.css at line 1 column 26:
@media screen and (color), (max-width: 60em) {
^
Caused by: com.google.common.css.compiler.ast.ParseException: Encountered " "," ", "" at line 1, column 26.
Was expecting one of:
As far as I know it should be valid css.
I'm using 20140426
Originally reported on Google Code with ID 11
I would like to write browser conditioning with less coding.
This seems nice to me,
.item {
color: green;
/* @if (IE6) */ color: red;
}
if (--define IE6), two `color' will be output.
Closure Stylesheets would reach more complex web project than usual, so browser conditioning
would be more needed in order to handle performance issues.
What do you think?
Reported by ThePigLovesYou
on 2012-02-02 10:29:58
Originally reported on Google Code with ID 41
What steps will reproduce the problem?
1. Use the following simple CSS:
*,body,.inner-playable-list-item {
-webkit-user-select: none;
/* @alternate */
-khtml-user-select: none;
/* @alternate */
-moz-user-select: none;
/* @alternate */
-ms-user-select: none;
/* @alternate */
user-select: none;
-webkit-touch-callout: none;
}
2. Use the jar with following options:
--allowed-unrecognized-property user-select
--output-renaming-map-format CLOSURE_COMPILED
--rename CLOSURE
What is the expected output? What do you see instead?
Valid minified CSS file
Instead the following is produced:
*,body,.a-b-c-d{-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-touch-callout:none}
Notice the missing semicolon after the last property value. (none} instead of none;}).
What version of the product are you using? On what operating system?
The jar does not seem to have -version command.
Please provide any additional information below.
The jar was built from the source because several important properties in css are added
after the last official release.
Reported by regardingScot
on 2013-10-31 10:08:49
Originally reported on Google Code with ID 22
I have searched over hours for this , i just found one solution here :
https://groups.google.com/group/closure-stylesheets-discuss/tree/browse_frm/thread/0f44c33220fe54d8/09a1f2cd660aa8f1?rnum=1&_done=%2Fgroup%2Fclosure-stylesheets-discuss%2Fbrowse_frm%2Fthread%2Ff44c33220fe54d8%2F09a1f2cd660aa8f1%3Ftvc%3D1%26
I think , if Google can release a plugin for eclipse with highlight effect and suggestion
then developer can grow up with this faster
Reported by hau12a1
on 2012-06-27 04:45:18
Originally reported on Google Code with ID 20
Discovered when trying to compress output from Twitter Bootstrap (likely affects lots
of other users too).
Michael Bolin addressed this issue in this thread but I don't see a fix ever being
checked in:
http://stackoverflow.com/questions/8453719/closure-stylesheets-parse-error-with-twitters-bootstrap-css
Input:
.test{ font-size:20px;outline:thin dotted \9; }
Output
GssParserException: Parse error in test at line 1 column 44
Reported by ori.schwartz
on 2012-05-30 17:58:08
A linter for closure stylesheets could detect a lot of simple style issues like unsorted @requires
, whitespace conventions, etc.
Probably there would be some obvious problems to point out globally and some Google style guidelines documented at https://github.com/google/styleguide that could be enabled via a flag.
Originally reported on Google Code with ID 35
Would be nice to be able to do something similar to this
@def IMAGES_DIR '/Content/Images/';
.icon.field.text {
background-image: url(IMAGES_DIR + 98-CoffeeCup.png);
}
Reported by ali.taft90
on 2013-05-24 13:52:54
Originally reported on Google Code with ID 2
What steps will reproduce the problem?
1. Create a input.css file:
---------------
#first, #second, #third {
width: 100px;
height: 100px;
color: #ff0000;
background-color: #00ff00;
}
#second {
width: 105px;
}
---------------
2. Run: java -jar closure-stylesheets.jar --output-file output.css input.css
What is the expected output? What do you see instead?
Expected (and YUI Compressor achieves this), 100 bytes:
---------------
#first,#second,#third{width:100px;height:100px;color:#f00;background-color:#0f0}#second{width:105px}
---------------
With Closure I get a 204 byte file instead (original was 138!):
---------------
#first{width:100px;height:100px;color:#f00;background-color:#0f0}#second{height:100px;color:#f00;background-color:#0f0}#third{width:100px;height:100px;color:#f00;background-color:#0f0}#second{width:105px}
---------------
What version of the product are you using? On what operating system?
I'm using the initial release, SHA1 5d8092ec7287f8b05b41ff71f52ff2dc0576f414
Windows 7 64bit SP1
Please provide any additional information below.
This sucks big time.
Reported by xxStrom
on 2011-11-15 02:44:40
Originally reported on Google Code with ID 9
Hi,
Some color functions are missing in closure stylesheets. If I take less in example,
here are some interesting functions http://lesscss.org/#-color-functions
Based on the last commit (http://code.google.com/p/closure-stylesheets/source/detail?r=6edc1c4364256f20dca2b59eddc18e38f1a41935)
I've implemented some of them :
* lighten(color, amount)
* darken(color, amount)
* saturate(color, amount)
* desaturate(color, amount)
* grayscale(color)
I join a patch which add functions. It's just a "quick and dirty" patch (based on the
code of addHsbToCssColor), but it seems to work.
In the hope you find it interesting.
++
Yves
Reported by Yves.Brissaud
on 2011-12-02 12:25:33
Originally reported on Google Code with ID 18
this is a feature
for example
@defmixin border-radius(RADIUS) {
@mixin border-radius-corners(RADIUS, RADIUS, RADIUS, RADIUS)
}
@defmixin border-radius-corners(LT, RT, LB, RB) {
-webkit-border-radius: LT RT LB RB;
-moz-border-radius: LT RT LB RB;
border-radius: LT RT LB RB;
}
Reported by randomailer
on 2012-05-04 07:18:31
Originally reported on Google Code with ID 7
Would be great to have an ability to preprocess css files that way that data-uri would
appear in css instead of images. As not all browsers support data-uri (IE 7 and earlier,
IE8 only 32Kb), this can be an optional parameter like "--replace_image_with_data_uri".
Also by default root path for image path in css can be considered path to processed
stylesheet. But that could be changed explicitly by providing --root argument. --root
argument can have local folder path or web url images will be fetched from.
Reported by judo.ras
on 2011-11-30 07:18:03
Originally reported on Google Code with ID 21
Description
-----------
http://www.dojotoolkit.org already uses the Closure-Compiler as a JS minification tool
and explores moving to Closure-Stylesheets for CSS compression. However, the tool seems
not to be usable for this at the moment: Compressing dijit.css, a CSS file shipped
with Dojo (see file attached) triggers numerous errors, and specifing "--allow-unrecognized-functions
--allow-unrecognized-properties" does not turn off linting. The parser still fails
due to IE specific hacks like "#zoom" (know as star hack, see http://en.wikipedia.org/wiki/CSS_filter#Star_hack)
or IE specific stuff like "top: expression(eval((document.documentElement||document.body).scrollTop));".
What steps will reproduce the problem?
--------------------------------------
Try to compress the attached CSS file with "java -jar closure-stylesheets.jar --allow-unrecognized-functions
--allow-unrecognized-properties dijit.css". This fails with several errors. Replacing
"#zoom" with "*zoom" gets rid off the error. But there a still problems with stuff
like "expression(....)". Specifying "--allowed-non-standard-function expression" seems
to have no effect. The parser still fails.
What is the expected output? What do you see instead?
-----------------------------------------------------
For simple CSS compression, there should be an option to turn off linting completely?
When using CSS variables and mixings, the parser should not fails either if the CSS
contains cases as mentioned above.
What version of the product are you using? On what operating system?
--------------------------------------------------------------------
closure-stylesheets-20111230.jar on Win7Home
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)
Please provide any additional information below
------------------------------------------------
Would be cool if Closure-Stylesheets could work with the attached CSS file. Compressing
dijit.css with the YUI-Compressor works like a charm. It would be great if Closure-Stylesheets
could achieve the same compression ratio like the YUI-Compressor. Then it would be
a great alternative and worth a thought adding it to the Dojo release like Closure-Compiler
and thereby replacing LESS and providing higher CSS compression rates (However this
needs further discussions with the Dojo core team, and I am not a member of the core
team).
Reported by oliver.siemoneit
on 2012-06-24 12:27:44
Originally reported on Google Code with ID 39
Added new properties.
Reported by mark.kaczkowski
on 2013-09-04 12:28:05
Originally reported on Google Code with ID 29
a {
-webkit-filter: drop-shadow(0 1px 1px #000);
}
Compiler parsing error: Parse error in .....gss at line 1819 column 47:
-webkit-filter: drop-shadow(0 1px 1px #000);
Compiler flags:
--allow-unrecognized-properties
--allow-unrecognized-functions
Reported by red.scorpix
on 2012-10-12 13:59:20
Originally reported on Google Code with ID 13
What steps will reproduce the problem?
1. Try to compile a file with windows UFT8 + BOM encoding and crash
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
20111230
Please provide any additional information below.
Try to compiled attached (UTF8 + BOM) and you will see it reproduced.
Reported by guido.tapia
on 2012-03-09 19:32:38
Originally reported on Google Code with ID 37
What steps will reproduce the problem?
1. Create a test.css file:
em:not(.a):not(.b) {
color: red;
}
2. Create a pretty-printed file with:
$ java -jarclosure-stylesheets.jar --pretty-print --output-file ./test.p.css test.css
3. Check its contents:
$ cat test.p.css
em:not(.a) :not(.b) {
color: red;
}
This is wrong, because the space added between both :not pseudo-classes changes the
meaning of this selector. The desired 'em' element will not be selected.
What is the expected output? What do you see instead?
The correct output is produced without the pretty-print flag:
$ java -jar tools/closure-stylesheets.jar --output-file ./test.c.css test.css
$ cat test.c.css
em:not(.a):not(.b){color:red}
What version of the product are you using? On what operating system?
Revision: 86bb800d79a3
Chrome 27.0.1453.116
Please provide any additional information below.
The following change seems to fix this issue (unsure if this is the right fix though).
$ git diff
diff --git a/src/com/google/common/css/compiler/passes/PrettyPrinter.java b/src/com/google/common/css/compiler/passes/PrettyPrinter.java
index 8a37b7c..9da9ab7 100644
--- a/src/com/google/common/css/compiler/passes/PrettyPrinter.java
+++ b/src/com/google/common/css/compiler/passes/PrettyPrinter.java
@@ -347,7 +347,7 @@ public class PrettyPrinter extends DefaultTreeVisitor
public void leavePseudoClass(CssPseudoClassNode node) {
if (node.getFunctionType() == FunctionType.NOT) {
deleteEndingIfEndingIs(", ");
- sb.append(") ");
+ sb.append(")");
}
}
Reported by alo.and
on 2013-07-04 21:51:44
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.