I’m looking for a way to do something like this:
// style.css
@def borderSize '2px';
.style {
width: borderSize + 2;
height: borderSize + 2;
}
where the width and height attributes would end up having values of 4px.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Sometimes I use the following:
Oddly, this only works, if you don’t put any spaces between the
+operator and the operands. Also, in @eval you can’t use constants that were previously defined by @def. You can however use constants that are defined as static fields in one of your Java classes:Or you could let the calculation be performed completely by Java:
But what I would actually like to do is very similar to your suggestion:
I don’t think that’s possible in GWT 2.0. Maybe you find a better solution – here’s the Dev Guide page on this topic.