MCPcopy Index your code
hub / github.com/darkreader/darkreader / isSafeToInvert

Function isSafeToInvert

src/inject/dynamic-theme/modify-css.ts:579–585  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

577 };
578
579 const isSafeToInvert = () => {
580 const repeat = (rule.style.backgroundRepeat || '').toLowerCase();
581 const size = (rule.style.backgroundSize || '').toLowerCase();
582 const isTiled = repeat.length > 0 && repeat !== 'no-repeat' && !repeat.includes('no-repeat');
583 const isStretched = size.includes('cover') || size.includes('contain') || size.includes('100%');
584 return !isTiled && !isStretched;
585 };
586
587 const getBgImageValue = (imageDetails: ImageDetails, theme: Theme) => {
588 const {isDark, isLight, isTransparent, isLarge, solidColor, width} = imageDetails;

Callers 1

getBgImageValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected