import { css } from "./styled-system/css";
import { circle, stack } from "./styled-system/patterns";
function App() {
return (
<div className={stack({ direction: "row", p: "4" })}>
<div className={circle({ size: "5rem", overflow: "hidden" })}>
<img src="https://via.placeholder.com/150" alt="avatar" />
</div>
<div className={css({ mt: "4", fontSize: "xl", fontWeight: "semibold" })}>
John Doe
</div>
<div className={css({ mt: "2", fontSize: "sm", color: "gray.600" })}>
john@doe.com
</div>
</div>
);
}
import { Box, Stack, Circle } from './styled-system/jsx'
function App() {
return (
<Stack direction="row" p="4" rounded="md" shadow="lg" bg="white">
<Circle size="5rem" overflow="hidden">
<img src="https://via.placeholder.com/150" alt="avatar" />
</Circle>
<Box mt="4" fontSize="xl" fontWeight="semibold">
John Doe
</Box>
<Box mt="2" fontSize="sm" color="gray.600">
john@doe.com
</Box>
</Stack>
)
}
import { styled } from './styled-system/jsx'
import { cva } from './styled-system/css'
export const badge = cva({
base: {
fontWeight: 'medium',
borderRadius: 'md',
},
variants: {
status: {
default: {
color: 'white',
bg: 'gray.500',
},
success: {
color: 'white',
bg: 'green.500',
},
},
}
})
export const Badge = styled('span', badge)
Panda Mastery - Created by the Panda team
@layer reset, base, tokens, recipes, utilities;
@layer utilities {
.d_flex {
display: flex;
}
.flex_row {
flex-direction: row;
}
.mt_2 {
margin-top: var(--space-2);
}
.fs_sm {
font-size: var(--fontSizes-sm);
}
.color_gray.600 {
color: var(--color-gray-600);
}
}
const theme = {
tokens: {
colors: {
primary: { value: '#0FEE0F' },
secondary: { value: '#EE0F0F' }
},
fonts: {
body: { value: 'system-ui, sans-serif' }
},
sizes: {
small: { value: '12px' },
medium: { value: '16px' },
large: { value: '24px' }
}
}
}
const theme = {
semanticTokens: {
colors: {
danger: {
value: { base: '{colors.red.500}', _dark: '{colors.red.200}' }
},
success: {
value: { base: '{colors.green.500}', _dark: '{colors.green.300}' }
},
muted:{
value: { base: '{colors.gray.500}', _dark: '{colors.gray.300}' }
},
canvas: { value : '{colors.white}' }
}
}
}
export const badge = cva({
base: {
fontWeight: 'medium',
px: '3',
rounded: 'md',
},
variants: {
status: {
default: {
color: 'white',
bg: 'gray.500',
},
success: {
color: 'white',
bg: 'green.500',
},
warning: {
color: 'white',
bg: 'yellow.500',
},
},
},
defaultVariants: {
status: 'default',
},
})
$
npm i -D @pandacss/dev$
npx panda init --postcss$
npm run dev