feat(WEB-128): desktop and mobile initial wireframe implemented
This commit is contained in:
40
components/MyPages/Title/index.tsx
Normal file
40
components/MyPages/Title/index.tsx
Normal file
@@ -0,0 +1,40 @@
|
||||
import { cva } from "class-variance-authority"
|
||||
|
||||
import styles from "./title.module.css"
|
||||
|
||||
import type { HeadingProps } from "@/types/components/myPages/title"
|
||||
|
||||
const config = {
|
||||
variants: {
|
||||
text: {
|
||||
uppercase: styles.uppercase,
|
||||
},
|
||||
type: {
|
||||
h1: styles.h1,
|
||||
h2: styles.h2,
|
||||
h3: styles.h3,
|
||||
h4: styles.h4,
|
||||
h5: styles.h5,
|
||||
h6: styles.h6,
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
type: "h1",
|
||||
},
|
||||
} as const
|
||||
|
||||
const headingStyles = cva(styles.heading, config)
|
||||
|
||||
export default function Title({
|
||||
as,
|
||||
children,
|
||||
level = "h1",
|
||||
uppercase = false,
|
||||
}: HeadingProps) {
|
||||
const Hx = level
|
||||
const className = headingStyles({
|
||||
text: uppercase ? "uppercase" : undefined,
|
||||
type: as ?? level,
|
||||
})
|
||||
return <Hx className={className}>{children}</Hx>
|
||||
}
|
||||
43
components/MyPages/Title/title.module.css
Normal file
43
components/MyPages/Title/title.module.css
Normal file
@@ -0,0 +1,43 @@
|
||||
.heading {
|
||||
font-weight: 900;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.uppercase {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.h1 {
|
||||
font-size: 2.4rem;
|
||||
line-height: 2.8rem;
|
||||
}
|
||||
|
||||
.h2 {
|
||||
font-size: 2.4rem;
|
||||
line-height: 2.8rem;
|
||||
}
|
||||
|
||||
.h3 {
|
||||
font-size: 1.6rem;
|
||||
line-height: 1.8rem;
|
||||
}
|
||||
|
||||
.h4 {
|
||||
font-size: 1.4rem;
|
||||
}
|
||||
|
||||
.h5 {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.h6 {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 950px) {
|
||||
.h1 {
|
||||
font-size: 3.8rem;
|
||||
line-height: 4.5rem;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user