Skip to content

Commit

Permalink
fix(sandpack-react): open sandbox button (#761)
Browse files Browse the repository at this point in the history
  • Loading branch information
danilowoz authored Feb 28, 2023
1 parent b7386d2 commit 430a0f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useClasser } from "@code-hike/classer";
import * as React from "react";

import { THEME_PREFIX } from "../../../styles";
import { css, THEME_PREFIX } from "../../../styles";
import {
buttonClassName,
iconStandaloneClassName,
Expand All @@ -25,6 +24,7 @@ export const OpenInCodeSandboxButton = (): JSX.Element | null => {
)}
>
<ExportIcon />
<span>Open Sandbox</span>
</UnstyledOpenInCodeSandboxButton>
);
};
5 changes: 4 additions & 1 deletion sandpack-react/src/styles/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const buttonClassName = css({
cursor: "pointer",
color: "$colors$clickable",
border: 0,
textDecoration: "none",

"&:disabled": { color: "$colors$disabled" },

Expand All @@ -36,12 +37,14 @@ export const buttonClassName = css({
},

// If there's a children besides the icon
[`&.${iconStandaloneClassName}&:not(:has(svg + span))`]: {
[`&.${iconStandaloneClassName}&:not(:has(span))`]: {
width: "$space$7",
},

[`&.${iconStandaloneClassName}&:has(svg + span)`]: {
paddingRight: "$space$3",
paddingLeft: "$space$2",
gap: "$space$1",
},
});

Expand Down

1 comment on commit 430a0f5

@vercel
Copy link

@vercel vercel bot commented on 430a0f5 Feb 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

sandpack-docs – ./website/docs

sandpack-docs-codesandbox1.vercel.app
sandpack-docs-git-main-codesandbox1.vercel.app
sandpack.vercel.app

Please sign in to comment.