Skip to content

Conversation

cderv
Copy link
Collaborator

@cderv cderv commented Oct 30, 2024

This PR focus on Callouts

  • styles-callout.html has been integrated for Revealjs into quarto.scss. This way SCSS variable can be used to tweak callouts.

  • This goes with SCSS refactoring to

    • Regroup all rules for callouts in same place
    • Use nested structured to better understand what is common rules, and specific rules
    • Prepare for more customisation
  • Callouts in Revealjs has been made closer looking to the one in Boostrap

    • Same default colors (slightly different from current 1.5 default)
    • Same logic to apply Callout Type in SCSS meaning same SCSS variable can be used.
    • Those variables and there defaults are
       $callout-border-width: 0.3rem !default;
       $callout-border-scale: 0% !default;
       $callout-icon-scale: 10% !default;
       $callout-margin-top: 1rem !default;
       $callout-margin-bottom: 1rem !default;
       $callout-color-note: #0d6efd !default;
       $callout-color-tip: #198754 !default;
       $callout-color-important: #dc3545 !default;
       $callout-color-caution: #fd7e14 !default;
       $callout-color-warning: #ffc107 !default;
    • Same SVG icons as bootstrap are used now instead of PNG
  • It also solves some issues

    • Background problem on div.sourceCode when it is last element of Callout. A duplicated color was shown.
      • Currently with 1.5
        image
      • Now
        image
    • When div.sourceCode is last element of simple style callout, there was border merging. Some margin have been added
      • 1.5
        image
      • Now
        image

The new looks can be found at https://examples.quarto.pub/revealjs-default-callouts-styles/
Not easy to compare, but everything should be good looking.

I used this presentation to check visually that new SCSS gives same results a current version. If anything seems odd to any of you, please tell me.

Opening as a draft, as I need to run a few more examples and checks

@cderv cderv marked this pull request as draft October 30, 2024 17:53
@cderv cderv force-pushed the callout-styles branch 3 times, most recently from a14b58d to 20b6b89 Compare November 4, 2024 10:12
cderv added 2 commits November 5, 2024 10:54
So that it applies also in non bootstrap like revealjs
Same as in bootstrap file as loaded in the `_quarto-uses.scss` file layer for all HTML format.

This simplifies understanding and make it more coherent with the rest of the Quarto styles.
cderv added 2 commits November 5, 2024 11:08
- Move callouts style in SCSS to make them configurable
- Use same color as bootstrap HTML
- Make SCSS more coherent with the one used in Bootstrap
- Remove using styles-callout.html for revealjs. Only keep it for epub
@cderv
Copy link
Collaborator Author

cderv commented Nov 5, 2024

I updated the online example with new content I used to check everything

One improvment to add
image

It seems we never styled correctly the simple callout content.

FWIW in HTML it looks like
image

@cderv
Copy link
Collaborator Author

cderv commented Nov 5, 2024

So I think we are missing some structure in the HTML that would require to modify the Lua filter for revealjs.

We need a wrapper for the flex display, so that we can apply flex-grow on the inside content.

I don't want to handle that in same PR as this is about style. And maybe we'll want to push to 1.7 instead for this fix - I am not sure about touching the Lua filter this late.

@cderv cderv marked this pull request as ready for review November 6, 2024 16:19
@cderv cderv merged commit a50d6bb into main Nov 6, 2024
47 checks passed
@cderv cderv deleted the callout-styles branch November 6, 2024 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Callout in revealjs slide with smaller class get unaligned title [Revealjs] Allow customisation of callouts similar as in HTML

1 participant