Initial commit

This commit is contained in:
Martin Berg Alstad
2022-12-04 17:51:05 +01:00
commit 5e8aefe665
23 changed files with 2458 additions and 0 deletions

View File

0
src/components/header.ts Normal file
View File

View File

22
src/components/link.tsx Normal file
View File

@ -0,0 +1,22 @@
import { Component, JSX } from "solid-js";
import { LinkProps } from "../types/interfaces";
export const A: Component<LinkProps> = (
{
to,
rel,
children,
className,
id,
newTab = true,
}): JSX.Element => {
return (
<a href={ to } id={ id }
rel={ `${ rel } ${ newTab ? "noreferrer" : undefined }` }
target={ newTab ? "_blank" : undefined }
class={ `link ${ className }` }>
{ children }
</a>
);
};

View File

11
src/index.css Normal file
View File

@ -0,0 +1,11 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer components {
.link {
@apply hover:underline text-blue-500;
}
}

15
src/index.tsx Normal file
View File

@ -0,0 +1,15 @@
/* @refresh reload */
import { render } from "solid-js/web";
import "./index.css";
import type { Component } from "solid-js";
const HomePage: Component = () => {
return (
<>
<p class="text-4xl text-green-700 text-center py-20">Hello tailwind!</p>
</>
);
};
render(() => <HomePage />, document.getElementById("root") as HTMLElement);

13
src/types/interfaces.ts Normal file
View File

@ -0,0 +1,13 @@
import { JSX } from "solid-js";
export interface ChildProps {
children?: JSX.Element,
className?: string,
id?: string,
}
export interface LinkProps extends ChildProps {
to?: string,
rel?: string,
newTab?: boolean,
}