File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 292
292
293
293
normalizeRootSelector : function ( rule ) {
294
294
rule . selector = rule . selector . replace ( ROOT , 'html' ) ;
295
+ // handle 2.x rules like `:host, html {}`
296
+ var parts = rule . selector . split ( COMPLEX_SELECTOR_SEP ) ;
297
+ parts = parts . filter ( function ( part ) {
298
+ return part . trim ( ) !== HOST ;
299
+ } ) ;
300
+ rule . selector = parts . join ( COMPLEX_SELECTOR_SEP ) ;
295
301
} ,
296
302
297
303
_transformDocumentSelector : function ( selector ) {
Original file line number Diff line number Diff line change 141
141
--html-foo : 10px dotted green;
142
142
}
143
143
</ style >
144
+ < style is ="custom-style ">
145
+ : host , html {
146
+ - - polymer-2- root: 10px solid rgb(123, 123, 123);
147
+ }
148
+ </ style >
144
149
</ head >
145
150
< body >
146
151
< div class ="italic "> italic</ div >
162
167
163
168
< parent-variable-with-var > </ parent-variable-with-var >
164
169
170
+ < polymer-2-root > </ polymer-2-root >
171
+
165
172
< br > < br >
166
173
< div id ="after "> </ div >
167
174
314
321
</ template >
315
322
</ dom-module >
316
323
324
+ < dom-module id ="polymer-2-root ">
325
+ < template >
326
+ < style >
327
+ : host {
328
+ bor der: var(--polymer-2-root );
329
+ }
330
+ </ style >
331
+ </ template >
332
+ </ dom-module >
333
+
317
334
< script >
318
335
HTMLImports . whenReady ( function ( ) {
319
336
Polymer ( {
338
355
Polymer ( {
339
356
is : 'x-top-selectors'
340
357
} ) ;
358
+ Polymer ( {
359
+ is : 'polymer-2-root'
360
+ } )
341
361
} )
342
362
</ script >
343
363
386
406
assertComputed ( xFoo . $ . bar3 . $ . baz , '5px' ) ;
387
407
} ) ;
388
408
409
+ test ( 'polymer 2 shared styles applied' , function ( ) {
410
+ var polymer2 = document . querySelector ( 'polymer-2-root' ) ;
411
+ assertComputed ( polymer2 , '10px' ) ;
412
+ } )
413
+
389
414
test ( 'custom properties registered as defaults' , function ( ) {
390
415
var propsToCheck = [ '--italic' ] ;
391
416
if ( Polymer . Settings . useNativeCSSProperties || stylesBuilt ) {
You can’t perform that action at this time.
0 commit comments