Re: Extension Creation Question

31 views
Skip to first unread message

Chris Eppstein

unread,
May 21, 2013, 11:48:21 AM5/21/13
to compas...@googlegroups.com
No, sorry, we do not yet have any way of specifying dependencies. However if you require the gems at create time, the require statements will be in your config file already:

gem install susy
gem install sassy-buttons
compass create -r susy -r sassy-buttons -l path/to/my_extension --using my_extension

Chris


On Monday, May 20, 2013 10:55:00 PM UTC-7, Ryan Olson wrote:
Hi all, 

I am working on an extension, (my first) for including several files I use on most projects. Is there a way to include some existing, gem installed extensions, as required in my extension so they are loaded each time? Note that for now this is just for my use so I know the dependencies are there, 

For example, I have an extension working, which is basically just a set of several UI files and mixins I use a lot. However, I would also like to include Susy and Sassy Buttons each time. Is there a way to add them? 

Secondly, and perhaps related, is there a way to have a config.rb file that overwrites the one generated by compass create? I notice in some extensions inside of the templates/project directory there is a config file, but not sure how that works.  I ask because I wonder if I could have one in my extension and add require them in there, as well as change the default directory for css and js.

Thank you for any input.

Ryan Olson

unread,
May 21, 2013, 12:20:37 PM5/21/13
to compas...@googlegroups.com
Oh no apologies :)

That works perfect, I was not aware you could -r require multiple items, sweet!

What about the config file override? Does that make sense? Example, 

This config.rb file from an existing extension I forked made me think that adding one to an extension would allow it to override the default directory paths maybe?

Chris Eppstein

unread,
May 22, 2013, 3:36:04 PM5/22/13
to compas...@googlegroups.com
Generally, the configuration is something that each project should own. So I highly discourage this practice. But if it must be done, that is how it would be set up.

Chris

Ryan Olson

unread,
May 24, 2013, 10:28:28 PM5/24/13
to compas...@googlegroups.com
Thanks for all your help Chris, this is my real dig into Compass and it is super awesome, hence all my bugging you ;) I just keep getting lost in the docs lol.

I am trying to integrate Compass into a custom CMS my company uses and I have developed a template system for it that allows rapid layout creation using many shared assets, with just some override tweaks for each layout, so I am trying to adapt it to work with Compass and my custom framework/extension. 

So I have built a framework using your video tutorial as a guide and it works great. 

I have a main 'site' directory where all the base assets live, and inside the css directory is where I am keeping my framework. Here is a screenshot of the tree, 


Now inside of the layouts directory is where each individual template lives, and inside here is where I would create each new compass project. Each of these has a css folder with the style.scss that imports the framework extension and the variables/site overrides etc as you can see in the screenshot. 

My question is first, is this possible to duplicate with an extension, and if so what is the best way to do it? Basically in my ideal scenario, upon creating a new layout the js,img,and css directories would be created as well as a 'layout.php' file. Inside the css folder would be the main style.scss and the _vars.scss that would be used each time. Is there a way to do this somehow laying them out in the manifest file? Would this require a custom config.rb file? 

I hope this make sense, and please let me know if you can advise or if I can be more clear. Thank you for all your time!
Reply all
Reply to author
Forward
0 new messages