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

Prioritization error regarding custom style #1106

Open
1 of 2 tasks
AQian-Cup opened this issue Mar 16, 2024 · 0 comments
Open
1 of 2 tasks

Prioritization error regarding custom style #1106

AQian-Cup opened this issue Mar 16, 2024 · 0 comments
Labels
bug Something isn't working triage New issues that needs consideration

Comments

@AQian-Cup
Copy link

Bug report

Packages affected

  • sandpack-client
  • sandpack-react

Description of the problem

I configured Sandpack as follows

import { Sandpack } from "@codesandbox/sandpack-react";

import "./playground.css";

const Playground = () => {
  const files = {};
  return (
    <div className="h-screen flex flex-col">
      <div className="h-16"></div>
      <Sandpack
        files={files}
        theme="light"
        template="vite-vue"
        options={{
          editorHeight: "auto",
          classes: {
            "sp-wrapper": "playgroundWrapper",
            "sp-layout": "playgroundLayout",
          },
        }}
      />
    </div>
  );
};

When the css file is as follows, custom style cannot take effect, even if it already appears inside the tag.

.playgroundWrapper {
  flex: 1;
}
.playgroundLayout {
  height: 100%;
}

image

However, adding !important to the css file makes it work.

What steps can we take to reproduce the problem?

Simply add the above two files to Remix in Vite.
It's worth noting that I use Unocss, which may have some effect on it. But I found someone on StackOverflow with a similar problem at the following link: https://stackoverflow.com/questions/76650300/how-to-style-sandpack

Your Environment

Software Name/Version
Sandpack-client version
Sandpack-react version 2.13.5
Browser 122.0
Operating System Windows 11
@AQian-Cup AQian-Cup added bug Something isn't working triage New issues that needs consideration labels Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage New issues that needs consideration
Projects
None yet
Development

No branches or pull requests

1 participant