It would be great to be able to concatenate string variables

137 views
Skip to first unread message
unread,
Aug 28, 2012, 7:23:42 AM8/28/12
Awesome tool guys! We just ported over to using this, and it rocks.

One little suggestion...

Because we use plovr -- which runs on a different port to our local development server (where our static images are served from), we have to do an ugly hack for all sprites to get the URL right:

@if (IS_DEV) {
  @def DESIGNER_SPRITE_LOCATION url(http://localhost:8080/img/designer/sprite3.png);

  ... etc
} @else {
  @def DESIGNER_SPRITE_LOCATION url(/img/designer/sprite3.png);

  ... etc
}

Because we have MANY different sprites, it makes our defs very unwieldy.

It would be great to be able to do something like this:


@if (IS_DEV) {
  @def SERVER "http://localhost:8080";
} @else {
  @def SERVER "";
}

@def DESIGNER_SPRITE_LOCATION url({{ SERVER }}/img/designer/sprite3.png);

OR 

@def DESIGNER_SPRITE_LOCATION SERVER + "/img/designer/sprite3.png";

Thanks. :)

Mike
 

Ian Flanigan

unread,
Aug 28, 2012, 11:40:13 AM8/28/12
You can always make a custom function that does it.

Ian
unread,
Jan 5, 2013, 1:06:37 AM1/5/13
How did you define IS_DEV? Were you able to figure out a way to define it in the plovr config file, or do you just have to change it manually in the css when you build for production?

Thanks!
unread,
Jan 5, 2013, 1:14:30 AM1/5/13
Just found it.

"css-defines":[
"IS_DEV"
]


Thanks for showing how you handle images in different locations in dev and production.
Reply all
Reply to author
Forward
0 new messages