Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a second class onto the callouts works in html format but not revealjs format #5208

Closed
cderv opened this issue Apr 17, 2023 · 3 comments · Fixed by #7111
Closed

Adding a second class onto the callouts works in html format but not revealjs format #5208

cderv opened this issue Apr 17, 2023 · 3 comments · Fixed by #7111
Assignees
Labels
callouts Issues with Callout Blocks. enhancement New feature or request revealjs Issues with the revealjs format
Milestone

Comments

@cderv
Copy link
Collaborator

cderv commented Apr 17, 2023

Adding a second class onto the callouts for HTML works — One usage example is to target a callout using CSS

::: {.callout-note .my-callout}
Hello!
:::

And the CSS file:

.callout.callout-style-default.my-callout .callout-body {
    font-size: 1.0rem;
}

From a post by @jimjam-slam in #4755 (comment)

This works for HTML format as we pass attributes and classes, but not in revealjs format where it seems we don't.

@cderv cderv added enhancement New feature or request revealjs Issues with the revealjs format labels Apr 17, 2023
@cderv cderv added this to the v1.4 milestone Apr 17, 2023
@cderv cderv self-assigned this Apr 17, 2023
@cderv
Copy link
Collaborator Author

cderv commented Apr 17, 2023

@cscheid I think we need to adapt our callout custom node creation to allow passing attributes for revealjs format as we allow for html format. I can handle it for 1.4 or later, part of revealjs work.

@cscheid
Copy link
Collaborator

cscheid commented Apr 17, 2023

Agreed. I'm surprised that this doesn't work. I wonder if it's hiding a bigger bug.

@cscheid cscheid self-assigned this Apr 17, 2023
@cderv
Copy link
Collaborator Author

cderv commented Apr 17, 2023

I don't think so. From what I saw this morning, we are using a specific function for revealjs output

elseif _quarto.format.isEpubOutput() or _quarto.format.isRevealJsOutput() then
return epubCallout(node)

but we are not inheriting the node.attr when creating the callout, as we do for HTML with bootstrap

local attributes = pandoc.List({"callout"})
if type ~= nil then
attributes:insert("callout-" .. type)
end
if hasIcon == false then
attributes:insert("no-icon")
end
if title ~= nil then
attributes:insert("callout-titled")
end
attributes:insert("callout-style-" .. calloutAppearance)
return pandoc.Div({calloutBody}, pandoc.Attr(node.id or "", attributes))

I think we should have a specific revealjsCallout(), or non boostrap HTML callout. I don't know if we can pass any class and attributes to epub structure. Anyway, I was planning to make a proposal for 1.4 later. Happy to let you handle it as you know better this part of the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
callouts Issues with Callout Blocks. enhancement New feature or request revealjs Issues with the revealjs format
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants