@@ -76,7 +76,9 @@ export class EditorContainer extends LitElement {
76
76
77
77
async firstUpdated ( ) : Promise < void > {
78
78
await super . updateComplete ;
79
+
79
80
if ( this . addMenu ) this . addMenu . anchor = this . headerContainer ;
81
+
80
82
const parentEditorContainer =
81
83
< EditorContainer > (
82
84
( < ShadowRoot > this . parentNode ) . host ?. closest ( 'editor-container' )
@@ -89,6 +91,8 @@ export class EditorContainer extends LitElement {
89
91
) ;
90
92
91
93
this . contrasted = ! parentEditorContainer . contrasted ;
94
+
95
+ this . tabIndex = 0 ;
92
96
}
93
97
94
98
private renderAddButtons ( ) : TemplateResult [ ] {
@@ -122,6 +126,7 @@ export class EditorContainer extends LitElement {
122
126
id= "menu"
123
127
corner = "TOP_RIGHT"
124
128
menuCor ner= "END"
129
+ .anchor = ${ this . headerContainer }
125
130
@selected = ${ ( e : Event ) => {
126
131
const tagName = ( < ListItem > ( < Menu > e . target ) . selected ) . value ;
127
132
this . openCreateWizard ( tagName ) ;
@@ -178,15 +183,14 @@ export class EditorContainer extends LitElement {
178
183
contrasted : this . contrasted ,
179
184
nomargin : this . nomargin ,
180
185
} ) } "
181
- tabindex = "0"
182
186
>
183
187
${ this . renderHeader ( ) }
184
- <slot name = "container" > </ slot>
188
+ <slot> </ slot>
185
189
</ section> ` ;
186
190
}
187
191
188
192
static styles = css `
189
- : host (.moving ) section {
193
+ : host (.moving ) . container {
190
194
opacity : 0.3 ;
191
195
}
192
196
@@ -195,7 +199,7 @@ export class EditorContainer extends LitElement {
195
199
transition : all 200ms linear;
196
200
outline-style : solid;
197
201
margin : 8px 12px 16px ;
198
- padding : 0.02 px ; /*Dirty hack to force outline around content with margin*/
202
+ overflow : hidden;
199
203
outline-width : 0px ;
200
204
outline-color : var (--mdc-theme-primary );
201
205
opacity : 1 ;
@@ -215,34 +219,31 @@ export class EditorContainer extends LitElement {
215
219
216
220
.nomargin {
217
221
margin : 0px ;
222
+ overflow : visible;
218
223
}
219
224
220
- .container : focus {
221
- box-shadow : 0 8px 10px 1px rgba (0 , 0 , 0 , 0.14 ),
222
- 0 3px 14px 2px rgba (0 , 0 , 0 , 0.12 ), 0 5px 5px -3px rgba (0 , 0 , 0 , 0.2 );
225
+ : host {
226
+ outline: none;
223
227
}
224
228
225
- .container : focus-within {
229
+ : host (: focus-within ) .container {
230
+ box-shadow : 0 8px 10px 1px rgba (0 , 0 , 0 , 0.14 ),
231
+ 0 3px 14px 2px rgba (0 , 0 , 0 , 0.12 ), 0 5px 5px -3px rgba (0 , 0 , 0 , 0.2 );
226
232
outline-width : 2px ;
227
233
transition : all 250ms linear;
228
234
}
229
235
230
- . container : focus-within h1 ,
231
- . container : focus-within h2 ,
232
- . container : focus-within h3 {
236
+ : host ( : focus-within ) h1 ,
237
+ : host ( : focus-within ) h2 ,
238
+ : host ( : focus-within ) h3 {
233
239
color : var (--mdc-theme-surface );
234
240
transition : background-color 200ms linear;
235
- }
236
-
237
- .container : focus-within h1 ,
238
- .container : focus-within h2 ,
239
- .container : focus-within h3 {
240
241
background-color : var (--mdc-theme-primary );
241
242
}
242
243
243
- . container . secondary : focus-within h1 ,
244
- . container . secondary : focus-within h2 ,
245
- . container . secondary : focus-within h3 {
244
+ : host ( : focus-within ) . container . secondary h1 ,
245
+ : host ( : focus-within ) . container . secondary h2 ,
246
+ : host ( : focus-within ) . container . secondary h3 {
246
247
background-color : var (--mdc-theme-secondary );
247
248
}
248
249
0 commit comments