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

Make user styles work on the section container #467

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dkaushik95
Copy link

@dkaushik95 dkaushik95 commented Mar 28, 2023

Target the base section element so that users can change the width/height and positioning to the section instead of the monaco editor

Reference issue: #468

Target the base section element so that users can change the width/height and positioning to the section instead of the monaco editor
@suren-atoyan
Copy link
Owner

Having className on the parent component makes sense, but it may lead to compatibility issues. We either need to wait for the next major version update or try to find something else. If your goal is to reach the section component then let's consider these workarounds:

const Container = styled('div')({
  '> section': {
    // ... write your styles here
  }
});

function OurCoolComponent() {
  return (
    <Container>
      <Editor
        language="python"
        ...
      />
    </Container>
  );
}
function OurCoolComponent() {
  return (
    <Editor
      language="python"
      wrapperProps={{
        style={{
          // ... write your styles here
        }}
      }}
    />
  );
}

@dkaushik95
Copy link
Author

Thanks for your reply @suren-atoyan. Those are the workarounds currently in place and we can wait for the next major release to look into this. Let me know if I can do changes here based on your decision or close it and wait for an enhancement issue.

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