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

fix: responsive CSS #23

Merged
merged 1 commit into from
Nov 30, 2023
Merged
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
1 change: 1 addition & 0 deletions packages/shared-ui/src/cards/cards.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
flex-wrap: wrap;
gap: 25px;
width: var(--max-width);
max-width: 95vw;
}

.card {
Expand Down
3 changes: 2 additions & 1 deletion packages/shared-ui/src/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ html {
margin: 0;
}

body {
body,
#root {
padding: 0;
margin: 0;
min-height: 100vh;
Expand Down
75 changes: 16 additions & 59 deletions packages/shared-ui/src/root-layout.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,20 @@
}

.description {
display: inherit;
justify-content: inherit;
align-items: inherit;
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: nowrap !important;
font-size: 0.85rem;
max-width: var(--max-width);
width: 100%;
z-index: 2;
font-family: var(--font-mono);
padding: 10px;
padding-right: 100px;
position: sticky;
top: 0;
backdrop-filter: blur(3px);
}

.description a {
Expand Down Expand Up @@ -44,8 +50,9 @@
justify-content: center;
align-items: center;
position: relative;
padding-bottom: 2rem;
gap: 50px;
flex-wrap: wrap;
padding: 3rem;
gap: 20px 50px;
}

.center > div {
Expand Down Expand Up @@ -133,63 +140,13 @@ select.light {
}

/* Mobile and Tablet */
@media (max-width: 1023px) {
.content {
padding: 4rem;
}

.grid {
grid-template-columns: 1fr;
margin-bottom: 120px;
max-width: 320px;
text-align: center;
}

@media (max-width: 800px) {
.center {
padding: 8rem 0 6rem;
}

.center::before {
transform: none;
height: 300px;
padding: 4rem;
}

.description {
font-size: 0.8rem;
}

.description a {
padding: 1rem;
}

.description p,
.description div {
display: flex;
justify-content: center;
position: fixed;
width: 100%;
}

.description p {
align-items: center;
inset: 0 0 auto;
padding: 2rem 1rem 1.4rem;
border-radius: 0;
border: none;
border-bottom: 1px solid rgba(var(--callout-border-rgb), 0.25);
background: linear-gradient(to bottom, rgba(var(--background-start-rgb), 1), rgba(var(--callout-rgb), 0.5));
background-clip: padding-box;
backdrop-filter: blur(24px);
}

.description div {
align-items: flex-end;
pointer-events: none;
inset: auto 0 0;
padding: 2rem;
height: 200px;
background: linear-gradient(to bottom, transparent 0%, rgb(var(--background-end-rgb)) 40%);
z-index: 1;
padding: 30px;
padding-right: 100px;
}
}

Expand Down
3 changes: 2 additions & 1 deletion packages/shared-ui/src/root-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export function SharedRootLayout({ children, className = "", LinkElement, ...pro
<>
<ThemeSwitcher />
<main className={`${styles.main} ${className}`} {...props}>
<Description>{children}</Description>
<Description />
{children}
<Hero />
<ColorSwitch />
<ThemeController />
Expand Down
3 changes: 1 addition & 2 deletions packages/shared-ui/src/root/description.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { HTMLProps } from "react";
import { Logo } from "../common/logo";
import styles from "../root-layout.module.css";

export function Description({ children }: HTMLProps<HTMLElement>) {
export function Description() {
return (
<div className={styles.description}>
<a
Expand All @@ -14,7 +14,6 @@ export function Description({ children }: HTMLProps<HTMLElement>) {
<Logo className={styles.code} />
</p>
</a>
{children}
<div>
<a href="https://mayank-chaudhari.vercel.app" rel="noopener noreferrer" target="_blank">
By Mayank
Expand Down