Skip to content

Commit

Permalink
Merge pull request #446 from processing/fix/dark-mode-code-editor
Browse files Browse the repository at this point in the history
Fix color of dark mode code editor
  • Loading branch information
davepagurek committed Jul 7, 2024
2 parents d03abe0 + 48b7cb7 commit 6d126dc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
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

0 comments on commit 6d126dc

Please sign in to comment.