forked from Polymer/polymer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Polymer#3776 from Polymer/refresh-styles-ie
Refresh cache'd styles contents in IE 10 and 11
- Loading branch information
Showing
2 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script src="../../../webcomponentsjs/webcomponents-lite.min.js"></script> | ||
<link href="../../polymer.html" rel="import"> | ||
|
||
<style> | ||
|
||
@media (min-width: 800px) { | ||
body { | ||
background: red; | ||
} | ||
} | ||
|
||
@media (max-width: 799px) { | ||
body { | ||
background: green; | ||
} | ||
} | ||
</style> | ||
|
||
|
||
</head> | ||
<body> | ||
|
||
<dom-module id="x-foo"> | ||
<template> | ||
<style> | ||
|
||
:host { | ||
display: block; | ||
margin-left: var(--foo, 0px); | ||
} | ||
|
||
.item { | ||
width: 100px; | ||
height: 100px; | ||
border: 1px solid white; | ||
} | ||
|
||
@media (min-width: 800px) { | ||
:host { | ||
--foo: 10px; | ||
} | ||
|
||
.item { | ||
background: red; | ||
} | ||
} | ||
|
||
@media (max-width: 799px) { | ||
.item { | ||
background: green; | ||
} | ||
} | ||
|
||
</style> | ||
|
||
<div class="item"></div> | ||
</template> | ||
<script> | ||
HTMLImports.whenReady(function() { | ||
Polymer({ | ||
is: 'x-foo' | ||
}); | ||
}); | ||
var debouncer; | ||
window.onresize = function() { | ||
Polymer.Debounce(debouncer, function() { | ||
Polymer.updateStyles(); | ||
}, 100); | ||
}; | ||
</script> | ||
</dom-module> | ||
|
||
|
||
<h1>The box should match the background color</h1> | ||
|
||
<x-foo></x-foo> | ||
|
||
</body> | ||
</html> |