AnubisNekhet / AnuPpuccin

Personal theme for Obsidian
GNU General Public License v3.0
1.98k stars 159 forks source link

Is it possible to add an option to set the maximum height of embedded notes (only for md files) #214

Closed LDzzZ-1 closed 11 months ago

LDzzZ-1 commented 11 months ago

Sometimes embedded notes or embedded paragraphs are a bit long, resulting in a larger proportion of the document. Can you add an option: when this option is turned on, you can set the maximum note height, and when the embedded md file exceeds this value, you can mouse over the embedded note and use the scroll wheel to scroll up and down to toggle the display.

AnubisNekhet commented 11 months ago

Obsidian does have a variable for maximum embed height, known as --embed-max-height. I'll add a setting to change the value of that variable. If you want a snippet that changes the maximum height for certain embeds, you can have this snippet. Simply add capped as in ![[embed|capped]] to enable it.

/* @settings
name: Capped Embeds
id: capped-embeds
settings:
    - 
        id: capped-embed-height
        title: Maximum embed height in px
        type: variable-number
        default: 200
*/
.markdown-embed[alt*="capped"] .markdown-embed-content {
    --embed-max-height: var(--capped-embed-height);
}