It would be great to be able to concatenate string variables

137 views
Skip to first unread message

mick...@gmail.com

unread,
Aug 28, 2012, 12:23:42 AM8/28/12
to closure-style...@googlegroups.com
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, 4:40:13 AM8/28/12
to closure-style...@googlegroups.com
You can always make a custom function that does it.

Ian

dwire...@gmail.com

unread,
Jan 4, 2013, 6:06:37 PM1/4/13
to closure-style...@googlegroups.com, mick...@gmail.com
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!

dwire...@gmail.com

unread,
Jan 4, 2013, 6:14:30 PM1/4/13
to closure-style...@googlegroups.com, mick...@gmail.com, dwire...@gmail.com
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