ObsidianCustomFrames icon indicating copy to clipboard operation
ObsidianCustomFrames copied to clipboard

Width 100% of the active note(Custom_Frame)

Open igorpereirabr1 opened this issue 2 years ago • 6 comments

Hi, first of all, congratulations, this is one of the most interesting plugins from Obsidian.

Talking about my issue, I would like to know if there is a way to force the width of a custom_frame to 100%

image

Thanks!

igorpereirabr1 avatar Aug 08 '22 19:08 igorpereirabr1

Hi! As you can see in the README, you can add any custom CSS to a frame when it's in Markdown mode.

Putting a width: 100% might be enough, but I'm not sure, since the element the frame is in might be too nested compared to the element that has the max width you're referring to. If that doesn't work, you can try to find other style options online that might work for this use case. If you find a good one, do let me know here so I can add it as an example!

Ellpeck avatar Aug 08 '22 19:08 Ellpeck

I'll try this too, I'm able to achieve the expected result with the bellow html code:

igorpereirabr1 avatar Aug 08 '22 19:08 igorpereirabr1

The custom frame is also just an iframe (or a webview on Desktop), so you should be able to apply the same style to it to make it work!

Ellpeck avatar Aug 08 '22 19:08 Ellpeck

I'll try to do this... I'm terrible with html and css.. hehehe

igorpereirabr1 avatar Aug 08 '22 19:08 igorpereirabr1

Hi, just in case someone else needs a similar solution, I've included the below css in my custom frame:

.custom-frames-frame { position:fixed !important; top:35px !important; left:1px !important; bottom:35px !important; right:1px !important; width:100% !important; height:100% !important; border:none !important; margin:0 !important; padding:0 !important; overflow:hidden !important; z-index:999999 !important; }

the output was:

image

igorpereirabr1 avatar Aug 10 '22 13:08 igorpereirabr1

Actually, this gave me the idea to add individual classes to each frame, so that you can use snippets to configure the looks of specific frames!

Ellpeck avatar Aug 10 '22 15:08 Ellpeck