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

line-height for code? #15

Closed
cscheid opened this issue Sep 9, 2024 · 5 comments
Closed

line-height for code? #15

cscheid opened this issue Sep 9, 2024 · 5 comments

Comments

@cscheid
Copy link
Collaborator

cscheid commented Sep 9, 2024

It appears to me that bootstrap themes don't appear to allow line-height to be configured for monospace fonts, even though our schema allows it.

Should we disallow that or should we patch the scss? (Or, am I wrong?)

@gadenbuie
Copy link
Collaborator

Agreed, let's keep monospace more general (both inline and block-level monospace text) and drop line-height.

@gadenbuie
Copy link
Collaborator

gadenbuie commented Sep 10, 2024

let's keep monospace more general (both inline and block-level monospace text)

I take this back, I think color and background-color should apply to inline code blocks (think Quarto's purple inline code) and the rest of the properties should apply to all other content set in monospace type. At that point, why not include line-height for block-level code (<pre><code>).

typography:
  monospace:
    family:
    weight:
    style:
    line-height:      # block code
    color:            # inline code
    background-color: # inline code

That said, if you can can set the colors of inline code, why not block code? An alternative would be to have variants of monospace:

typography:
  monospace:
    family:
    weight:
    style:
  monospace-inline:
    color:
    background-color:
  monospace-block:
    line-height:
    color:
    background-color:

or to make block and inline nested options of monospace:

typography:
  monospace:
    family:
    weight:
    style:
    inline:
      color:
      background-color:
    block:
      line-height:
      color:
      background-color:

bootstrap themes don't appear to allow line-height to be configured for monospace fonts

To circle back to this, I think it's okay for us to also write CSS rules and not just adjust Sass variables. Or for us to plug into Quarto Sass variables (if there happens to be one for code blocks).

@cscheid
Copy link
Collaborator Author

cscheid commented Sep 10, 2024

At that point, why not include line-height for block-level code (<pre><code>).

No big reason. But that's not a thing that our current themes control, and I just wanted to flag it in case something similar is happening in bslib. In order for block-level code to have controllable line heights, we'll need actual changes in the themes, and that's not been the case so far for Quarto.

@cscheid
Copy link
Collaborator Author

cscheid commented Sep 10, 2024

Quarto will have SCSS and theming support for code line-height. It'd be great if bslib supported the same names.

@gadenbuie
Copy link
Collaborator

Closing in favor of #16 which covers this and additional typographic field updates.

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

No branches or pull requests

2 participants