Akifyss/obsidian-border

Callout Align and Used alone

Closed this issue · 4 comments

Dear developer, this theme of yours is really very beautiful, using your theme has made me very happy in using Obsidian, thank you for your dedicated development!

However, I'm having a compatibility issue with it and need to ask you to point me in the right direction.

I have a CSS snippet modified from blue topaz that centers the content of a callout whose metadata contains "center". However, in the Border theme, this centering is not working. My code is as follows:

/* === Support right left center Syntax ============ */
/* Supports two ways of writing
    > [!note|right]
    > [!note right]
   */
.callout.callout:is([data-callout-metadata*="left"],
[data-callout*=left]) {
  float: left !important;
  margin: unset;
}
.callout.callout:is([data-callout-metadata*="right"],
[data-callout*=right]) {
  float: right !important;
  margin: unset;
}

.callout.callout:is([data-callout-metadata*="center"],
[data-callout*=center]) {
  display: block;
  margin: auto;
  float: unset ;
  text-align: center;
}

I tried both "|left" and "|right" and both work fine, except "center" which fails. I tried to modify the code to realize this function, but failed. Can you please tell me how to modify the code to realize this function?

Another small requirement I have is that I would like to use a separate callout style for some callouts, while other callouts use the style set in the style setting. I can do this in the AnuPpuccin theme with the callout-metadata function, for example:

> [!note|anp-vanilla-normal] Heading

It is possible to make that callout alone to be displayed in a style like anp-vanilla-normal. I wonder if there is a way for me to do this in the Border theme?

Finally, thank you again for the effort you put into developing such a great theme and I look forward to hearing from you!

What is the correct effect of the 'center' effect? Could you please provide some visual information? I tried your snippet, and in my environment, it performs as follows. I'm not sure if it's the same as yours.
image
image

I see, it's because I turned on the "Justify paragraph text" option that caused the centering in Callout to fail. After turning off this option everything worked fine, thanks for your help!

Also, regarding my latter question about whether it is possible to use a certain callout style on its own, could you please give me some guidance?🥺

After updating the theme, you can use the following annotations "style-1", "style-2", "style-3", and "style-4" to individually apply a specific callout style.

Thank you so much! Thanks for taking my advice♥️