我的任务是构建Web应用程序的前端,我要做的是在Button上应用CSS3渐变.我正在使用带有GWT插件的Eclipse,我正在使用GWT插件在Google Chrome中查看UI.
我的问题是GWT似乎删除括号之间的空格,以便:
.gwt-Button {
background: -moz-linear-gradient(top, white, #72C6E4 4%, #0C5FA5);
background:-webkit-gradient(linear, left top, left bottom, from(white), to(#0C5FA5), color-stop(0.03, #72C6E4));
Run Code Online (Sandbox Code Playgroud)
变为:
.gwt-Button {
background: -moz-linear-gradient(top,white,#72C6E44%,#0C5FA5);
background:-webkit-gradient(linear,lefttop,lefbottom, from(white), to(#0C5FA5), color-stop(0.03, #72C6E4));
Run Code Online (Sandbox Code Playgroud)
这使他们无效.还有另一种方法可以解决这个问题,或者可能是一种在编译应用程序时防止删除空格的方法吗?谢谢.
您必须使用literal()函数.我相信它可能只适用于通过aCssResource使用的样式作为GWT函数.
background: -webkit-gradient(linear, literal("left top"),
literal("left bottom"), from(white), to(#0C5FA5) );
Run Code Online (Sandbox Code Playgroud)
我窃听这在不久前这里,但还没有得到来自GWT队任何回应,所以请明星,如果你认为它是一个有效的bug.
另外,作为旁注,这些样式不适用于旧版本,即需要添加过滤器属性.这是一个例子.