obsidian-advanced-canvas icon indicating copy to clipboard operation
obsidian-advanced-canvas copied to clipboard

Font size

Open Eusorph opened this issue 1 year ago • 1 comments

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

Eusorph avatar May 13 '24 20:05 Eusorph

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 avatar May 18 '24 11:05 Developer-Mike

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 avatar Jun 23 '24 19:06 Developer-Mike

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"
             }
         ]   
     }
 ]
  1. 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);
}

Developer-Mike avatar Jul 02 '24 04:07 Developer-Mike