-
Notifications
You must be signed in to change notification settings - Fork 865
Isolating frontend dependencies. #396
Comments
Hello. I agree that it makes sense to organise static files in a separate folder for assets. I am also accustomed to this from a number of other projects. The folder for bower_components (and node_modules) should be kept outside and lie directly on the root. If you want to make a pull request, I am open to merge it into the master branch. It would be nice if you could update the README.md with the new folders structure while you're at it. Thanks! |
Sure! I will try and get this to you this week. And I'll provide a sub-heading for folder structure in the readme as well. |
Sorry about the delay on this, been busy with the current project using this theme as parent. Hopefully next week I can do the PR. |
No worries. @THEBRANDYMAN made the changes and created a pull request #454 :) |
@THEBRANDYMAN thanks for the PR! |
Problem
Most of FoundationPress front-end dependencies are scattered. This includes sass, css, javascript, and other assets. Although quite common in other themes, I think a more modern approach would be to isolate each into a parent folder. This makes it clear where all front-end dependencies live.
Solution
We recently implemented FoundationPress as parent for a child theme. Within our child theme, we adapted the following pattern:
This makes it clear where everything lives. Granted, we had to adjust Grunt, SASS, and functions file to correctly import all dependencies, but the result was good.
Discussion
This, of course, is an option that could be left to the child theme. But I think it would be beneficial if we considered this for parent. It mirrors other popular applications and how they manage their frontend. One of the questions raised is whether or not to include bower components in this folder. We chose not to as it follows the same paradigm like node modules and taking a step further, a vendor folder from composer.
If this is something your interested in, I can do a PR on the initial solution.
The text was updated successfully, but these errors were encountered: