Skip to content
\n\n
  • \n

    Put markdown.md into the created folder.

    \n
    ---\nmarp: true\ntheme: your-theme\n---\n\n# Hello, world!
    \n
  • \n
  • \n

    Hit F1 and run \"Preferences: Open Workspace Settings\".

    \n
  • \n
  • \n

    Search \"Themes\" and find out Markdown > Marp: Themes.

    \n
  • \n
  • \n

    Add a path theme.css. Now ready to use \"your-theme\".

    \n
  • \n
  • \n

    Open markdown.md, and confirm the root of current workspace is the working folder you've made.

    \n
  • \n
  • \n

    Open Markdown preview from the this icon:

    \n

    \"\"

    \n
  • \n
  • \n

    Check whether showing \"Hello, world!\" with red text.

    \n

    \"\"

    \n
  • \n
  • \n

    Congratulations, you've created your first CSS theme!

    \n
  • \n\n

    Excerice

    \n

    Try changing color: red; to color: blue; in theme.css and save it.

    \n
    \n

    The most part of Marp theme is plain CSS so you have to dive into CSS from here. If you are a beginner, strongly recommend to learn CSS first. https://web.dev/learn/css/

    ","upvoteCount":17,"url":"https://github.com/orgs/marp-team/discussions/115#discussioncomment-759004"}}}

    How to create a theme? #115

    Answered by yhatt
    kecrily asked this question in Q&A
    May 19, 2021 · 5 comments · 16 replies
    Discussion options

    You must be logged in to vote

    https://marpit.marp.app/theme-css is only describing about the thinking of theme CSS syntax. To use your own theme actually, you have to register the custom CSS theme in your VS Code workspace: https://github.com/marp-team/marp-vscode#use-custom-theme-css-shield

    Tutorial

    1. Create a folder for working and open the folder in VS Code.

    2. Put theme.css into the created folder. It makes a theme named "your-theme".

      /* @theme your-theme */
      
      @import 'default';
      
      h1 {
        color: red;
      }
    3. Put markdown.md into the created folder.

      ---
      marp: true
      theme: your-theme
      ---
      
      # Hello, world!
    4. Hit F1 and run "Preferences: Open Workspace Settings".

    5. Search "Themes" and find out Markdown > Marp: Themes.

    6. Add a p…

    Replies: 5 comments 16 replies

    Comment options

    You must be logged in to vote
    8 replies
    @calidion
    Comment options

    @yhatt
    Comment options

    @Doyoulikemilk
    Comment options

    @zrxdaly
    Comment options

    @yhatt
    Comment options

    Answer selected by kecrily
    Comment options

    You must be logged in to vote
    5 replies
    @yhatt
    Comment options

    @calidion
    Comment options

    @calidion
    Comment options

    @yhatt
    Comment options

    @calidion
    Comment options

    Comment options

    You must be logged in to vote
    1 reply
    @yhatt
    Comment options

    Comment options

    You must be logged in to vote
    1 reply
    @zrxdaly
    Comment options

    Comment options

    You must be logged in to vote
    1 reply
    @yhatt
    Comment options

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Category
    Q&A
    Labels
    None yet
    8 participants