keegnotrub / coda-sass-plugin

A plug-in for Panic's Coda 2 that converts scss files into css files.
https://github.com/keegnotrub/coda-sass-plugin
82 stars 10 forks source link

Output Path #22

Closed jschreck closed 6 years ago

jschreck commented 9 years ago

Is there a way to configure the output path?

rfmarcelino commented 9 years ago

Yes, this would be very useful. The CSS is being generated to the same sass folder while compass compile / watch saves it to ../css

keegnotrub commented 9 years ago

@rfmarcelino - There is some "intelligence" as to where it finds the accompanying css file for the scss file you are saving. Could you try this:

  1. Move (don't copy) the css file that is being generated to ../css
  2. Open the scss file make a change and save
  3. Check to see if the css file located in ../css was updated
keegnotrub commented 9 years ago

@jschreck as mentioned above, there is some places that the plugin will automatically match where to place the accompanying css file.

Presently, if you are saving a file named style.scss the plugin will:

  1. Look to see if style.css exists in the same directory as style.scss. If so, it will use that.
  2. Look up one directory to see if we have a directory named either css, styles, stylesheets, or style. If so, it will generate style.css in that directory.

Would you be able to let me know if the above doesn't fit your use case and if so what your specific use case looks like? Thanks!

jschreck commented 9 years ago

@keegnotrub - I tested this and it does indeed work. Might be useful to add to the readme here.

Naturally, having a preferred output path config would still be more awesome, but I'll take it. : +1:

Thanks for responding.

rfmarcelino commented 9 years ago

Thanks @keegnotrub, that worked ! Could be useful to have this info somewhere besides here. In my case this was a make/break feature. Thanks a lot for your great work.

createchlondon commented 8 years ago

One thing that doesn't seem to be working for me is there is a stylesheet located at "../stylesheets/{name}.css" but it isn't locating this automatically. Could we add a rule to automatically check the parent directories?

keegnotrub commented 8 years ago

Hmm.. That should work - just to double check, could you make sure there isn't already a matching {name}.css file in your sass directory? If there is, delete that first before saving as it may be finding that before it finds your "../stylesheets" directory.

createchlondon commented 8 years ago

Sorry I'm using the foundation framework, the stylesheet is actually located at "../../stylesheets/{name}.css" so it's 2 directories up.

keegnotrub commented 8 years ago

Hmm, that should work as well provided that none of the parent directories contain a matching {name}.css file. Could you check all the intermediate directories and if any contain a {name}.css file delete it and re-save?

My comment above wasn't absolutely complete in terms of the algorithm, more explicitly it looks like this:

  1. Look to see if {name}.css exists in the same directory as {name}.scss. If so, it will use that.
  2. Look up one directory to see if we have a directory named either css, styles, stylesheets, or style. If so, it will generate style.css in that directory.
  3. Repeat step 2 until we run out of parent directories
  4. If nothing was found in step 3, then just save in the same directory as {name}.scss
createchlondon commented 8 years ago

Please see this screenshot of the directory structure from Foundation - http://s9.postimg.org/bosb41gfz/Screen_Shot_2015_12_11_at_2_32_16_p_m.png.

I saved the scss and it writes it to the same folder 'config'. I tried deleting foundation.css from the stylesheets folder and resaving the scss but it does the same thing and writes foundation.css to the config directory. Not sure if I'm doing something wrong or it just isn't noticing where the file should be written to.

By the way, thanks for your quick replies! Apart from that this module works perfectly.

keegnotrub commented 8 years ago

Thanks for snapshot. I don't see anything immediately so I might have to setup a test like this to see why you are getting this behavior. I may not have time immediately to do so but I'll try to look into it soon.

createchlondon commented 8 years ago

No problem I don't mind copy/pasting the document each time for now. For test purposes, I am working on the Foundation WordPress framework.

keegnotrub commented 8 years ago

Thanks for this again, it looks like I found the issue. I'll publish an update, in the meantime - I believe this should work for you if you rename your "stylesheets" directory to "css", then make sure to delete any "foundation.css" files and try again.

createchlondon commented 8 years ago

Okay great thank you, please let me know when there is a fix available and how I can upgrade. Many thanks.

On 11 Dec 2015, at 14:58, Ryan Krug notifications@github.com wrote:

Thanks for this again, it looks like I found the issue. I'll publish an update, in the meantime - I believe this should work for you if you rename your "stylesheets" directory to "css", then make sure to delete any "foundation.css" files and try again.

— Reply to this email directly or view it on GitHub.

keegnotrub commented 8 years ago

Fix should be included in this release:

https://github.com/keegnotrub/coda-sass-plugin/releases/tag/v3.1.2

createchlondon commented 8 years ago

Great thank you!

On 14 Dec 2015, at 1:28 pm, Ryan Krug notifications@github.com wrote:

Fix should be included in this release:

https://github.com/keegnotrub/coda-sass-plugin/releases/tag/v3.1.2 https://github.com/keegnotrub/coda-sass-plugin/releases/tag/v3.1.2 — Reply to this email directly or view it on GitHub https://github.com/keegnotrub/coda-sass-plugin/issues/22#issuecomment-164436325.

heathflohre commented 8 years ago

Sorry to open this back up, but I just started using this plugin and it only recognizes a folder named 'css' one directory up. If it's names styles, stylesheets, etc. or if it's more than one directory up, it defaults to compiling in the same directory. Using Coda 2.5.16 and the most recent plugin.

keegnotrub commented 8 years ago

Thanks @heathflohre - Can you double check that you are running the most recent plugin from the release page on Github:

https://github.com/keegnotrub/coda-sass-plugin/releases/tag/v3.1.2

I believe Panic is still using v3.1.1 which didn't include this fix. I've been meaning to submit the fix to Panic as well, but haven't yet.

heathflohre commented 8 years ago

It was version 3.1.1, but it's still occuring with 3.1.2.

heathflohre commented 8 years ago

After testing, it is now recognizing directories with the other names. I was hoping it would look inside folders one level up. So, if 'scss' and 'build' folders are at the same level, it would save the compiled file in 'build/css'.

reddenial commented 8 years ago

Hello, I'm working with Coda 2.5.16 and I installed the plugin version 3.1.2

I created a folder named "site/customer/scss" with a file inside name "screen.scss" The plugin works good at this point because it creates a folder "site/customer/css" and "screen.css".

But after I created a folder "admin" inside the "scss" one with the file "admin.scss" ( path is : "site/customer/scss/admin/admin.scss") , the output "admin.css" goes to the parent :

"site/customer/css/admin.css" instead of "site/customer/css/admin/admin.css"

It is possible to change this?

Here's the screenshot : capture d ecran 2016-06-08 a 12 10 57

(others files are not created with SASS)