Skip to content

Commit 7ea999a

Browse files
committed
fix(styles): preserve img max-width when cleaning Tailwind defaults
- Prevent layout regressions by keeping Tailwind's img max-width - Update regex to only strip height:auto instead of removing rule - Replace matched block with cleaned rule so other props remain - Rebuild dist artifacts: add hot-update file and update user script
1 parent e23aa24 commit 7ea999a

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"c":["main"],"r":[],"m":[]}

dist/omnivox-optimizer.user.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/modules/styles.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ export function injectStyles() {
3737
/\*,\s*::after,\s*::before,\s*::backdrop,\s*::file-selector-button\s*\{[^}]*box-sizing:\s*border-box;[^}]*\}/g,
3838
''
3939
);
40-
// Remove problematic img/video max-width rules
40+
// Remove problematic img/video height: auto rule
4141
lastStyleTag.textContent = lastStyleTag.textContent.replace(
42-
/img,\s*video\s*\{[^}]*max-width:\s*100%;[^}]*height:\s*auto;[^}]*\}/g,
43-
''
42+
/img,\s*video\s*\{([^}]*?)height:\s*auto;([^}]*?)\}/g,
43+
'img, video {$1$2}'
4444
);
4545
}
4646
}

0 commit comments

Comments
 (0)