Skip to content

Commit

Permalink
feat: add css code.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Feb 19, 2022
1 parent cc40087 commit 3befd3d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export default function App() {
color.a
}f)`}
/>
<Code color={color} lang="css" title="CSS" code={`body { color: ${hex}; }`} />
</div>
</div>
</div>
Expand Down
4 changes: 4 additions & 0 deletions src/app/Code.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import Prism from 'prismjs';
import 'prismjs/components/prism-csharp';
import 'prismjs/components/prism-swift';
import 'prismjs/components/prism-c';
import 'prismjs/components/prism-css';
import 'prismjs/components/prism-css-extras';
import 'prismjs/components/prism-objectivec';
import styles from './Code.module.css';
import './prism.css';
Expand Down Expand Up @@ -37,6 +39,8 @@ export default function Code(props: CodeProps) {
html = Prism.highlight(code, Prism.languages.csharp, 'csharp');
} else if (lang == 'objectivec') {
html = Prism.highlight(code, Prism.languages.objectivec, 'objectivec');
} else if (lang == 'css') {
html = Prism.highlight(code, Prism.languages.objectivec, 'css');
}
setHtml(html);
}, [code]);
Expand Down

0 comments on commit 3befd3d

Please sign in to comment.