Markdown-preview-enhanced: How to Specify Font Size for Particular Slide?

Created on 4 Feb 2017  ·  2Comments  ·  Source: shd101wyy/markdown-preview-enhanced

I am using the MPE to write a slides. I have some code sample to show in one of the slides. However, some of them become invisible due to the default font size is too large. If set the font-size to 14px, that would be solved. I know we can modify the style.css file to change the font-size. But I don't want to change it for all slides. How to specify the custom font-size for the slide?
我在用MPE插件写一个演讲稿。其中有一页有比较长的代码展示。但是由于默认字体太大,后面有一部分被遮住了。如果可以把这一页的字体单独设置成14px就很完美了。怎么做?

Most helpful comment

非常感谢,这招管用。
在此基础之上,我加了一些额外的CSS来显示一个带有公司logo的脚注,放在这里一并分享,给有需要的人。
Thanks a lot! It works.
I made some other changes in this way to show a footer image for every slides. I'd like to share it here for someone else who may need it.

  @footer-img: no-repeat url(assets/footer_logo.png) bottom left;

  .preview-slides .slide,
  &[data-presentation-mode] {
    .slide-background {
      background: @footer-img;
      background-size: 8%; // I'm using a very large image, so I need to specify a smaller size here
    }
    .slide-background:last-child {
      display: none;
    }
  }

All 2 comments

Hi @thiner ,

你可以 cmd+shift+p 然后运行 Markdown Preview Enhanced: Customize Css 命令,
修改 .markdown-preview-enhanced-custom 部分如下:

( run cmd+shift+p then Markdown Preview Enhanced: Customize Css. Modify .markdown-preview-enhanced-custom section like below)

.markdown-preview-enhanced-custom {
  // ...
  // change the font size of the second slide to 14px
  .slide:nth-child(2),
  &[data-presentation-mode] section:nth-child(2) {
    font-size: 14px;
  }
}

谢谢

非常感谢,这招管用。
在此基础之上,我加了一些额外的CSS来显示一个带有公司logo的脚注,放在这里一并分享,给有需要的人。
Thanks a lot! It works.
I made some other changes in this way to show a footer image for every slides. I'd like to share it here for someone else who may need it.

  @footer-img: no-repeat url(assets/footer_logo.png) bottom left;

  .preview-slides .slide,
  &[data-presentation-mode] {
    .slide-background {
      background: @footer-img;
      background-size: 8%; // I'm using a very large image, so I need to specify a smaller size here
    }
    .slide-background:last-child {
      display: none;
    }
  }
Was this page helpful?
0 / 5 - 0 ratings

Related issues

yushukk picture yushukk  ·  3Comments

StefanoCecere picture StefanoCecere  ·  5Comments

shd101wyy picture shd101wyy  ·  4Comments

AdamBear-Me picture AdamBear-Me  ·  5Comments

ajstadlin picture ajstadlin  ·  5Comments