Skip to content

Commit

Permalink
Tailwind comp
Browse files Browse the repository at this point in the history
  • Loading branch information
ruucm committed Sep 10, 2024
1 parent de5f446 commit c81fd39
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type ButtonComponent = React.FC<Props> & {

export const Button: ButtonComponent = (props) => {
return (
<button className="bg-violet-700 p-6 text-green-200 font-bold text-2xl rounded-sm">
<button className="bg-violet-700 p-3 text-green-200 font-bold text-xl rounded-sm">
{props.title}
</button>
);
Expand Down
20 changes: 20 additions & 0 deletions src/Tailwind.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { useLayoutEffect } from "react";

export function Tailwind() {
useLayoutEffect(() => {
// Check if Tailwind CSS script already exists
if (!document.querySelector('script[src="https://cdn.tailwindcss.com"]')) {
// Create a script element
const script = document.createElement("script");
script.src = "https://cdn.tailwindcss.com";
script.async = true;
document.head.appendChild(script); // Append to head instead of body
// Clean up the script when the component unmounts
return () => {
document.head.removeChild(script);
};
}
}, []);

return <></>;
}
1 change: 0 additions & 1 deletion src/consts.ts

This file was deleted.

3 changes: 1 addition & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export * from "./consts";
export * from "./Box";
export * from "./Tailwind";
export * from "./Button";

export * from "./inputs/Input";
2 changes: 1 addition & 1 deletion src/inputs/Input.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ControlType } from "framer";

export function Input({ placeholder }) {
return <input placeholder={placeholder} />;
return <input placeholder={placeholder} className="border p-2" />;
}

Input.propertyControls = {
Expand Down

0 comments on commit c81fd39

Please sign in to comment.