Skip to content

Commit 63f4100

Browse files
authored
fix: Remove unnecessary active background (#261)
1 parent d7d1bb0 commit 63f4100

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/main.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ function generatorsFunction(attribute: string): void {
235235
case 'animation':
236236
animationGenerator();
237237
break;
238-
case 'box-shadow':
239-
boxShadowGenerator();
238+
case 'box-shadow':
239+
boxShadowGenerator();
240240
break;
241241
}
242242
}
@@ -272,6 +272,16 @@ function showContent(attribute: string, display: Display): void {
272272
highLightGen.style.border = '1px solid var(--tertiary-color)';
273273
}
274274

275+
//event listener to clear styling on generator tabs when "Code magic is clicked"
276+
document.getElementById('head')?.addEventListener('click', () => {
277+
const generatorsNav = document.querySelectorAll(`[data-gen]`);
278+
generatorsNav.forEach((item) => {
279+
const generatorNav = <HTMLElement>item;
280+
generatorNav.style.border = 'none';
281+
generatorNav.style.background = 'none';
282+
});
283+
});
284+
275285
function showResult(attribute: string | null) {
276286
results.forEach((item) => {
277287
const element = <HTMLElement>item;
@@ -335,7 +345,7 @@ const displayGradientValue = (gradientElement: HTMLInputElement) => {
335345
const unitDisplayElement = <HTMLElement>(
336346
target.parentElement?.querySelector('.unit-display')
337347
);
338-
348+
339349
// change the unit for opacity
340350
const unit = titleDisplayElement.innerText.toLowerCase().includes('opacity')
341351
? ''

0 commit comments

Comments
 (0)