To define a specific distance between the dialog and the right side, you can modify the 'right' property of your paper-dialog element with a fixed position as shown below:
html /deep/ .dialog-right-position {
position: fixed;
top: 10px;
right: 10px;
}
Make sure to apply the same CSS class name to your element.
<paper-dialog heading="Custom Dialog Positioning" class="dialog-right-position">
<p>This is a right positioned paper dialog!</p>
</paper-dialog>
If you require a demonstration, see the example provided below:
<!doctype html>
<html>
<head>
<title>paper-dialog-alignment</title>
<script src="webcomponentsjs/webcomponents.js"></script>
<link href="paper-button/paper-button.html" rel="import">
<link href="paper-dialog/paper-dialog.html" rel="import">
<style shim-shadowdom>
html /deep/ .dialog-right-position {
position: fixed;
top: 10px;
right: 10px;
}
html /deep/ .dialog-right-position::shadow #scroller {
width: 500px;
height: 350px;
}
</style>
</head>
<body unresolved>
<template is="auto-binding">
<section on-tap="{{toggleRightDialog}}">
<button>
Display dialog
</button>
<paper-dialog heading="Custom Dialog Positioning" class="dialog-right-position">
<p>This is a right positioned paper dialog!</p>
</paper-dialog>
</section>
</template>
<script>
var scope = document.querySelector('template[is=auto-binding]');
scope.toggleRightDialog = function(e) {
if (e.target.localName == 'button') {
var d = e.target.nextElementSibling;
if (d) {
d.toggle();
}
}
};
</script>
</body>
</html>