-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from "react"; | ||
|
||
export default function FntColor({ children, color }) { | ||
return ( | ||
<span | ||
style={{ | ||
color: color, | ||
}} | ||
> | ||
{children} | ||
</span> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from "react"; | ||
|
||
export default function Highlight({ children, color }) { | ||
return ( | ||
<span | ||
style={{ | ||
backgroundColor: color, | ||
borderRadius: "2px", | ||
color: "#fff", | ||
padding: "0.2rem", | ||
}} | ||
> | ||
{children} | ||
</span> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from "react"; | ||
// Import the original mapper | ||
import MDXComponents from "@theme-original/MDXComponents"; | ||
import Highlight from "@site/src/components/Highlight"; | ||
import FntColor from "@site/src/components/FntColor"; | ||
|
||
export default { | ||
// Re-use the default mapping | ||
...MDXComponents, | ||
// Map the "<Highlight>" tag to our Highlight component | ||
// `Highlight` will receive all props that were passed to `<Highlight>` in MDX | ||
Highlight, | ||
FntColor, | ||
}; |