Skip to content
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

Does not function #1

Closed
notasz opened this issue Aug 14, 2014 · 12 comments
Closed

Does not function #1

notasz opened this issue Aug 14, 2014 · 12 comments

Comments

@notasz
Copy link

notasz commented Aug 14, 2014

Using Brackets 42 on OS X 10.10, created a new local CSS file, added code to alter most of the sidebar, activated it the CSS, saved the CSS file, and nothing happens. Tried reloading brackets, quitting and reopening, but it doesn't seem to want to work.

@dnbard
Copy link
Owner

dnbard commented Aug 14, 2014

Hi @notasz. Does Brackets Developer Tools show any errors (F12) ?
Also some selectors require !important flag to be set. In example:

.selector{
  color: red !important;
}

@notasz
Copy link
Author

notasz commented Aug 14, 2014

Hello. Yes, there is an error in the console that says it fails to load the specified CSS file. It looks like it's calling for the correct file name, but the pathing is messed up for some reason.

Here's the error from the console:
Failed to load resource file:///Users/asz/Library/Application%20Support/Brackets/extensions/user/dnbard.custom-css/services//Users/asz/Library/Application%20Support/Brackets/extensions/user/dnbard.custom-css/cache/5a9528fd-aac7-46da-a859-5710fab19720.css

@dnbard
Copy link
Owner

dnbard commented Aug 14, 2014

Looks like this error is related to OS X. Unfortunately I have no expertise in this operating system. I'll be very glad if you help me fix this bug.
Path for this CSS file is calculated in config.js and services/initializer.js

@notasz
Copy link
Author

notasz commented Aug 14, 2014

I'd be happy to help. I'll poke around and see if I can find where the issue is occurring.

@notasz
Copy link
Author

notasz commented Aug 14, 2014

I looked around the initializer.js and config.js and checked all the path definitions in each and they all point to the correct places. Based on the error it seems like the problem seems to be including the path to initializer.js when making a get request for the CSS file, but i'm unsure where exactly in the code this is happening. This is the extended error for reference.

@dnbard
Copy link
Owner

dnbard commented Aug 14, 2014

@notasz looks like including CSS to Brackets IDE works differently on Windows and OS X. I'll try to solve this issue in future.

@notasz
Copy link
Author

notasz commented Aug 14, 2014

Thanks! I'll post again or make a pull request if I manage to fix it.

@notasz
Copy link
Author

notasz commented Aug 14, 2014

I was working on separate extension and noticed I was getting this same error when trying to use loadStyleSheet(); API. I looked into the documentation for it and it notes that loadStyleSheet(); loads a a style sheet relative to the module. So when it attempts to load the style sheet given entire path of a file, it begins with the root directory of the working file (in the case of initializer.js on OS X that is file:///Users/asz/Library/Application%20Support/Brackets/extensions/user/brackets-custom-css/services and then tries to reference the entire path for the CSS file from that directory.

Given that the loadStyleSheet(); API should only be able to reference files inside the module directory, i'm not entirely sure why this extension would work in Windows/Linux but not on OS X. This may be a bug with brackets between different OS versions and i'm not sure wether or not there is an easy workaround.

@dnbard
Copy link
Owner

dnbard commented Aug 15, 2014

I have a same feelings about that. I`ll make changes to the code (to use relative paths) and then ask you to test them on OS X.

@dnbard
Copy link
Owner

dnbard commented Aug 15, 2014

@notasz I've made a commit 71f5e74 with fixes. Could you please test it on OS X ?

@notasz
Copy link
Author

notasz commented Aug 15, 2014

Tested on OSX 10.10, your fix works. No more pathing errors in the console, and CSS from enabled files is applied on file save. Good work. :)

@dnbard
Copy link
Owner

dnbard commented Aug 16, 2014

Good news!

@dnbard dnbard closed this as completed Aug 16, 2014
@dnbard dnbard mentioned this issue Aug 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants