andrejilderda / joplin-macos-native-theme

Native looking macOS theme for note taking app Joplin
MIT License
290 stars 14 forks source link

build css for userchrome.css #121

Closed changsijay closed 11 months ago

changsijay commented 11 months ago

hi, Could you guilde me how to build CSS which can be copied and paste into userchrome.css?

ex: if I'd like to change

and run npm run build:css to get the css with above change

andrejilderda commented 11 months ago

Hi @changsijay, you don't have to build the css, it's as easy as changing the values in Joplin's settings under 'macOS theme'. ;)

changsijay commented 11 months ago

yes, if i install plugin and change settings it looks neat.

tho after installed macos theme plugin, my customized userstyles.css for markdown rendering not works well. (ex. the code block css)

that's why I tried using the generated css directly, and by this way, my customized userstyles.css works fine too.

so i am wondering if i can use this way with some default value changed and also it is easier to do more customizations based on the generated CSS too

gresces commented 11 months ago

I want to change the background color of rendered code block. But changes in userstyles.css are useless! I just want the bkg color to be lighter! :-)

changsijay commented 11 months ago

as I check com.andrejilderda.macOSTheme.jpl below part, could I override this part by userstyles.css ? because the color looks not that good on markdown preview

@media screen and (prefers-color-scheme: dark) {
  body#tinymce pre:not(.mermaid),
body#tinymce .inline-code,
#joplin-container-content pre:not(.mermaid),
#joplin-container-content .inline-code {
    background-color: rgba(var(--g-shadowColor--rgb), 0.2);
  }
}

example screenshot

image
gresces commented 11 months ago

as I check com.andrejilderda.macOSTheme.jpl below part, could I override this part by userstyles.css ? because the color looks not that good on markdown preview

@media screen and (prefers-color-scheme: dark) {
  body#tinymce pre:not(.mermaid),
body#tinymce .inline-code,
#joplin-container-content pre:not(.mermaid),
#joplin-container-content .inline-code {
    background-color: rgba(var(--g-shadowColor--rgb), 0.2);
  }
}

example screenshot image

I tried add '!important' at the end of lines. It's useful but I dislike this way. :-)

@media screen and (prefers-color-scheme: dark) {
  body#tinymce pre:not(.mermaid),
body#tinymce .inline-code,
#joplin-container-content pre:not(.mermaid),
#joplin-container-content .inline-code {
    background-color: rgba(var(--g-shadowColor--rgb), 0.05) !important;
  }
}
image
changsijay commented 11 months ago

now i am trying comment out this part in https://github.com/andrejilderda/joplin-macos-native-theme/blob/main/src/scss/components/_components.tinyMCE.scss#L93

and npm dist to build and use the plugin locally. then my userstyles.css works well now :) tho still wish have chance to use official plugin from here without local build.

image

image

andrejilderda commented 11 months ago

The theme styles unfortunately contain a lot of !important's because of the way the styles in Joplin are setup. There are nicer, more modern ways to handle this (cascade layers), but Joplin's base styles don't make use of this. This means for now there are no easy ways to override styles set by Joplin nor this theme and slapping some more !important's is the way to go.