HTMLStyleElement.sheet DOM definition
See original GitHub issueTypeScript Version: 3.2.0-dev.201xxxxx
Search Terms: sheet
Code
using the DOM API
const style = document.querySelector('style');
const sheet = style.sheet;
Expected behavior:
sheet is returned as a StyleSheet, however ALL browsers do not return a StyleSheet class, they return a CSSStyleSheet class, so when you do something like sheet.insertRule it doesn’t exist in the type
Actual behavior:
style.sheet returns a StyleSheet class
Related Issues:
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
HTMLStyleElement - Web APIs - MDN Web Docs
Chrome Edge
HTMLStyleElement Full support. Chrome1. Toggle history Full support. Edge12. Togg...
blocking. Experimental Full support. Chrome105. Toggle history Full support. Edge105. Tog...
disabled Full support....
Read more >Document Object Model StyleSheets - W3C
The StyleSheetList interface provides the abstraction of an ordered collection of style sheets. IDL Definition. // Introduced in DOM Level 2: interface ...
Read more >HTMLStyleElement (Common DOM API)
Designed for use with one or more target media. See the media attribute definition in HTML 4.0. setMedia. void setMedia(String media) ...
Read more >HTMLStyleElement
The HTMLStyleElement interface represents a style element. ... Document Object Model (DOM) Level 2 HTML Specification The definition of ...
Read more >HTML DOM Element style Property - W3Schools
It does not contain any style properties set in the <head> section or in any external style sheets. Note 1. You cannot set...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@saschanaz any updates on this?
Is there any ways to get writable CSSStyleSheet object from the DOM?