Skip to content

Commit

Permalink
adjustment component code example
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasferreiralimax committed Aug 24, 2024
1 parent 3586ae6 commit dedf2c2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
5 changes: 4 additions & 1 deletion src/components/Code/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { useEffect, useRef } from 'react';
import hljs from 'highlight.js';
import 'highlight.js/scss/atom-one-light.scss';
Expand All @@ -10,7 +11,9 @@ function ModalInstall(props: any) {
}, [props.children]);

return (
<code ref={codeRef} className={`language-${props.language}`}>{props.children}</code>
<div className="code-wrapper">
<code ref={codeRef} className={`language-${props.language}`}>{props.children}</code>
</div>
);
}

Expand Down
10 changes: 5 additions & 5 deletions src/components/ModalInstall/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
h2:first-of-type {
margin-top: 0;
}
code:last-of-type {
margin-bottom: 0;
h2, h3 {
margin: 2rem 0;
}
code {
padding: 1rem;
.type {
background: #fff;
color: #000;
white-space: pre;
border-radius: 8px;
padding: .5rem;
margin-right: 1rem;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ body.modal-active {

.code-wrapper {
color: var(--color-text);
background: var(--vtl-background);
background: #fff;
padding: 1rem;
border-radius: 10px;
display: inline-block;
Expand Down

0 comments on commit dedf2c2

Please sign in to comment.