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

CSS Variables + Better Web Component Styling #189

Merged
merged 2 commits into from
Apr 6, 2022

Conversation

taybenlor
Copy link
Owner

This PR adds new CSS variables to the runno-run web component:

--runno-editor-height, --runno-terminal-height, --runno-editor-max-height, --runno-terminal-min-height.

The default look and layout behaviour of the web component has also been improved so that it works nicely without any styling.

@github-actions
Copy link

github-actions bot commented Apr 6, 2022

Visit the preview URL for this PR (updated for commit 8ecdcbb):

https://make-run-website--pr189-feat-runno-css-varia-7tds4zjl.web.app

(expires Wed, 13 Apr 2022 23:03:58 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@taybenlor taybenlor merged commit c8c3145 into main Apr 6, 2022
@taybenlor taybenlor deleted the feat/runno-css-variables branch April 6, 2022 23:05
@LukePrior
Copy link

I've had a chance to try this out but I've found that --runno-editor-height doesn't actually work unless runno-editor has overflow:auto set, I would suggest setting this on default but if that breaks iframe I would request that it is available to set as a CSS variable. Thanks

@taybenlor
Copy link
Owner Author

Did you try setting max height? max-height will effectively override height.

@LukePrior
Copy link

LukePrior commented Apr 7, 2022

max-height doesn't seem to work without overflow:auto:

image

@LukePrior
Copy link

I was also thinking that having a max-height option for the terminal in addition to a min-height could be useful.

@taybenlor
Copy link
Owner Author

Okay I'll keep fiddling with how these work. I was hoping the overflow behaviour would "just work" as a result of the flex rules I'd set.

I think for most people the best way to restrict the height of the editor will be to set a height on the runno-run element. For people (like you) who want more control over the individual pieces I think it would be better to have a way to compose together the editor, the terminal and the controls.

@LukePrior
Copy link

LukePrior commented Apr 7, 2022

The problem is even with setting just a height on the runno-run element and not using any other styling including these new variables I still encounter the overflow issue.

runno-run {
    max-height: 60vh;
}

image

The only way to get the element working (force overflow) for long code snippets is by setting the --runno-editor-height but that isn't ideal as I don't always want it at the maximum size.

@taybenlor
Copy link
Owner Author

Can you send me an example? I don't see that same behaviour.

Here I've edited a runno-run element on the Runno website to have a height of 400px and it comfortably scrolls:

Screen Shot 2022-04-07 at 11 05 11 pm

@LukePrior
Copy link

Ok so I've done some more testing and it works fine if I set a height:400px but if I do max-height:400px then it breaks. I think this only applies to non-iframe versions so I can't replicate it on the website.

I just quickly tested and adding overflow:auto to runno-editor doesn't seem to have any adverse effects and fixes all of these issues. I can open a PR if you want.

@taybenlor
Copy link
Owner Author

Yep I just had a play around and can replicate what you're describing. Looks like overflow: auto behaves nicely so I think that's a good default. PR would be great, thanks!

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