htmlcsspolymerpaper-dialog

remove top padding from app-toolbar within paper-dialog - polymer


For the life of me, I can't seem to remove the stupid margin from the top of this paper-dialog when I have an app-toolbar at the top.

I managed to get it sorted with just a standard div by using margin-top: 0px;, but I can't do the same for the app-toolbar.

enter image description here

The culprit in developer mode on Chrome appears to be this line, but I can't get to it...

enter image description here

Code

paper-dialog {
  border-radius: 2px;
}

app-toolbar {
  background: green;
  margin-top: 0px;
}

.card-content {
  margin-top: 0px;
}
<base href="https://polygit.org/polymer+polymer+v1.9.1/components/" />
<script src="webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="polymer/polymer.html" />
<link rel="import" href="paper-dialog/paper-dialog.html" />
<link rel="import" href="app-layout/app-toolbar/app-toolbar.html" />
<link rel="import" href="paper-input/paper-input.html" />
<link rel="import" href="neon-animation/animations/scale-up-animation.html" />

<paper-dialog modal alwaysOnTop opened horizontalAlign="auto" entry-animation="scale-up-animation" exit-animation="fade-out-animation">
  <app-toolbar>Log in</app-toolbar>
  <div class="card-content">
    <paper-input placeholder="username or email"></paper-input>
    <paper-input placeholder="password"></paper-input>
  </div>
</paper-dialog>


Solution

  • Try adding:

    padding-top: 0px;
    margin-top: 0px;
    

    to your css for paper-dialog or the div containing paper-dialog!