Comments (5)
If you use css as the output format css-sprite will generate the classes for you. When using a pre-pocessor like scss it just generates the needed mixins.
from css-sprite.
Or you could also create your own template for generating scss. Have a look at the templates that come with css-sprite in lib/templates.
from css-sprite.
Yup, I am aware of that.
The thing is that I am not sure why that should be the case. Generally I
want to have sprite classes generated for every single sprite that is
inside the output image.
It is quite a simple addition to the basic template too, like I have done
here:
https://github.com/bguiz/node-angularity/blob/feature/sprites/tasks/sprites.scss.mustache#L51-L53
I know I can always create a custom template, just think that this should
be the default behaviour.
On 5 February 2015 at 20:23, Alexander Slansky [email protected]
wrote:
Or you could also create your own template for generating scss. Have a
look at the templates that come with css-sprite in lib/templates.—
Reply to this email directly or view it on GitHub
#44 (comment).
from css-sprite.
Yeah ok. We have different opinions about that. I want to keep the generated styles as small as possible, but I can see why this would be helpful. I'll reopen the issue a a reminder for me. Right now I am just filled up with work stuff.
from css-sprite.
I just had to do something simmilar in a project I'm working on. I would suggest creating your own template and using something like this at the end of your template
{{#items}}
.icon-{{name}}
@extend .icon
sprite(${{name}})
{{/items}}
I agree with @aslansky that the generated styles should be as small as possible. I feel it should be left to individuals to create their own concrete-classes via the template mechanism.
EDIT: Sorry, I should have read the comments more closely - it appears you've already arrived at this solution.
from css-sprite.
Related Issues (20)
- Switch back to canvas HOT 1
- Remove grunt task to separate repository HOT 1
- Move image processing engine to seperate repository HOT 1
- Sprite for :hover states? HOT 9
- cssPath struggles with special characters HOT 1
- Responsive sprites (relative positions using percentages) HOT 3
- Output SASS and sprite to different directories config issues HOT 3
- Aliasing HOT 1
- Under the Windows 7 installation is not successful HOT 6
- Cannot install on node 4.1.0 HOT 4
- template don't accept absolute paths
- (request) Right click to lock all other layers
- 1
- npm is named `sprity` but code in this README.md stills use `css-sprite`
- hope can custom one's css class prefix style, rather than only use '-' to join it
- the output img is too long... HOT 1
- If there were any node version restrictions HOT 1
- error installing sprity-cli
- I cannot install css-sprite
- can you generator the json description?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from css-sprite.