Developer-Mike / obsidian-advanced-canvas

⚡ Supercharge your Obsidian.md canvas experience! Create presentations, flowcharts and more!
GNU General Public License v3.0
192 stars 7 forks source link

[FR] Node-specific font size #55

Closed Eusorph closed 3 weeks ago

Eusorph commented 2 months ago

It would be great if you could add an option to change font size to a whole card.

Developer-Mike commented 2 months ago

How do you imagine the implementation? Should there be a setting in the popup-menu like the settings for the node shapes. Or did you think about something different?

Developer-Mike commented 3 weeks ago

In version 3.0.0 (currently pre-release) you can add custom styling attributes. This is a perfect use case for this new freedom.

Developer-Mike commented 2 weeks ago

Here is a guide to add font size settings:

  1. Take a look at the following instructions
  2. Use this snippet for the data.json file
    "customNodeStyleAttributes": [
     {
         "datasetKey": "fontSize",
         "label": "Font Size",
         "options": [
             {
                 "icon": "arrow-big-up",
                 "label": "Large",
                 "value": "large"
             },
             {
                 "icon": "minus",
                 "label": "Medium (default)",
                 "value": null
             },
             {
                 "icon": "arrow-big-down",
                 "label": "Small",
                 "value": "small"
             }
         ]   
     }
    ]
  3. Use this CSS snippet
    
    .canvas-node[data-font-size="large"] {
    --font-text-size: var(--font-ui-large);
    }

.canvas-node[data-font-size="small"] { --font-text-size: var(--font-ui-small); }