Loop over files in a directory - css

I'm trying to loop over files in a directory with scss.
Is there a way to provide a directory, like /icons/*.png and then loop over each one, getting the name of the file?

To anyone looking - this is not possible with Sass or compass itself. You would need to write an extension to interface with the files.

Related

How do I use classes from files in another directory in R?

I have a bunch of .R files in a directory (classes with inheritance). These files depend on each other.
I need to use these files' classes in a file in a different directory.
Is there a way to directly call their functions/classes from a file in a different location? Maybe by adding them to some kind of path? I was thinking of including each source file manually but they are numerous.

How to handle scss and css in git?

I'm very new to scss and css so please bear with me. I've done some research but found conflicting information.
I have 2 freelancers working on my project. Both freelancers make changes to:
style.css
style.css.map
style.scss
Everytime I merge their work I break the frontend. How can I merge their work without breaking everything?
I read online that these files should not be included in GIT? I also read that I should used GULP or LESS? Apparently, I should compile the merged code before committing? Seriously confused with the research.
How do I handle these files?
The .css file is generated from the .scss files.
Your developers should commit only in the .scss files.
In the most cases the .css file is not added to the repository at all. And you should not modify the .css file directly because it will be replaced with the next compilation of .scss the files.
GULP is just the tool that compiles the .scss files and create the css from them. Basically when using GULP you can create some functions where you can specify the input location(.scss), output location(.css) and additional rules, etc.
There are also other tools that can do this. Like Koala, Webpack.
You probably should not store generated files in git. In this case, the generated files would be the .css and .css.map files that compass (I'm assuming you use compass because of the tags) generates for you. You should store the .scss file in source control, and compile it to .css afterwards.
If the freelancers are making direct manual changes to the .css files, they should know that at each recompile those changes will be lost.

Easy way to convert SASS into CSS?

I am using a CSS framework, which has documentation for user-created extensions. But these extensions are all written in SASS files on GitHub.
Now this framework is only a single CSS file. But for the extensions they are requiring to use NPM, or clone the entire GitHub project, and start using SASS commands, which I'm unfamiliar with.
Is it possible that I keep the current configuration: I.e. only have the main framework CSS file, and somehow convert each extension SASS file to CSS file and add that to my /css folder? Or that's not possible?
**Edit: It's the Bulma CSS framework, and this is the link to the Extensions repository: Wikiki
If the number of files are not too much, you could convert them manually using an online sass compiler
SassMeiser is my goto choice for online Sass compilers.
Maybe if you could provide a link to the repo, we'll have more clarity on how we could deal with it.
Edit: I just went through the repo. They already have the .min.css file for each extension in dist dir. You're better off just downloading the .min.css file rather than converting it yourself. Remember, you need the .min.js files also for the extension to work.

Why does gruntjs file array format not allow referencing dest files in another task using templates?

I ran into an issue with a new build I am creating with gruntjs. I wanted to use grunt-contrib-copy to copy files into my deployment area and then reuse those destination files in a later task. It looks like I should be able to reference task destination files using a template as described in the Grunt: Configuring Tasks documentation. But when I use this with a file array format specified source task it does not work.
I have created a gist that shows the problem: Grunt File Array Example Gist
Reproduction:
git clone https://gist.github.com/5065053.git test_example
cd test_example
npm install
./node_modules/.bin/grunt
See how the output from debug_files tasks don't have files for dests of items specified with file array syntax.
It is likely that I am just doing something wrong, but I can't seem to track it down. Does anyone see my error?
I think the templates simply cannot fetch values from arrays. I had a similar problem and worked around it by creating a standard JS variable in my Gruntfile (after all it's a standard JS file).
Still you may want to try: <%= concat.prod.files.0.dest %>, which I'm not able to try at the moment.

How to list the files of a directory in Clean

I need to list all files of a directory using the Clean programming language, but I don't know any function to do so. Can someone help me?
You can use the function getDirectoryContents from the Directory module, which is bundled with the Clean distribution.

Resources