-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SCSS generated doesn't generate "concrete" sprite classes #44
Comments
…-sprite - retina spriting out of the box - generates SCSS, however it is insufficient, see aslansky/css-sprite#44 - TODO limitation of generated SCSS can be worked around using a custom template - Base it upon: https://github.com/aslansky/css-sprite/blob/master/lib/templates/scss.mustache - TODO connect to main CSS gulp task - TODO investigate using browserify hooks to look for <i/> tags with classes to determine which files should be sprited
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. |
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. |
Yup, I am aware of that. The thing is that I am not sure why that should be the case. Generally I It is quite a simple addition to the basic template too, like I have done I know I can always create a custom template, just think that this should On 5 February 2015 at 20:23, Alexander Slansky [email protected]
|
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. |
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
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. |
I could be wrong about this, but the SCSS that is output does not appear to include the actual class names for each of the generates sprites.
Using the follwing options (as part of a gulp stream):
The following files do get generated correctly within 'build/sprite':
However, the contents of
_sprite.sccs
is as follows:It appears that the required mixins and functions are all in place, however the onlty "instantiated" or "concrete" CSS classes generated are:
.icon
, and@media ... .icon
The dimension variables that were defined right up the top,
$main-logo
and$js-logo
have not been used in any of the mixins or functions to generate actual classes.In the usage section for SCSS, we have the instrucrtions:
However, wouldn't it be easier to simply generate the classes automatically rather than require that they be done by hand?
The text was updated successfully, but these errors were encountered: