Skip to content

Commit

Permalink
fix: shopify sites re-add stripped css (#22942)
Browse files Browse the repository at this point in the history
  • Loading branch information
daibhin authored Jun 13, 2024
1 parent 23147c0 commit a8ca0a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion frontend/src/scenes/session-recordings/player/rrweb/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,13 @@ export const CorsPlugin: ReplayPlugin & {
},
}

const defaultStyleRules = `.ph-no-capture { background-image: ${PLACEHOLDER_SVG_DATA_IMAGE_URL} }`
// replaces a common rule in Shopify templates removed during capture
// fix tracked in https://github.com/rrweb-io/rrweb/pull/1322
const shopifyShorthandCSSFix =
'@media (prefers-reduced-motion: no-preference) { .scroll-trigger:not(.scroll-trigger--offscreen).animate--slide-in { animation: var(--animation-slide-in) } }'

export const COMMON_REPLAYER_CONFIG: Partial<playerConfig> = {
triggerFocus: false,
insertStyleRules: [`.ph-no-capture { background-image: ${PLACEHOLDER_SVG_DATA_IMAGE_URL} }`],
insertStyleRules: [defaultStyleRules, shopifyShorthandCSSFix],
}

0 comments on commit a8ca0a7

Please sign in to comment.