V
V
vohaha2016-04-04 15:43:12
JavaScript
vohaha, 2016-04-04 15:43:12

How to get string from scss file in gulp?

Is there a plugin in gulp or npm package that can help to take a string from scss and already perform actions in gulp with this string?
For example.
scss:
@include sprite-folder('someFolderName');
js:

var spriteSrc = sprite-folder.getValue();
gulp.src(spriteSrc)
.pipe(...)

Or tell me the best way to implement it.
Something like how sprites work in compass'e.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Evanre, 2016-04-14
@Evanre

Gulp has its own packages that collect sprites. Actually, you write all the paths in gulpfile.js itself. Here you can see an example of my gulpfile.js . Everything is detailed there. There will be questions - ask in the comments under the answer.

F
fetis26, 2016-04-19
@fetis26

You can slip a custom function into Sass via functinos
https://www.npmjs.com/package/node-sass
I understand that it will be called for each occurrence
or try to make transformations via
https://www.npmjs.com/package/ gulp-transform
before uploading to Sass
If we are really talking about sprites, then it is better to take a ready-made solution.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question