Saturday, 15 January 2011

php - SASS generating URLs for multiple static -


The idea is that I use a few pixels to create a domain for images. Assuming that I have two domains that have the same image, I want to load half the images from one domain and load it from the other half.

Something like this in PHP

  $ domain = array ('domain1', 'domain2', 'domain3'); $ DomainIdx = 0; Function getDomain () {$ rVal = $ domain [$ domainIdx]; $ DomainIdx = $ domainIdx ++ & gt; = Counting ($ domain)? 0: $ Domain ID ++; Return $ rVal; }   

Every time I provide an image to get a domain for it, how can I do something like this in a mix in SASS when CSS is generated? Will distribute all URLs between domains list?

 class = "text"   

 config.rb ), you can use the function, such as:  
  asset_host_list = ['domain.com', 'Domain.org'] property_host | Property | "Http: //% s"% asset_host_list [asset.hash% asset_host_list.length] end   

However, I agree with @immon, this approach is weak.

No comments:

Post a Comment