-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(polyfill): Polyfill will now allow the removal of style sheets vi…
…a adoptedStyleSheets setter
- Loading branch information
Caleb Williams
committed
Jan 22, 2019
1 parent
48a74a1
commit 7120bfa
Showing
4 changed files
with
88 additions
and
9 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,14 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>Constructed style sheets test</title> | ||
<meta charset="UTF-8"> | ||
</head> | ||
<body> | ||
<h1>Hello world</h1> | ||
|
||
<p>How are you today?</p> | ||
</body> | ||
<script src="../adoptedStyleSheets.js"></script> | ||
<script src="./test.js"></script> | ||
</html> |
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,8 @@ | ||
const headingStyles = new CSSStyleSheet(); | ||
const paragraphStyles = new CSSStyleSheet(); | ||
|
||
document.adoptedStyleSheets = [ headingStyles, paragraphStyles ]; | ||
|
||
headingStyles.replace(` h1 { | ||
color: tomato; | ||
} `); |