在UiBinder模板(GWT 2.8.1)中使用GSS,解析并运行以下内容:
@media ( max-width: 767px) {
...
}
但是,当max-width
和:
之间出现空格时(在我的情况下由IDE的格式化程序插入),GSS解析失败:
@media ( max-width : 767px) {
...
}
生成的GWT编译错误如下所示:
binding: formfactor=desktop
binding: user.agent=safari
Compiling module com.example.ExampleDev
Computing all possible rebind results for 'com.example.client.views.desktop.DesktopShellView.DesktopShellViewUiBinder'
Rebinding com.example.client.views.desktop.DesktopShellView.DesktopShellViewUiBinder
Invoking generator com.google.gwt.uibinder.rebind.UiBinderGenerator
[ERROR] Unable to parse CSS
com.google.gwt.thirdparty.common.css.compiler.ast.GssParserException: Parse error in uiBinder_com.example.client.views.desktop_DesktopShellView_DesktopShellViewUiBinderImpl_GenCss_style7318912838006262484.gss at line 18 column 22:
@media ( max-width : 767px) {
^
at com.google.gwt.thirdparty.common.css.compiler.ast.GssParserCC.parse(GssParserCC.java:227)
at com.google.gwt.thirdparty.common.css.compiler.ast.GssParserCC.parse(GssParserCC.java:247)