jekyll-theme-yat icon indicating copy to clipboard operation
jekyll-theme-yat copied to clipboard

How to make Alert or Callout?

Open mangbaam opened this issue 3 years ago • 2 comments

I looked at various ways to use Alert or Callout, but couldn't find a way.

In many examples use {% include warning.html title="some title" content="some contents" %} for Alert, and {% include callout_v2.html type="danger" content="some contents" %} for Callout.

Even the sample post provided by the YAT theme uses the following method, but it still does not work. image

plz give me some advice

mangbaam avatar May 16 '22 14:05 mangbaam

Hi @mangbaam I'm currently using this theme and noticed that .box-note .box-error and .box-warning aren't declared in any of the .SCSS files and the post from the screenshot above did not render correctly. I added those CSS classes to the file _sass/yat/_layout.scss under the .post-content selector on line 404 with the values below:

    .box-warning,
    .box-error,
    .box-note{
      padding:20px 10px;
    }
    .box-warning{
      background: rgba(255, 165, 0, .25);
    }
    .box-error{
      background: rgba(255, 0, 0, .25);
    }
    .box-note{
      background: rgba(0, 0, 0, .25);
    }

I didn't see any color variables to use for these so I grabbed some generic colors and used rgba to make them slightly transparent. Hope this is helpful. I can submit a PR if the repo owner finds this helpful!

Screenshot 2023-02-03 at 2 42 41 PM

leabs avatar Feb 03 '23 19:02 leabs

Hi @leabs

Thanks for your quick help, your help make a great difference! : )

Thanks & Regards

jeffreytse avatar Feb 03 '23 22:02 jeffreytse