revolunet / sublimetext-markdown-preview

markdown preview and build plugin for sublime text 2/3
MIT License
2.31k stars 362 forks source link

CSS: default vs. custom #303

Closed elewis33 closed 8 years ago

elewis33 commented 8 years ago

I tried to apply some custom CSS to my markdown preview. After a fashion I figured out the thing with creating a file of the same name, but with a .css extension to apply some overrides. This is great to know, but really kind of a pain because you have to create the CSS override file for every file you create. I wanted a more scalable fix, so I tried adding a user preference setting for the css, using the Sublime Preferences > Package Settings > Markdown Preview > Settings - User.

I added the following to that file:

{
    "css": "/path/to/file/md-preview.css"
}   

This never seemed to work, meaning my CSS settings were not getting applied/embedded into the HTML of the previewed file. My assumption is that this is because the default setting ("css":"default") was still set as the default setting and my user preference was effectively ignored.

I did what I thought I was NOT supposed to do, and modifed the css setting in the default preferences file and I got what I was looking for.

So, is this a case where the user preference really has no effect and the default setting really does need to be changed? I suppose the right thing to do might be to comment out the css setting in the default preferences and add it to the user preference. What say you?

Genuinely curious (and wanting to do the right thing) Earl

facelessuser commented 8 years ago

I'll will maybe take a look at this. I was slowly putting together a pull with a couple of feature requests and fixes, I will try and look at this and see if there is some kind of misunderstanding or a bug with this feature. I hopefully have some time coming available to look at MarkdownPreview again.

facelessuser commented 8 years ago

@elewis33, the feature is working fine for me. All I did was point css to my own personal CSS, and it was used instead of the default. I did not put it in the default, but it was in the user one. I'd double check you had the user one named exactly like the default. So as of right now, I don't see a bug.

elewis33 commented 8 years ago

Which build did you test with?

Earl

Sent from my iPhone (typos assumed)

On Nov 14, 2015, at 8:41 PM, Isaac Muse notifications@github.com wrote:

@elewis33, the feature is working fine for me. All I did was point css to my own personal CSS, and it was used instead of the default. I did not put it in the default, but it was in the user one. I'd double check you had the user one named exactly like the default. So as of right now, I don't see a bug.

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

facelessuser commented 8 years ago

So, I am using the tip of the master branch, but with that said, only superficial changes have been made since the last formal release. So I am essentially using the latest.

Did you do what was mentioned here from the forum: http://www.sublimetext.com/forum/viewtopic.php?f=2&t=21618#p73789 ? It looks like you were the one who posed the question. Double check your console for errors as well. Some times you can mess up the format of the settings file, and it will show you the errors in the console. Double check your spelling of your custom CSS path. Double check your CSS content is valid. Inspect the HTML in your webbrowser to see if maybe it is getting included, but just malformed causing it to appear like it isn't getting included.

At this point, I see nothing wrong. You would have to give me extensive details of all your steps for me to see what you are doing wrong. Right now, I would just be guessing. And since it is working just fine from what I can see, I can only assume it is user error.

facelessuser commented 8 years ago

As it has been 28 days without further response, I feel there it is no longer productive to leave this issue open as it isn't going to verified or resolved without further info. It can be reopened if more info can be provided to help us confirm that an issue indeed exists.