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

Can not use the portal feature #78

Closed emtothed closed 2 weeks ago

emtothed commented 2 weeks ago

sorry to bother you, it's not actually an issue, but I can't use the portal feature and I'm not sure if I'm not getting it or if it's a technical issue

I create a card and embed another canvas but the only thing I get is just the embedded canvas in the card, and the info of the cards of the embedded canvas is not visible. There is no door icon option in the pop-up for me as you mentioned in the docs. what am I doing wrong here ?

versions : obsidian: 1.6.5 plugin: 3.0.3

Update :

I have the door icon when I use the encapsulate feature but not when I embed a canvas in a card, so I guess it's a bug right ?

Capture

ps. Another thing, is there any option to set a default card text size ?

Developer-Mike commented 2 weeks ago

You don't need to create a new text node for a portal. It only works if you directly add a file node linking to a canvas file.

Developer-Mike commented 2 weeks ago

Regarding the card text size: If you want to change it permanently, you can just use a CSS snippet. If you want a style setting, please check out #55. I'll later post a guide there. To change the default style, you can use the default node styles in the settings.

emtothed commented 2 weeks ago

thank you so much for the guidance, I tried the file node and it works perfectly and about the font size, I added this to the data. json and it works :

"customNodeStyleAttributes": [{
         "datasetKey": "fontSize", 
         "label": "Font Size",
         "options": [
             {
                 "icon": "case-upper", 
                 "label": "16",
                 "value": null 
             },
             {
                 "icon": "case-upper", 
                 "label": "26",
                 "value": "26" 
             }
         ]   
     }],

and also added this to my custom css file :

.canvas-node[data-font-size="26"] { /* The dataset key is now written in kebab-case */
    font-size: 26px;
}

it worked with background-color: #7f7f7f; but is not with font-size. do you know what tag is proper for changing the font size ?

update : this doesn't work too

.canvas-node[data-font-size="26"] { /* The dataset key is now written in kebab-case */
    --font-text-size:26px;

}
Developer-Mike commented 2 weeks ago

Your updated CSS should work... But check out the updated guide and try its CSS snippet. (And make sure you've enabled the snippet)

emtothed commented 2 weeks ago

The problem was that I had this

/* Increase text size for canvas cards */
.markdown-preview-view .markdown-preview-section {
    font-size: 20px; /* Adjust this value as per your preference */
}

higher than the other classes and it was blocking them, it's working now. thank you so much for your time and also for the huge value you added to the application with this great plugin

emtothed commented 2 weeks ago

Final code

Javascript:

"customNodeStyleAttributes": [{
         "datasetKey": "fontSize", 
         "label": "Font Size",
         "options": [

             {
                 "icon": "case-upper", 
                 "label": "20",
                 "value": null 
             },
             {
                 "icon": "case-upper", 
                 "label": "24",
                 "value": "24" 
             },
             {
                 "icon": "case-upper", 
                 "label": "28",
                 "value": "28" 
             },
             {
                 "icon": "case-upper", 
                 "label": "32",
                 "value": "32" 
             },
             {
                 "icon": "case-upper", 
                 "label": "36",
                 "value": "36" 
             },
             {
                 "icon": "case-upper", 
                 "label": "40",
                 "value": "40" 
             },
             {
                 "icon": "case-upper", 
                 "label": "50",
                 "value": "50" 
             },
             {
                 "icon": "case-upper", 
                 "label": "70",
                 "value": "70" 
             }
         ]   
     }],

CSS :

.canvas-node[data-font-size=null] { /* The dataset key is now written in kebab-case */
    --font-text-size:20px;

}
.canvas-node[data-font-size="24"] { /* The dataset key is now written in kebab-case */
    --font-text-size:24px;

}
.canvas-node[data-font-size="28"] { /* The dataset key is now written in kebab-case */
    --font-text-size:28px;

}
.canvas-node[data-font-size="32"] { /* The dataset key is now written in kebab-case */
    --font-text-size:32px;

}
.canvas-node[data-font-size="36"] { /* The dataset key is now written in kebab-case */
    --font-text-size:36px;

}
.canvas-node[data-font-size="40"] { /* The dataset key is now written in kebab-case */
    --font-text-size:40px;

}
.canvas-node[data-font-size="50"] { /* The dataset key is now written in kebab-case */
    --font-text-size:50px;

}
.canvas-node[data-font-size="70"] { /* The dataset key is now written in kebab-case */
    --font-text-size:70px;

}
Developer-Mike commented 2 weeks ago

Thank you for sharing it 🙏🏻