Skip to content

Commit

Permalink
fix(Section): fix section separator (#1039)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lisa18289 authored Dec 4, 2024
1 parent 44d36f9 commit a94eca5
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
row-gap: var(--section--content-to-content-spacing);
container-type: inline-size;

+ &:not(.hideSeparator) .section {
+ .section {
margin-block-start: var(--section--section-to-section-spacing);
}

&:not(.hideSeparator) + .section {
border-block-start-width: var(--section--border-width);
border-block-start-style: var(--section--border-style);
border-block-start-color: var(--section--border-color);
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/Section/Section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const Section = flowComponent("Section", (props) => {
const rootClassName = clsx(
styles.section,
className,
styles.hideSeparator && hideSeparator,
hideSeparator && styles.hideSeparator,
);

const headingId = useId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,31 @@ export const WithSubHeadings: Story = {
</>
),
};

export const HideSeperator: Story = {
render: (props) => (
<>
<Section {...props} hideSeparator>
<Heading>
<IconMember />
Personal Information
</Heading>
<TextField isRequired defaultValue="John">
<Label>First name</Label>
</TextField>
<TextField isRequired defaultValue="Doe">
<Label>Last name</Label>
</TextField>
</Section>
<Section {...props}>
<Heading>Newsletter</Heading>
<Text>
Upcoming releases, new features and tips about your hosting - we bring
you the most important information in your inbox. Subscribe to our
newsletter and stay up to date.
</Text>
<Link href="#">Subscribe</Link>
</Section>
</>
),
};

0 comments on commit a94eca5

Please sign in to comment.