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(SandpackCodeEditor): add className prop #896

Merged
merged 1 commit into from
Apr 8, 2023

Conversation

SSHari
Copy link
Contributor

@SSHari SSHari commented Apr 7, 2023

What kind of change does this pull request introduce?

This change adds a className prop to the SandpackCodeEditor component that gets merged with the root SandpackStack classes. The motivation behind this change is that I'd like to style the editor using tailwind, which isn't possible with the current setup. The change is similar to the existing implementation in the SandpackPreview component.

What is the current behavior?

The only way to style a SandpackCodeEditor component currently is to use the style prop.

What is the new behavior?

A new className prop has been added to the SandpackCodeEditor component to make it possible to style the editor using class names.

What steps did you take to test this? This is required before we can merge, make sure to test the flow you've updated.

I added the className prop to a few stories in Storybook and was able to see that the classes were applied to the correct element in the DOM.

Checklist

  • Documentation;
  • Storybook (if applicable);
  • Tests;
  • Ready to be merged;

@vercel
Copy link

vercel bot commented Apr 7, 2023

@SSHari is attempting to deploy a commit to the CodeSandbox Team on Vercel.

A member of the Team first needs to authorize it.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 7, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit e202a7e:

Sandbox Source
Sandpack Configuration
sandpack-run-stale-value Configuration

@danilowoz danilowoz merged commit 00cd7f4 into codesandbox:main Apr 8, 2023
@SSHari SSHari deleted the add-code-editor-class-name-prop branch April 8, 2023 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants