-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
replay :hover rewrite - instead mutate stylesheets
#1480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
replay :hover rewrite - instead mutate stylesheets
#1480
Conversation
🦋 Changeset detectedLatest commit: 0a04127 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
:hover rewrite - instead mutate stylesheets
4177e18 to
17459cd
Compare
| import { createMirror, Mirror, stringifyStylesheet } from '../src/utils'; | ||
|
|
||
| /* | ||
| function toEqualCss(actual: string, expected: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made an attempt to write my own expect matcher, but gave up due to typescript overhead and wrote norm instead
9a1a0c6 to
5456cc3
Compare
4070a92 to
85db6c2
Compare
…s programmatically after it's added to the page instead of parsing the text - means we don't have to rely on regexp parsing to get css selectors and media statements - could be adapted for use against <link> stylesheets during replay
…lesheetForReplay` until the <style> element is in the DOM
…rantee that the adapt process will not rewrite
6a91327 to
0a04127
Compare
switch to model where we adapt the replay stylesheets programmatically after they have been added to the page instead of parsing the text
cssTexttext value to ensure we are substituting css selectors and media statements correctly<link>stylesheets during replay#1458 points out failings in the current css parsing, and switches to
postcss. This is an alternative to that and removes all 3rd party dependencies.This PR could also be a contender as a fix for #1478 (although I suspect something else is the matter there, as I couldn't create a stylesheet with the CSS text from that)
How to help:
ignoreline and upgrading typescript to a version that incorporates Add StyleSheetList and CSSRuleList to dom.iterable.d.ts microsoft/TypeScript#23406 bugfixadaptStylesheetForReplayafter a virtual dom operation (i.e. fastforward in replayer which has a diff of adding a new stylesheet)