This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
According to SCSS documentation underscroring base file prevents from coping it's code to child using @import: "Partials If you have a SCSS or Sass file that you want to import but don’t want to compile to a CSS file, you can add an underscore to the beginning of the filename. This will tell Sass not to compile it to a normal CSS file. You can then import these files without using the underscore." Does this work in workwench? P.S. Sorry if i'm wrong cause i'm new to SCSS... |
|
|
I think you may have misunderstood what the underscore does -- as I understand it, it does NOT prevent the file from copying its code to the file that @imports it -- on the contrary, it indicates that the file will ONLY be compiled by being @imported into another file; that is, it tells Sass not to compile the file separately. This is for the scenario where Sass is compiling or watching a directory of files. We don't currently disable compilation for files that begin with an underscore, but you can disable it manually by selecting the file in Solution Explorer, going to the Properties window and deleting the content of the Custom Tool property. We do currently have an issue where we don't look for underscored @import files when checking whether variables and mixins are defined, so you would get 'unknown variable' squigglies if the variable was defined in a partial and you @import-ed that partial without using the underscore. We'll try to get this fixed in a future build. |
|
|
Thank you! Yes lately i read docs one more time and realised that i was totally wrong in the previous post)) It will be cool if you'll fix it in nearest reliease, but anyway deleting custom tool property is ok too cause you don't need to do it every day. Also (returning to the first point) is it possible not to copy css from parent file while import? |
|
|
I don't believe so. If you specify an @import directive, then the file will be imported. If you don't want the file to be imported, don't specify the @import directive *grin*. But maybe I haven't understood what you're trying to achieve here... |
|
|
I'm sorry to be not clear for you. Well i meant this: I have #first in first.scss and #second in second.scss. I want to extend #second with #first and use @import "first" in second.scss. In second.css i will see also #first and #second but i need only @second. For the first look it seems to be some extra sugar but now i'm finishing converting quite big project from less to scss and it seems big goal for me. So i will be very happy to see it in future) P.S. Anyway many thanks for your great work cause it's realy best tool for .net to use css preprocessor. I even turned to scss from less just because your tool is much better then chirpy.
|
|
|
Aha! I see what you mean now -- sorry for being slow! I think this is probably a SASS behaviour rather than a Web Workbench behaviour. For generating the CSS we just call the SASS compiler so the CSS generation is out of our control rather. However we'll try to investigate this and see if we are doing anything wrong -- otherwise you may need to put this request to the SASS folks. Thanks for the feedback! |
|
|
So just wanted to double-check. I've just bought the Pro version and started with a .scss file and trying to @import 'pages/basket'. I have a subfolder called pages and a .scss file called _basket.scss and I've cleared the Custom Tool property. I'm still getting the the swiggles on the import saying file not found. Are you saying I can safely ignore that and that you are working on fixing this? Cheers, M |
|
|
Yes. The Sass compiler will automatically try the underscore prefix. The highlighter/squiggliser doesn't... yet. This is a bug in the highlighter/squiggliser and we'll get it fixed for you, hopefully in the next update. |
|