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

Allow overriding container styles #52

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

karlhorky
Copy link

@karlhorky karlhorky commented Mar 3, 2019

MVP for #44 (comment)

<div
  style={{
    height: '100vh',
    display: 'flex',
    flexDirection: 'column',
  }}
>
  <div style={{ flex: 1, overflow: 'hidden' }} key="codeTop">
    <CodeSurfer
      code={require('!raw-loader!./example-1.html')}
      lang="markup"
      containerStyles={{ height: '100%', width: '100%', padding: '10px' }}
    />
  </div>
  <div style={{ height: '2px', backgroundColor: '#333' }} />
  <div style={{ flex: 1, overflow: 'hidden' }} key="codeBottom">
    <CodeSurfer
      code={require('!raw-loader!./example-1.css')}
      lang="css"
      containerStyles={{ height: '100%', width: '100%', padding: '10px' }}
    />
  </div>
</div>

Before:

screen shot 2019-03-04 at 00 08 23

After:

screen shot 2019-03-04 at 00 51 33

@pomber
Copy link
Owner

pomber commented Mar 5, 2019

Hey @karlhorky , thanks for the PR!
I think there are going to be other problems if you put two deck-code-surfer components in the same slide. We need a different component for that use case.
If you want to try to rewrite deck-code-surfer-split I'd be happy to merge it.

@karlhorky
Copy link
Author

Two deck-code-surfer components actually works surprisingly well, have this in a couple of decks so far since I developed this solution. I even have a deck that uses steps in both HTML and CSS at the same time to teach how selectors work, and this also works well.

What are your concerns? The only problem I've had so far is the sizing / zooming.

@karlhorky
Copy link
Author

If there's something that I haven't thought about, then I'm all for considering other options (like rewriting the deck-code-surfer-split component with your guidance).

The decks I have are working pretty well though.

Aside from that, I could imagine that other use cases would also be served well from overriding the container styles. Do you have something against allowing this?

@pomber pomber mentioned this pull request May 13, 2019
19 tasks
@karlhorky karlhorky mentioned this pull request May 20, 2019
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.

None yet

2 participants