editor: sticky header (#479)

This commit is contained in:
jean-emmanuel 2019-03-12 18:23:39 +01:00
parent 0607594714
commit 8b0f895b2b
3 changed files with 23 additions and 2 deletions

View file

@ -1,5 +1,10 @@
# Changelog
## next
- editor
- sticky header
## 0.41.7
- bug fixes

View file

@ -383,12 +383,13 @@ var Editor = class Editor {
createEditForm(){
var widget = this.selectedWidgets[0],
props = this.defaults[widget.props.type]
props = this.defaults[widget.props.type],
multi = this.selectedWidgets.length > 1
this.form.appendChild(html`
<div class="separator">
<span class="${this.selectedWidgets.length > 1 ? 'accent' : ''}">
${this.selectedWidgets.length > 1 ? 'Multiple Widgets' : 'Widget'}
Widget${multi ? 's' : ''}: ${multi ? this.selectedWidgets.length + ' selected': widget.getProp('id')}
</span>
</div>
`)

View file

@ -221,6 +221,8 @@
align-items: center;
border: 1rem solid var(--color-bg);
box-shadow: 0 0 0 1rem var(--color-light) inset;
padding: 0 10rem;
span {
text-transform: lowercase;
font-variant: small-caps;
@ -229,6 +231,9 @@
width:100%;
text-align:center;
pointer-events: none;
text-overflow:ellipsis;
overflow:hidden;
&.accent {
color: var(--color-accent);
}
@ -261,6 +266,16 @@
}
}
// sticky editor header
.editor-container .form > .separator {
background: var(--color-fg);
position: sticky;
top:10rem;
box-shadow: 0 0 0 1rem var(--color-light) inset,
0 -10rem 0 0 var(--color-fg);
z-index: 10;
}
.widget.editing {