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

How can you style the editor view? #18

Open
holroy opened this issue Apr 9, 2024 · 4 comments
Open

How can you style the editor view? #18

holroy opened this issue Apr 9, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@holroy
Copy link
Contributor

holroy commented Apr 9, 2024

I notice there is a lot of changes in the default css code blocks, versus the view which opens using this plugin. Is it possible somehow to make them look more alike?

@Zachatoo
Copy link
Owner

Depending on which mode you're in, Obsidian uses a different syntax highlighter. In editing mode it uses Codemirror, in reading mode it uses Prism. They both process the CSS differently. Here is a simple example.

Editing mode:
image

Reading mode:
image

It is possible to make them look more alike, but more alike to which one?

@Zachatoo Zachatoo added the enhancement New feature or request label Apr 10, 2024
@Zachatoo
Copy link
Owner

Someone else forked this repo and adjusted the styling, if you're looking for inspiration.

erichologist/obsidian-cssEditor

@holroy
Copy link
Contributor Author

holroy commented Apr 11, 2024

Would it be interesting for you to include a PR that changes the obsidian-theme.ts's file config variable to match the variable names from the Obsidian(?) setup? Like shown below:

image

This would allow for the css-view-editor window to follow the color theme for code blocks as defined in your current theme.

And/or have you considered changing to allow the usage of the Style settings plugin to change these colors? (I'm not entirely sure how well that copes with having the default be another variable, but in other aspects I consider that a viable option for changing CSS stuff to)

@Zachatoo
Copy link
Owner

Some of them already do match from what I can tell from a quick glance. I'm not opposed to more being added to be fully theme compatible, if possible.

I wasn't aware that Style Settings supported plugins, but a look at the plugin's README tells me it does! That also sounds like an interesting path worth investigating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants