Skip to content

Commit 4c6bee3

Browse files
aqsaaqeelAqsa AqeelDun-sin
authored
fix: no output in box shadow (#443)
Co-authored-by: Aqsa Aqeel <[email protected]> Co-authored-by: Dunsin <[email protected]>
1 parent 4959a27 commit 4c6bee3

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/pages/box-shadow.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
getShadowSpread,
77
getShadowColor,
88
getResultPage,
9+
getResultButton,
910
getCopyCodeButton,
1011
getPreviewSlider,
1112
getShadowFields,
@@ -16,6 +17,7 @@ import {
1617
getCssOrTailwindDropdown,
1718
} from '../lib/getElements';
1819
import {
20+
triggerEmptyAnimation,
1921
copyCSSCodeToClipboard,
2022
copyTailwindCodeToClipboard,
2123
showPopup,
@@ -35,7 +37,6 @@ const attribute = 'box-shadow';
3537
let isSliderOpen = false;
3638
const getCssOrTailwindDropdownElement = getCssOrTailwindDropdown(attribute);
3739
const showCopyClass = 'show-css-tailwind';
38-
3940
function copyHandler() {
4041
const outputElement = getOutput(attribute);
4142
copyCSSCodeToClipboard(attribute, outputElement);
@@ -67,6 +68,21 @@ export function boxShadowGenerator(
6768
const getOutputElement = getOutput(attribute);
6869
const resultPage = getResultPage();
6970

71+
if (
72+
horizontalOffset.value === '' ||
73+
verticalOffset.value === '' ||
74+
blur.value === '' ||
75+
spread.value === '' ||
76+
color.value === ''
77+
) {
78+
triggerEmptyAnimation(color);
79+
const resultBtn = getResultButton(attribute);
80+
if(resultBtn){
81+
resultBtn.style.backgroundColor = 'grey';
82+
}
83+
return;
84+
}
85+
7086
resultPage.style.display = 'flex';
7187
if (type === 'oldResults') return;
7288

0 commit comments

Comments
 (0)