Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/css tweaks #49

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/docs/[slug]/not-found.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Container } from "@/app/styles";

export default function PostNotFound() {
return (
<Container sideBar>
<Container sideBar hasBackground>
<NotFound text="Uh oh! This document couldn't be found. 🤷‍♂️" />
</Container>
);
Expand Down
2 changes: 1 addition & 1 deletion src/app/docs/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default async function Docs({ params }: Props) {
if (!doc) return notFound();

return (
<Container sideBar>
<Container sideBar hasBackground>
<Doc doc={doc} />
</Container>
);
Expand Down
10 changes: 7 additions & 3 deletions src/app/page.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ div.Container {
display: flex;
flex-direction: column;
justify-content: center;
min-height: 100dvh;
}

div.Container_hasBackground_true {
background: var(--color-bg) url("/background.png") center no-repeat fixed;
background-size: contain;
background-color: var(--color-bg);
background-image: radial-gradient(#fff4 0, var(--color-bg) 1px);
background-size: 12px 12px;
}

main.Hero {
Expand Down Expand Up @@ -68,6 +70,7 @@ main.Hero ul li a {
font-size: large;
padding: 18px;
color: var(--color-fg);
backdrop-filter: blur(1px);
border: 2px solid var(--color-grey);
border-radius: 4px;
font-weight: bold;
Expand Down Expand Up @@ -120,7 +123,8 @@ main.Hero ul li a svg {

main.Hero p.Version {
font-size: 1rem;
color: var(--color-grey);
color: var(--color-fg);
opacity: 0.25;
margin: 0;
padding: 0;
text-align: center;
Expand Down
2 changes: 1 addition & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const first = categories[0].docs[0];
export default async function Home() {
const version = await getPackageVersion("@phantomstudios/css-components");
return (
<Container>
<Container hasBackground>
<Hero id="hero">
<Image
src="/logo.svg"
Expand Down
3 changes: 2 additions & 1 deletion src/components/CodeClipboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ const CodeClipboard = ({ text }: Props) => {
const [isCopied, setIsCopied] = useState(false);

const copy = () => {
// Allows animation to play on mobile
navigator.clipboard.writeText(text);
setIsCopied(true);
setTimeout(() => {
setIsCopied(false);
}, 300);
}, 150);
};

return (
Expand Down
22 changes: 0 additions & 22 deletions src/components/CodeClipboard/styles.module.css

This file was deleted.

27 changes: 27 additions & 0 deletions src/components/CodeClipboard/styles.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
span.CodeClipboard {
display: flex;
gap: 10px;

background-color: var(--color-bg-dark);
color: inherit;

font-family: monospace;
font-size: 16px;

border-radius: 4px;
padding: 12px 32px;

cursor: pointer;
transition: 0.2s;

&:hover {
background-color: var(--color-teal);
color: var(--color-bg);
box-shadow: 0 12px 48px black;
}
}

span.CodeClipboard_copied_true:hover {
transform: translateY(4px);
box-shadow: 0 4px 16px black;
}
2 changes: 1 addition & 1 deletion src/components/CodeClipboard/styles.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { styled } from "@phantomstudios/css-components";

import css from "./styles.module.css";
import css from "./styles.module.scss";

export const CodeClipboardWrapper = styled("span", {
css: css.CodeClipboard,
Expand Down
1 change: 1 addition & 0 deletions src/components/CodeExample/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ ul.CodeSections {

li.CodeSection {
margin: 0 -1rem;
backdrop-filter: blur(1px);
border: 2px solid var(--color-grey);
border-radius: 4px;
transition: all 0.3s ease-in-out;
Expand Down
19 changes: 9 additions & 10 deletions src/components/NavLinks/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,15 @@ const NavLinks = ({ categories }: Props) => {
<h2>{category.title}</h2>
<Docs>
{category.docs.map((doc, i) => (
<List active={pathName?.endsWith(doc.slug)} key={i}>
<Link
href={`/docs/${doc.slug}`}
onClick={() => {
setOpen(false);
}}
>
{doc.title}
</Link>
</List>
<Link
key={i}
href={`/docs/${doc.slug}`}
onClick={() => {
setOpen(false);
}}
>
<List active={pathName?.endsWith(doc.slug)}>{doc.title}</List>
</Link>
))}
</Docs>
</li>
Expand Down
5 changes: 0 additions & 5 deletions src/components/Stats/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ li.statCard {
width: 240px;
height: 200px;
background-color: var(--color-bg-dark);
transition: 0.2s;
}

li.statCard:hover {
background-color: var(--color-bg-darker);
}

li.statCard h3 {
Expand Down