Skip to content

Commit 5a418f3

Browse files
authored
Fix font & spaces in settings subsection (#28631)
* Fix settings header * Fix gap between subsection * Update tests * Update e2e tests * Update snapshots
1 parent db5b335 commit 5a418f3

File tree

13 files changed

+19
-18
lines changed

13 files changed

+19
-18
lines changed
-1.03 KB
Loading
-323 Bytes
Loading
-308 Bytes
Loading
-393 Bytes
Loading
-352 Bytes
Loading
-301 Bytes
Loading
-311 Bytes
Loading

res/css/components/views/settings/shared/_SettingsSubsection.pcss

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,16 @@ Please see LICENSE files in the repository root for full details.
1313
&.mx_SettingsSubsection_newUi {
1414
display: flex;
1515
flex-direction: column;
16-
gap: var(--cpd-space-8x);
16+
gap: var(--cpd-space-6x);
17+
}
18+
19+
*[role="separator"] {
20+
/**
21+
* The gap between subsections is 32px and inside the subsection is 24px.
22+
* The separator separates the subsections, so it should have the same gap as the subsections.
23+
* We add 12px and the separator spacing to the top margin to make the separator visually centered between the subsections.
24+
*/
25+
margin-top: calc(var(--cpd-space-3x) + var(--cpd-separator-spacing));
1726
}
1827
}
1928

src/components/views/settings/shared/SettingsSubsection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export const SettingsSubsection: React.FC<SettingsSubsectionProps> = ({
4545
mx_SettingsSubsection_newUi: !legacy,
4646
})}
4747
>
48-
{typeof heading === "string" ? <SettingsSubsectionHeading heading={heading} legacy={legacy} /> : <>{heading}</>}
48+
{typeof heading === "string" ? <SettingsSubsectionHeading heading={heading} /> : <>{heading}</>}
4949
{!!description && (
5050
<div className="mx_SettingsSubsection_description">
5151
<SettingsSubsectionText>{description}</SettingsSubsectionText>

src/components/views/settings/shared/SettingsSubsectionHeading.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,13 @@ import Heading from "../../typography/Heading";
1212

1313
export interface SettingsSubsectionHeadingProps extends HTMLAttributes<HTMLDivElement> {
1414
heading: string;
15-
legacy?: boolean;
1615
children?: React.ReactNode;
1716
}
1817

19-
export const SettingsSubsectionHeading: React.FC<SettingsSubsectionHeadingProps> = ({
20-
heading,
21-
legacy = true,
22-
children,
23-
...rest
24-
}) => {
25-
const size = legacy ? "4" : "3";
26-
18+
export const SettingsSubsectionHeading: React.FC<SettingsSubsectionHeadingProps> = ({ heading, children, ...rest }) => {
2719
return (
2820
<div {...rest} className="mx_SettingsSubsectionHeading">
29-
<Heading className="mx_SettingsSubsectionHeading_heading" size={size} as="h3">
21+
<Heading className="mx_SettingsSubsectionHeading_heading" size="4" as="h3">
3022
{heading}
3123
</Heading>
3224
{children}

0 commit comments

Comments
 (0)