Skip to content

how to specify styles in markdown metadata #1752

Answered by ChristianMurphy
sandys asked this question in Q&A
Discussion options

You must be logged in to vote

MDX includes exports.

You could add the theme as an exported constant

export const theme = 'halloween'

# rest of document

goes here

You could also use a frontmatter if you prefer https://v2.mdxjs.com/guides/frontmatter/

In both cases, the layout component wrapping MDX would apply the theme.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ChristianMurphy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants