#Highlighting

1 messages · Page 1 of 1 (latest)

grave lightBOT
#

Hi @frail thicket. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

To highlight your code using the specified variables in MDX, you can use the MDX extension for VSCode (https://marketplace.visualstudio.com/items?itemName=unifiedjs.vscode-mdx). This extension provides IntelliSense and syntax highlighting for MDX, which will help you apply your custom theme.

Here are the steps to set up and use the MDX extension for your code highlighting needs:

  1. Install the MDX Extension for VSCode:

  2. Configure Your Theme:

    • Add your custom CSS variables to your global CSS file or within a styled component in your Next.js project. Here is an example of how you can define these variables in a CSS file:
    :root {
      --theme-code-fg-color: var(--theme-grey-9);
      --theme-code-bg-color: var(--theme-grey-2);
      --theme-code-hl-color: var(--theme-accent-a20);
      --theme-code-hl-number-color: hsl(290, 60%, 70%);
      --theme-code-hl-special-color: var(--theme-grey-7);
      --theme-code-hl-function-color: var(--theme-grey-7);
      --theme-code-hl-constant-color: var(--theme-grey-7);
      --theme-code-hl-keyword-color: hsl(40, 75%, 60%);
      --theme-code-hl-string-color: hsl(330, 80%, 70%);
      --theme-code-hl-name-color: var(--theme-grey-8);
      --theme-code-hl-operator-color: var(--theme-grey-6);
      --theme-code-hl-punctuation-color: var(--theme-grey-6);
      --theme-code-hl-comment-color: var(--theme-grey-6);
      --theme-code-hl-generic-color: var(--theme-grey-6);
      --theme-code-hl-variable-color: var(--theme-grey-6);
    }
    
  3. Highlighting Code in MDX:

    • Use the MDX syntax to include code blocks in your MDX files. You can use backticks to create code blocks and inline code. Here is an example: