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

Rendered + styled component growing outside iframe bounding box, is cut off #242

Open
chrisfromredfin opened this issue Jan 19, 2018 · 3 comments
Assignees
Labels
Milestone

Comments

@chrisfromredfin
Copy link

A utility extend:

%button {
  border-radius: 5px;
  background-color: green;
  color: white;
  font-weight: bold;
  padding: 1rem;
  text-decoration: none;
  box-shadow: 6px 3px 3px black;
  &:hover {
    text-decoration: underline;
  }
}

And a regular button:

/// @group components
/// @name button
/// @example scss
///   .button {
///     @extend %button;
///   }
/// @example html
///   <a href="#CTA" class="button">Click me!</a>
.button {
  @extend %button;
}

My customCSS brings in the following css file, compiled from this.

.button {
  border-radius: 5px;
  background-color: green;
  color: white;
  font-weight: bold;
  padding: 1rem;
  text-decoration: none;
  box-shadow: 6px 3px 3px black; }
  .button:hover {
    text-decoration: underline; }

My output in Herman:

screen shot 2018-01-19 at 2 59 45 pm

Part of it is the height of the iframe being set to 42, which I don't think is including the padding on my element? The other part, I believe (because even if you bump the iframe up to height 92 it's still cut off on TOP), is the padding of the iframe is covering the start of body (.7em padding on iframe, but 8px (user-agent style) on body)?

Not really sure what the right solution is.

@mirisuzanne
Copy link
Member

Yeah, I've noticed that. We could add padding to the internal document body, rather than the wrapping frame, I think that would be a good start. There would still be issues I'm not sure how to solve…

@mirisuzanne
Copy link
Member

Adding this to the backlog.

@jgerigmeyer I've noticed that font-specimen output triggers an internal scroll-bar on the iframe. I'm not sure if that's related (iframe sizing issues) or should have a story of it's own?

@jgerigmeyer
Copy link
Member

Yeah, I think that's caused by the height getting set before fonts are fully loaded/rendered? So probably a different story.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants