Open HughxDev opened 8 years ago
The path must be incorrect. Currently it only supports absolute paths.
I triple-checked and it's the correct path, as well as being absolute. I actually copied the exact location from the file properties dialog box, pasted it into the .sublime-project, and then changed all slashes from Windows-style (C:\...
) to UNIX-style (/C/...
), which seems to be the format that Sublime Text expects. Not only that, but I also tried several variations, including keeping them as backslashes and escaping them. I even tried renaming a folder that had spaces in it in case that was causing any problems, but it didn't make a difference. It has to be something else.
It's working fine using absolute path, on windows 7 64bit.
Try this on your .sublime-project file
{
"color_variables_files": "/path/to/_colors.scss",
"folders": [{
"path": "/path/to/project"
}]
}
Hope it works!
If you're on Windows, the pathing will be a little different from what I understand. In a project I'm working on, it looks a little like this:
"color_variables_files": [ "D:\\code\\website-project.local\\client\\scss\\variables\\_colors.scss" ],
Does that help?
+1 same issue.
Tried the filepath a string and an array.
Tried using color_variables_file instead of color_variables_files.
Tried Windows style and unix style file paths (using Windows 10).
I got this to work on a mac by using the absolute path thus:
{
"folders":
[
{
"path": "."
}
],
"color_variables_files": "/Users/myusername/path/to/_colors.scss",
}
Unable to get this working, ST3 macOS sierra. Can we have a log in the ST console telling us what's the deal ? File not found, syntax error ...
I can confirm that color_variables_files
does not work even when using absolute paths.
{
"folders": [{
"path": "."
}],
"color_variables_files": "/Users/username/project/assets/_sass/settings/_colors.scss"
}
macOS Sierra 10.12.14 Sublime Text 3 build 3126
I figured out what’s going on.
For color_variables_files
to work in the .sublime-project
file, you need to save your directory as a “Sublime project” (From the menu, Project > Save Project As) (it creates a *.sublime-workspace
file) and always open projects as a “Sublime project.”
However, I think the whole “Sublime project” thing is useless. So my forked version https://github.com/jonsuh/ColorHighlighter uses a .colorhighlighter
file that’s structured like this:
{
"color_variables_files": [
"/absolute/path/to/project/assets/_sass/settings/_colors.scss"
]
}
It doesn’t require you to save and open a folder as a “Sublime project” and color highlighting for Sass variables work again (!!!) even if your variables are in a separate file and you’re not @import
ing color variables in every Sass file (I use one manifest file so it’s redundant to @import
in every file).
Amazing job @jonsuh !
Finally got it working using your fork. I think you solution deserves a PR in this repo instead. 🙌 Kudos to you !
@Romainpetit Great to hear that it’s working for you! Thanks for letting me know.
I opened up a PR for the added feature https://github.com/Monnoroch/ColorHighlighter/pull/355. This is only the 2nd time that I’ve ever written anything in Python, so it may need improvement from more experienced devs, but hopefully we can get the feature added.
At first I was putting "color_variables_files"
inside of "folders"
key for some reason...
The default .sublime-project
(in the project root, didn't check other locations of .sublime-project
) worked for me:
{
"color_variables_files": [
"/Users/myuser/project/styles/_variablesFilename.scss"
],
"folders": [{
Using:
.sublime-project:
_colors.scss:
app.scss: