Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8784969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:14:13+00:00 2026-06-13T21:14:13+00:00

I have a project with less files which reference images via URLs. The project

  • 0

I have a project with less files which reference images via URLs. The project is delivered to the user as a single page application, with all JS minfiied and sent as one file. However, images are sent in separate files. To eliminate this latency, I want to deliver the images in one file. How can I (in a non-manual manner) sprite the images, and alter the less to refere to the sprited images?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T21:14:14+00:00Added an answer on June 13, 2026 at 9:14 pm

    You can separate your sprite CSS selectors into their own file that’s generated at the same time as your sprite sheet. I use SpriteRight but there any many ways to skin that cat. Here’s a command line tool called Glue if you prefer that. Once you have your sprite Less/CSS file you then import it back into your main Less file, and it should work.

    So your setup might look like this:

    • /less
      • main.less
      • sprite.less
    • /css
      • main.css (compiled & concatenated Less files)
    • /img
      • /_for-sprites
        • … (the images that comprise your sprite sheet)
      • sprite.png

    main.less:

    ... (snip) ...
    @import 'sprite.less';
    ... (snip) ...
    

    sprite.less (generated by a utility as linked above):

    ... (snip) ...
    .icon1 { background-position: 0 0; }
    .icon2 { background-position: 20px 20px }
    ... (snip) ...
    

    I hope my explanation makes sense. I do something very similar to this every day and it works great.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have in one of our applications a single eclipse project that contains all
I am new user of Sonar. I have a small project in java which
In my Play 2.0 project I already have Bootstrap integrated (as the less files,
I have a verry simple style.less file in my project, and i'm using bootstrap
I have project asp.net with namespace test and I'm using resources (files Resource.resx and
I have a .nuspec file for my project, which references a third-party DLL that
I have a git repository (covering more or less project history) and separate sources
I have several files with code testing code (which uses a unittest class). Later
I have a project which has lots of modules, each one has different running
I have 2 projects : The first project is a structure project which i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.