-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Access a partial within a partial #87
Comments
I even tried using the following project (https://github.com/jasonsanjose/brackets-source-map-demo-files) to see if I get any of the above errors, and I do. It seems like the contents of individual partial files are not being included in the rest. So for example if I declare variables in _config.sass and try to use those variables for the mixins in _mixins.sass, they cannot be used and throw an unbound error. |
Can't reproduce. I can compile brackets-source-map-demo-files and a test I wrote (https://gist.github.com/nicolo-ribaudo/f16caa7ff30ec9835a00) both. |
I re-installed the extension. It worked. I feel like an idiot for not doing that sooner. |
I have the same problem, however... The thing is the variables work and main.scss file compiles despite the SASS linter telling me unbound variable whenever I use a variable in my partials. As ong as I don't try to include a partial in a partial it compiles fine. Any help would be really appreciated! My .brackets.json file looks like so:
|
Try, re-intsalling the extension. OR Try using this file structure (if your not using something similar),
And in your .brackets.json file replace
with
|
I tried re-installing previously... no dice. Unfortunately that file structure doesn't work for me and would go against one of the key best practices of SASS, breaking up different pieces into folders, I'd end up with 30 or so files all in that /scss folder. Thanks for the idea though! There has to be a way to make this work when partials are in their own folders. |
I know, I tried breaking them down into the folders i.e. base, layout, modules, states, and util. If I tried to import a partial from another partial it doesn't get imported, but it does if you try to import it from the main file. Its a weird problem, which I have no idea how to fix. |
Yeah, exactly, I agree!! I think you should re-open this issue then, as we have essentially the same experience. And I can confirm another dev I work with is also finding the same problem. |
@onetrev thanks for the report. Can you give me more details so I can try to figure this out?
Based on your first comment, I assume you have:
For reference, you might look at my example bourbon project https://github.com/jasonsanjose/bourbon-example/tree/1.0.4 (use this 1.0.4 tag since I've recently updated master to use a newer version). The example imports bourbon, here's the settings:
In the file
|
Excellent, glad you are on the case! I will try to help as best I can....
.... and so on..... But even though I import the variables first, the error as reported shows up in the linter when using a variable in say my /base/_core.scss file |
Ah, so while editing Sounds like something went wrong when the source map is compiled. Long story short, I use the source map to figure out what the main input file is. So, when linting Can you show me the contents of |
Correct, compiling works fine despite seeing error while editing. Makes sense why the two differing results. Here is my map file: https://gist.github.com/onetrev/ae1c1a9b3383bf0e8653 |
@onetrev try this dev build https://github.com/jasonsanjose/brackets-sass/releases/tag/2.0.1-105. Added fix to PR #100. Tagging v2. The problem was that we didn't identify the correct input file (in this case Tested on mac and win for both libsass and ruby. |
Awesome, that was fast! And it works perfectly from my initial testing. Variables in my partials are now recognized and everything continues to compile. Not sure why, as I didn't fully understand the includePaths in the first place, but I don't even need those anymore. Just wondering quickly, what is the upgrade path now that I have this version? I'm not sure how betas like this work in Brackets. I should still get notified when a new public release comes out right? Thanks again. |
Thanks for the feedback @onetrev. You will see an update notification in extension manager once I post the final build. Due to another bug though, you'll need to manually uninstall first, then install the update. |
Fix in #100. Closing. |
I updated the extension, and now, the files won't compile and generate the .css file. |
@andrerogers21 is your project the same as you described initially? #87 (comment) |
The file structure is now like this,
My .brackets.json file is as follows,
|
|
I changed the file to this
|
I think you want this:
Note that the paths (like
Are you seeing any compiler errors or anything from the console |
Its working. Thank you. |
My folder structure for sass is as follows,
I have a bunch of variables declared in my _config.sass file, but am not able to access them in any of the other partial files. I would like to know how this would be possible, or if this feature of the extension is yet to be implemented how would I do it.
My .brackets.json file looks something like this,
If i try to import a partial file into another, it prompts the following error,
" file to import not found or unreadable: 'includes/config' @import 'includes/config' "
and if I try to use a variable in any other partial file from _config.sass i get the following error,
" unbound variable $var_name ".
Help would be much appreciated. Thank you.
Cheers
The text was updated successfully, but these errors were encountered: