(reverseFilterValue: string, fix: InversionFix)
| 153 | } |
| 154 | |
| 155 | function createReverseRule(reverseFilterValue: string, fix: InversionFix): string { |
| 156 | const lines: string[] = []; |
| 157 | |
| 158 | if (fix.invert.length > 0) { |
| 159 | lines.push(`${joinSelectors(fix.invert)} {`); |
| 160 | lines.push(` -webkit-filter: ${reverseFilterValue} !important;`); |
| 161 | lines.push(` filter: ${reverseFilterValue} !important;`); |
| 162 | lines.push('}'); |
| 163 | } |
| 164 | |
| 165 | if (fix.noinvert.length > 0) { |
| 166 | lines.push(`${joinSelectors(fix.noinvert)} {`); |
| 167 | lines.push(' -webkit-filter: none !important;'); |
| 168 | lines.push(' filter: none !important;'); |
| 169 | lines.push('}'); |
| 170 | } |
| 171 | |
| 172 | if (fix.removebg.length > 0) { |
| 173 | lines.push(`${joinSelectors(fix.removebg)} {`); |
| 174 | lines.push(' background: white !important;'); |
| 175 | lines.push('}'); |
| 176 | } |
| 177 | |
| 178 | return lines.join('\n'); |
| 179 | } |
| 180 | |
| 181 | /** |
| 182 | * Returns fixes for a given URL. |
no test coverage detected