Skip to content

Commit 4407235

Browse files
feat: added tailwind code for gradient text (#427)
* feat: added tailwind code for gradient text * feat: added getOutput to tailwindHandler --------- Co-authored-by: Dunsin <[email protected]>
1 parent fed9751 commit 4407235

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/lib/packages.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,11 @@ const actOnTailwindGenerator = (
282282
codeToCopy = ``;
283283
break;
284284
case 'gradient-text':
285-
codeToCopy = ``;
285+
codeToCopy = `
286+
text-[${(outputElement.children[0] as HTMLElement).style.fontSize}]
287+
bg-[${(outputElement.children[0] as HTMLElement).style.background}]
288+
text-transparent
289+
bg-clip-text`;
286290
break;
287291
case 'gradient-border':
288292
codeToCopy = ``;

src/pages/gradient-text.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ getValues();
222222

223223
// Tailwind codecopy handler
224224
function tailwindHandler() {
225-
copyTailwindCodeToClipboard(attribute);
225+
const outputElement = getOutput(attribute);
226+
copyTailwindCodeToClipboard(attribute, outputElement);
226227
showPopup(
227228
'Tailwind Code Copied',
228229
'Code has been successfully copied to clipboard',

0 commit comments

Comments
 (0)