Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix color of dark mode code editor #446

Merged
merged 2 commits into from
Jul 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/CircleButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const CircleButton = ({
href,
className = "",
}: CircleButtonProps) => {
const sharedClassName = `grid place-items-center w-[40px] h-[40px] rounded-full p-xs hover:border-type-white hover:!bg-bg-black hover:text-type-white ${className}`;
const sharedClassName = `circle-button grid place-items-center w-[40px] h-[40px] rounded-full p-xs hover:border-type-white text-black hover:!bg-bg-black hover:text-type-white ${className}`;
if (href) {
return (
<a
Expand Down
2 changes: 1 addition & 1 deletion src/components/CodeEmbed/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export const CodeEmbed = (props) => {
setPreviewCodeString(initialCode);
}}
ariaLabel="Reset code to initial value"
className="bg-sidebar-bg-color"
className="bg-white text-black"
>
<Icon kind="refresh" />
</CircleButton>
Expand Down
2 changes: 1 addition & 1 deletion src/components/CopyCodeButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const CopyCodeButton = ({ textToCopy }: CopyCodeButtonProps) => {
<CircleButton
onClick={copyTextToClipboard}
ariaLabel="Copy code to clipboard"
className="bg-sidebar-bg-color"
className="bg-white text-black"
>
<svg
width="18"
Expand Down
4 changes: 4 additions & 0 deletions styles/code-editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
padding: var(--spacing-sm);
.dark-theme & {
background-color: #DDD;
color: black;
}
}

.dark-theme .code-editor-container {
filter: invert(100%);
& .circle-button {
filter: invert(100%);
}
}

.cm-editor * {
Expand Down