Hi and thank you for this great theme first of all. We love it and use it in each of our projects.
We now decided to develop a views accordion plugin based on ZURB Foundation accordion: Views Accordion Foundation
In that project we now ran into the issue (#3025307: Include foundation_sites module as depdencency for central libraries) that we have to require some Foundation libraries (core + accordion) but found no way to share them with the theme or other modules yet.
We don't want to make the zurb_foundation a hard requirement for the module because there may be many other themes which use ZURB foundation and that wouldn't be correct. jQuery on the other hand is provided by core and can simply be required in any module like Views Accordion does.
One possible solution would be to remove the libraries from the theme and put them into a module dependency like zurb_foundation_lib which contains a libraries.yml file which can then be required by themes, modules etc.
What do you think? Are there other best-practices?
Thank you :)
Comments
Comment #2
anybodyComment #3
anybodyI created a library project for that now: https://www.drupal.org/project/foundation_sites because we needed it in some projects.
@HongPong + @kevinquillen as creator of the zurb_foundation module was added as maintainer to be able to modify / contribute if he likes the idea :) Feedback here and there would be great!
Comment #4
hongpong commentedThis is very cool, although I think kevinquillen should be credited as the theme creator :)
I will try to run some experiments and get the hang of how this works. Seems very promising and a good idea for certain situations.
Comment #5
anybodyHi HongPong,
thank you for your positive first feedback! I'll add @kevinquillen.
Please give us some more days to fix some more bugs... I think the main work should be done next week. Perhaps @thomas.frobieter would like to give you some feedback on potential integration into the next zurb_foundation major release. We'll move foundation sites libraries out of our subtheme to be more flexible and provide more granular dependency loading via the module.
Comment #6
anybodyHi @HongPong,
any further plans here for the (far) future? We're using the library module for years now, currently doing some cleanup work.
Comment #7
erutan commentedI think this makes a lot of sense if you're developing on top of the existing pre-compiled zurb foundation css and js files.
I like to dial in what foundation modules are rendered as css vs just being used with a SCSS extend or import to cut down on the rendered CSS file size. Is that possible from a zurb_foundation subtheme referencing the library in foundation_sites? If not I guess the library module would be installed but not used and CSS would just be compiled using the gulp workflow in the subtheme and local /node_modules/ foundation?