Skip to content
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
50 changes: 10 additions & 40 deletions apps/landing/src/app/(detail)/docs/core-concepts/nm-base/page.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { ExampleGrid } from '@/components/mdx/components/ExampleGrid'

export const metadata = {
title: 'N/M Base',
alternates: {
Expand Down Expand Up @@ -48,15 +50,7 @@ Class name generation follows these steps:

### **Basic Class Names**

<div
style={{
display: 'grid',
gridTemplateColumns: '1fr 1fr',
gap: '2rem',
marginBottom: '2rem',
alignItems: 'start',
}}
>
<ExampleGrid>
<div>
```tsx // Input
<div>
Expand All @@ -75,19 +69,11 @@ Class name generation follows these steps:
</div>
```
</div>
</div>
</ExampleGrid>

### **Responsive Class Names**

<div
style={{
display: 'grid',
gridTemplateColumns: '1fr 1fr',
gap: '2rem',
marginBottom: '2rem',
alignItems: 'start',
}}
>
<ExampleGrid>
<div>
```tsx // Input
<Box w={[100, 200, 300]} />
Expand All @@ -99,19 +85,11 @@ Class name generation follows these steps:
{/* w: 100px, w: 200px, w: 300px */}
```
</div>
</div>
</ExampleGrid>

### **Pseudo-selector Class Names**

<div
style={{
display: 'grid',
gridTemplateColumns: '1fr 1fr',
gap: '2rem',
marginBottom: '2rem',
alignItems: 'start',
}}
>
<ExampleGrid>
<div>
```tsx
<Box _hover={{ bg: 'red' }} />
Expand All @@ -123,19 +101,11 @@ Class name generation follows these steps:
{/* .g:hover { background: red; } */}
```
</div>
</div>
</ExampleGrid>

### **File-specific Class Names**

<div
style={{
display: 'grid',
gridTemplateColumns: '1fr 1fr',
gap: '2rem',
marginBottom: '2rem',
alignItems: 'start',
}}
>
<ExampleGrid>
<div>
```tsx
<div>
Expand All @@ -152,7 +122,7 @@ Class name generation follows these steps:
</div>
```
</div>
</div>
</ExampleGrid>

## Ad-blocker Compatibility

Expand Down
14 changes: 14 additions & 0 deletions apps/landing/src/components/mdx/components/ExampleGrid.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Grid } from '@devup-ui/react'
import { ReactNode } from 'react'

interface ExampleGridProps {
children: ReactNode
}

export function ExampleGrid({ children }: ExampleGridProps) {
return (
<Grid gap="16px" gridTemplateColumns={['repeat(1, 1fr)', 'repeat(2, 1fr)']}>
{children}
</Grid>
)
}