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

Change font using my own stylesheet #14

Closed
fhill2 opened this issue Nov 25, 2022 · 2 comments
Closed

Change font using my own stylesheet #14

fhill2 opened this issue Nov 25, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@fhill2
Copy link

fhill2 commented Nov 25, 2022

I am trying to set the previewer to show a font different to the font i am using in vscode?

Is this possible? Maybe Im missing something..

1 - adding pandoc arg --css in vscode settings.json

"codebraid.preview.pandoc.options": [
        "--css assets/css/theme.css"
    ]

2 - Adding css: to _codebrain_preview.yml

#  _codebrain_preview.yml
css: assets/css/theme.css

CSS:

body {
  font-family: 'Liberation Serif';
}

I know its working using only pandoc with this test:

pandoc --defaults _codebraid_preview.yml -o market-research.html market-research.md
# this outputs an html with font as 'Liberation Serif'

Removing --css flags from this.pandocPreviewArgs does enable my custom font from the stylesheet.

@gpoore
Copy link
Owner

gpoore commented Nov 27, 2022

The issue is that currently the preview adds all of its settings after user settings, to prevent critical preview settings from being overwritten. But then your CSS is before the preview CSS, so it is overwritten.

Settings will need to be reorganized so that all critical preview settings are still added after user settings, but things like CSS are handled in reverse order. Most of that should be straightforward, at least for CSS, so there should be a new release soon with a fix.

@gpoore gpoore added the bug Something isn't working label Nov 27, 2022
gpoore added a commit that referenced this issue Dec 4, 2022
@gpoore
Copy link
Owner

gpoore commented Dec 4, 2022

This should work correctly now by default with the latest release. There are two new settings that determine whether the default CSS is loaded and whether it has precedence: codebraid.preview.css.useDefault and
codebraid.preview.css.overrideDefault.

@gpoore gpoore closed this as completed Jan 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants