pourmand1376 / obsidian-custom-font

A plugin to set custom font for obsidian
https://obsidian.md/plugins?id=custom-font-loader
MIT License
62 stars 2 forks source link

Would love to set font only for tasks #3

Closed lenalebt closed 11 months ago

lenalebt commented 1 year ago

Hey, wow, thanks for the plugin :smile: ! I just recently created a font of my handwriting and would LOVE to use it on Obsidian. For the whole thing it's a bit too much, but I would love to use it for ticking off tasks. If I could somehow (using CSS rules?) to apply the font only there, it would be rad. Do you know if there is a way to achieve it?

Cheers, Lena

pourmand1376 commented 1 year ago

Hi, This feature is now added to the plugin. Please test it and provide feedback!

image

lenalebt commented 1 year ago

Hey wow, thanks for implementing this! How exactly did you imagine using it? I used this snippet to get it to work now:

.task-list-item {
    font-family: 'HandschriftLena-Regular', sans-serif;
    font-size: 24px;
}
.HyperMD-task-line {
    font-family: 'HandschriftLena-Regular', sans-serif;
    font-size: 24px;
}

It also worked as a "custom css snippet" with the default obsidian feature, but I am unsure whether I needed some of your recent changes for this to work or not?

Cheers, Lena

pourmand1376 commented 1 year ago

You need to use the newest version since by default it overrides all theme fonts.

This is what It does in default settings:

:root {
        --font-default: FontName;
        --default-font: FontName;
        --font-family-editor: FontName;
        --font-monospace-default: FontName,
        --font-interface-override: FontName,
        --font-text-override: FontName,
        --font-monospace-override: FontName,    
    }