Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Isolating frontend dependencies. #396

Closed
justinpage opened this issue Jul 31, 2015 · 5 comments
Closed

Isolating frontend dependencies. #396

justinpage opened this issue Jul 31, 2015 · 5 comments

Comments

@justinpage
Copy link
Contributor

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:

assets
├── css
├── img
├── js
│   ├── custom
│   └── vendor
├── scss
│   ├── config
│   └── site
└── type
    └── fontawesome
        ├── fonts
        └── scss

12 directories

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.

@olefredrik
Copy link
Owner

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!

@justinpage
Copy link
Contributor Author

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.

@justinpage
Copy link
Contributor Author

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.

@olefredrik
Copy link
Owner

No worries. @THEBRANDYMAN made the changes and created a pull request #454 :)

@justinpage
Copy link
Contributor Author

@THEBRANDYMAN thanks for the PR!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants