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: allow nesting sized containers #593

Open
wants to merge 1 commit into
base: main
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
31 changes: 31 additions & 0 deletions apps/playground/app/sink/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5893,6 +5893,37 @@ export default function Sink() {
</Flex>
</Flex>
</DocsSection>

<DocsSection title="Container">
<Text as="p" my="5">
<Code>size</Code> can be set on nested <Code>Container</Code> instances:
</Text>

<Container size="4">
<Box
style={{
backgroundColor: 'var(--color-panel-solid)',
borderRadius: 'var(--radius-2)',
boxShadow: 'inset 0 0 0 1px var(--gray-a4)',
}}
p="2"
>
<Text>This should be size 4</Text>
</Box>
<Container size="1">
<Box
style={{
backgroundColor: 'var(--color-panel-solid)',
borderRadius: 'var(--radius-2)',
boxShadow: 'inset 0 0 0 1px var(--gray-a4)',
}}
p="2"
>
<Text>This should be size 1</Text>
</Box>
</Container>
</Container>
</DocsSection>
</main>
</Box>
</div>
Expand Down
8 changes: 4 additions & 4 deletions packages/radix-ui-themes/src/components/container.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@

@breakpoints {
.rt-ContainerInner {
:where(.rt-Container.rt-r-size-1) & {
:where(.rt-Container.rt-r-size-1) > & {
max-width: var(--container-1);
}
:where(.rt-Container.rt-r-size-2) & {
:where(.rt-Container.rt-r-size-2) > & {
max-width: var(--container-2);
}
:where(.rt-Container.rt-r-size-3) & {
:where(.rt-Container.rt-r-size-3) > & {
max-width: var(--container-3);
}
:where(.rt-Container.rt-r-size-4) & {
:where(.rt-Container.rt-r-size-4) > & {
max-width: var(--container-4);
}
}
Expand Down