RyotaUshio / obsidian-latex-theorem-equation-referencer

A powerful indexing & referencing system for theorems & equations in your Obsidian vault.
https://ryotaushio.github.io/obsidian-latex-theorem-equation-referencer/
MIT License
147 stars 6 forks source link

Italic style is applied to certain types of callouts even when all preset css is disabled #202

Closed joelatschool closed 7 months ago

joelatschool commented 7 months ago

I'm using beta9 and I noticed that somehow the rule linked below:

https://github.com/RyotaUshio/obsidian-math-booster/blob/6f20179380552398001877361076951a7d278e06/styles/framed.css#L21

Is generating a CSS rule

:not(theorem-callout-axiom):not(.theorem-callout-definition):not(.theorem-callout-remark).theorem-callout-en .callout-content {
    font-style: italic;
}

which does not target .theorem-callout-framed.

joelatschool commented 7 months ago

It seems like make_styles.py is assuming that every css rule will begin with .theorem-callout, but this rule breaks that:

https://github.com/RyotaUshio/obsidian-math-booster/blob/6f20179380552398001877361076951a7d278e06/make_styles.py#L24C1-L24C65

Easiest fix that isn't a hack but also doesn't require actually parsing the css or switching to an actual preprocessor might be using nesting, although I don't know if it's supported by Obsidian's electron version or w/e.

RyotaUshio commented 7 months ago

Thanks a ton for spotting this! It should be fixed in the latest release 2.0.0-beta10.

And yeah, make_styles.py was indeed one of the dirtiest codes contained in this repository, written back when I had just started this whole web-ish stuff (js/ts/css)...

I've decided to rewrite it using Sass. (I started learning it just today!)

By the way, I had separated theorem styling CSS into separate files in order to make each of them serve as a sample CSS snippet for users who aren't familiar with CSS (like me).

(e.g. https://github.com/RyotaUshio/obsidian-math-booster/blob/2.0.0-beta9/styles/framed.css)

Now, each CSS file cannot be used as a CSS snippet as is, because it's now .scss file containing @mixin: https://github.com/RyotaUshio/obsidian-math-booster/blob/2.0.0-beta10/styles/framed.scss

By any chance do you know how to construct a single styles.css file from the separate CSS files, each of which doesn't contain @mixin, so that each CSS file for a preset style can be used as a stand-alone CSS snippet?