Skip to content

Commit

Permalink
Color options for text
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewshaver committed Nov 13, 2024
1 parent 6810e18 commit c9979d6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
11 changes: 11 additions & 0 deletions website/src/components/ColoredText/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// src/components/ColoredText.js
import React from 'react';
import clsx from 'clsx';

const ColoredText = ({ color, className, children }) => (
<span style={color ? { color } : {}} className={clsx(className)}>
{children}
</span>
);

export default ColoredText;
10 changes: 10 additions & 0 deletions website/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -2112,3 +2112,13 @@ h2.anchor.clicked a.hash-link:before {
flex-direction: column;
}
}

.text-green {
color: #42f54e;
}
.text-red {
color: #ff171f;
}
.text-yellow {
color: #f5ea20;
}
2 changes: 2 additions & 0 deletions website/src/theme/MDXComponents/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import Lifecycle from '@site/src/components/lifeCycle';
import DetailsToggle from '@site/src/components/detailsToggle';
import Expandable from '@site/src/components/expandable';
import ConfettiTrigger from '@site/src/components/confetti/';
import ColoredText from '@site/src/components/ColoredText';

const MDXComponents = {
Head,
Expand Down Expand Up @@ -95,5 +96,6 @@ const MDXComponents = {
DetailsToggle: DetailsToggle,
Expandable: Expandable,
ConfettiTrigger: ConfettiTrigger,
ColoredText: ColoredText,
};
export default MDXComponents;

0 comments on commit c9979d6

Please sign in to comment.