[Accessibility] Fix heading level gaps (#39149)
This commit is contained in:
parent
28849e433a
commit
6a4d14b178
@ -556,7 +556,7 @@ class Status extends ImmutablePureComponent {
|
|||||||
).find((item) => compareUrls(item.get('url'), cardUrl));
|
).find((item) => compareUrls(item.get('url'), cardUrl));
|
||||||
|
|
||||||
if (taggedCollection) {
|
if (taggedCollection) {
|
||||||
media = <CollectionPreviewCard collection={taggedCollection.toJS()} />;
|
media = <CollectionPreviewCard collection={taggedCollection.toJS()} headingLevel='h2' />;
|
||||||
} else {
|
} else {
|
||||||
media = (
|
media = (
|
||||||
<Card
|
<Card
|
||||||
@ -570,7 +570,7 @@ class Status extends ImmutablePureComponent {
|
|||||||
const firstLinkedCollection = status.get('tagged_collections').first();
|
const firstLinkedCollection = status.get('tagged_collections').first();
|
||||||
if (firstLinkedCollection) {
|
if (firstLinkedCollection) {
|
||||||
media = (
|
media = (
|
||||||
<CollectionPreviewCard collection={firstLinkedCollection.toJS()} />
|
<CollectionPreviewCard collection={firstLinkedCollection.toJS()} headingLevel='h2' />
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,6 +18,7 @@ import { LinkFooter} from 'mastodon/features/ui/components/link_footer';
|
|||||||
|
|
||||||
import { Section } from './components/section';
|
import { Section } from './components/section';
|
||||||
import { RulesSection } from './components/rules';
|
import { RulesSection } from './components/rules';
|
||||||
|
import { getColumnSkipLinkId } from '../ui/components/skip_links';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
title: { id: 'column.about', defaultMessage: 'About' },
|
title: { id: 'column.about', defaultMessage: 'About' },
|
||||||
@ -80,7 +81,7 @@ class About extends PureComponent {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Column bindToDocument={!multiColumn} label={intl.formatMessage(messages.title)}>
|
<Column bindToDocument={!multiColumn} label={intl.formatMessage(messages.title)}>
|
||||||
<div className='scrollable about'>
|
<div className='scrollable about' id={getColumnSkipLinkId(1)}>
|
||||||
<div className='about__header'>
|
<div className='about__header'>
|
||||||
<ServerHeroImage
|
<ServerHeroImage
|
||||||
withAltBadge
|
withAltBadge
|
||||||
|
|||||||
@ -47,6 +47,7 @@ export interface CollectionLockupProps {
|
|||||||
withTimestamp?: boolean;
|
withTimestamp?: boolean;
|
||||||
sideContent?: React.ReactNode;
|
sideContent?: React.ReactNode;
|
||||||
className?: string;
|
className?: string;
|
||||||
|
headingLevel?: 'h2' | 'h3' | 'h4';
|
||||||
}
|
}
|
||||||
|
|
||||||
export const CollectionLockup: React.FC<CollectionLockupProps> = ({
|
export const CollectionLockup: React.FC<CollectionLockupProps> = ({
|
||||||
@ -54,6 +55,7 @@ export const CollectionLockup: React.FC<CollectionLockupProps> = ({
|
|||||||
withAuthorHandle = true,
|
withAuthorHandle = true,
|
||||||
withTimestamp,
|
withTimestamp,
|
||||||
sideContent,
|
sideContent,
|
||||||
|
headingLevel = 'h3',
|
||||||
className,
|
className,
|
||||||
}) => {
|
}) => {
|
||||||
const { id, name } = collection;
|
const { id, name } = collection;
|
||||||
@ -70,7 +72,7 @@ export const CollectionLockup: React.FC<CollectionLockupProps> = ({
|
|||||||
sideContent={sideContent}
|
sideContent={sideContent}
|
||||||
>
|
>
|
||||||
<ListItemLink
|
<ListItemLink
|
||||||
as='h3'
|
as={headingLevel}
|
||||||
to={getCollectionPath(id)}
|
to={getCollectionPath(id)}
|
||||||
subtitle={
|
subtitle={
|
||||||
<CollectionInfo
|
<CollectionInfo
|
||||||
|
|||||||
@ -92,7 +92,7 @@ export const CollectionShareModal: React.FC<{
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<div className={classes.preview}>
|
<div className={classes.preview}>
|
||||||
<CollectionPreviewCard collection={collection} />
|
<CollectionPreviewCard collection={collection} headingLevel='h2' />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<CopyLinkField
|
<CopyLinkField
|
||||||
|
|||||||
@ -212,12 +212,12 @@ export const InlineFollowSuggestions: React.FC<{ hidden?: boolean }> = ({
|
|||||||
tabIndex={-1}
|
tabIndex={-1}
|
||||||
>
|
>
|
||||||
<div className='inline-follow-suggestions__header'>
|
<div className='inline-follow-suggestions__header'>
|
||||||
<h3 id={uniqueId}>
|
<h2 id={uniqueId} className='inline-follow-suggestions__title'>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='follow_suggestions.who_to_follow'
|
id='follow_suggestions.who_to_follow'
|
||||||
defaultMessage='Who to follow'
|
defaultMessage='Who to follow'
|
||||||
/>
|
/>
|
||||||
</h3>
|
</h2>
|
||||||
|
|
||||||
<div className='inline-follow-suggestions__header__actions'>
|
<div className='inline-follow-suggestions__header__actions'>
|
||||||
<button className='link-button' onClick={handleDismiss} type='button'>
|
<button className='link-button' onClick={handleDismiss} type='button'>
|
||||||
|
|||||||
@ -37,21 +37,21 @@ export const Trends: React.FC = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='navigation-panel__portal'>
|
<aside className='navigation-panel__portal'>
|
||||||
<div className='getting-started__trends'>
|
<div className='getting-started__trends'>
|
||||||
<h4>
|
<h2 className='getting-started__trends-heading'>
|
||||||
<Link to={'/explore/tags'}>
|
<Link to={'/explore/tags'}>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='trends.trending_now'
|
id='trends.trending_now'
|
||||||
defaultMessage='Trending now'
|
defaultMessage='Trending now'
|
||||||
/>
|
/>
|
||||||
</Link>
|
</Link>
|
||||||
</h4>
|
</h2>
|
||||||
|
|
||||||
{trends.take(4).map((hashtag) => (
|
{trends.take(4).map((hashtag) => (
|
||||||
<Hashtag key={hashtag.get('name') as string} hashtag={hashtag} />
|
<Hashtag key={hashtag.get('name') as string} hashtag={hashtag} />
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</aside>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -106,10 +106,10 @@ export const NotificationAdminReport: React.FC<{
|
|||||||
|
|
||||||
<div className='notification-group__main'>
|
<div className='notification-group__main'>
|
||||||
<div className='notification-group__main__header'>
|
<div className='notification-group__main__header'>
|
||||||
<div className='notification-group__main__header__label'>
|
<h2 className='notification-group__main__header__label'>
|
||||||
{message}
|
{message}
|
||||||
<RelativeTimestamp timestamp={report.created_at} />
|
<RelativeTimestamp timestamp={report.created_at} />
|
||||||
</div>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{report.comment.length > 0 && (
|
{report.comment.length > 0 && (
|
||||||
|
|||||||
@ -46,7 +46,7 @@ export const NotificationCollection: React.FC<{
|
|||||||
|
|
||||||
<div className='notification-group__main'>
|
<div className='notification-group__main'>
|
||||||
<div className='notification-group__main__header'>
|
<div className='notification-group__main__header'>
|
||||||
<div className='notification-group__main__header__label'>
|
<h2 className='notification-group__main__header__label'>
|
||||||
{type === 'added_to_collection' && (
|
{type === 'added_to_collection' && (
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='notification.added_to_collection'
|
id='notification.added_to_collection'
|
||||||
@ -79,7 +79,7 @@ export const NotificationCollection: React.FC<{
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<CollectionPreviewCard collection={collection} />
|
<CollectionPreviewCard collection={collection} />
|
||||||
|
|||||||
@ -125,7 +125,7 @@ export const NotificationGroupWithStatus: React.FC<{
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='notification-group__main__header__label'>
|
<h2 className='notification-group__main__header__label'>
|
||||||
<span>{label}</span>
|
<span>{label}</span>
|
||||||
{timestamp && (
|
{timestamp && (
|
||||||
<>
|
<>
|
||||||
@ -135,7 +135,7 @@ export const NotificationGroupWithStatus: React.FC<{
|
|||||||
<RelativeTimestamp timestamp={timestamp} />
|
<RelativeTimestamp timestamp={timestamp} />
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{statusId && (
|
{statusId && (
|
||||||
|
|||||||
@ -101,12 +101,12 @@ export const NotificationWithStatus: React.FC<{
|
|||||||
)}
|
)}
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
>
|
>
|
||||||
<div className='notification-ungrouped__header'>
|
<h2 className='notification-ungrouped__header'>
|
||||||
<div className='notification-ungrouped__header__icon'>
|
<div className='notification-ungrouped__header__icon'>
|
||||||
<Icon icon={icon} id={iconId} />
|
<Icon icon={icon} id={iconId} />
|
||||||
</div>
|
</div>
|
||||||
<span>{label}</span>
|
<span>{label}</span>
|
||||||
</div>
|
</h2>
|
||||||
|
|
||||||
<StatusQuoteManager
|
<StatusQuoteManager
|
||||||
id={statusId}
|
id={statusId}
|
||||||
|
|||||||
@ -272,7 +272,12 @@ export const DetailedStatus: React.FC<{
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (taggedCollection) {
|
if (taggedCollection) {
|
||||||
media = <CollectionPreviewCard collection={taggedCollection.toJS()} />;
|
media = (
|
||||||
|
<CollectionPreviewCard
|
||||||
|
collection={taggedCollection.toJS()}
|
||||||
|
headingLevel='h2'
|
||||||
|
/>
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
media = (
|
media = (
|
||||||
<Card
|
<Card
|
||||||
@ -286,7 +291,10 @@ export const DetailedStatus: React.FC<{
|
|||||||
const firstLinkedCollection = status.get('tagged_collections').first();
|
const firstLinkedCollection = status.get('tagged_collections').first();
|
||||||
if (firstLinkedCollection) {
|
if (firstLinkedCollection) {
|
||||||
media = (
|
media = (
|
||||||
<CollectionPreviewCard collection={firstLinkedCollection.toJS()} />
|
<CollectionPreviewCard
|
||||||
|
collection={firstLinkedCollection.toJS()}
|
||||||
|
headingLevel='h2'
|
||||||
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3764,16 +3764,6 @@ a.account__display-name {
|
|||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.getting-started__trends h4 {
|
|
||||||
padding: 10px 12px;
|
|
||||||
padding-inline-start: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.getting-started__trends .trends__item {
|
|
||||||
padding: 10px 12px;
|
|
||||||
padding-inline-start: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media screen and (height <= 930px) {
|
@media screen and (height <= 930px) {
|
||||||
&__portal .trends__item:nth-child(n + 5) {
|
&__portal .trends__item:nth-child(n + 5) {
|
||||||
display: none;
|
display: none;
|
||||||
@ -4140,25 +4130,30 @@ a.account__display-name {
|
|||||||
border: 1px solid var(--color-border-primary);
|
border: 1px solid var(--color-border-primary);
|
||||||
border-top: 0;
|
border-top: 0;
|
||||||
|
|
||||||
|
&__trends-heading {
|
||||||
|
border-bottom: 1px solid var(--color-border-primary);
|
||||||
|
padding: 10px;
|
||||||
|
font-size: 12px;
|
||||||
|
text-transform: uppercase;
|
||||||
|
font-weight: 500;
|
||||||
|
|
||||||
|
.navigation-panel & {
|
||||||
|
padding: 10px 12px;
|
||||||
|
padding-inline-start: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: var(--color-text-secondary);
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&__trends {
|
&__trends {
|
||||||
flex: 0 1 auto;
|
flex: 0 1 auto;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
animation: fade 150ms linear;
|
animation: fade 150ms linear;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
|
|
||||||
h4 {
|
|
||||||
border-bottom: 1px solid var(--color-border-primary);
|
|
||||||
padding: 10px;
|
|
||||||
font-size: 12px;
|
|
||||||
text-transform: uppercase;
|
|
||||||
font-weight: 500;
|
|
||||||
|
|
||||||
a {
|
|
||||||
color: var(--color-text-secondary);
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.trends__item {
|
.trends__item {
|
||||||
border-bottom: 0;
|
border-bottom: 0;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
@ -4166,6 +4161,11 @@ a.account__display-name {
|
|||||||
&__current {
|
&__current {
|
||||||
color: var(--color-text-secondary);
|
color: var(--color-text-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.navigation-panel & {
|
||||||
|
padding: 10px 12px;
|
||||||
|
padding-inline-start: 16px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -10077,18 +10077,18 @@ noscript {
|
|||||||
background: var(--color-bg-brand-softest);
|
background: var(--color-bg-brand-softest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__title {
|
||||||
|
font-size: 15px;
|
||||||
|
line-height: 22px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
&__header {
|
&__header {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 0 16px;
|
padding: 0 16px;
|
||||||
|
|
||||||
h3 {
|
|
||||||
font-size: 15px;
|
|
||||||
line-height: 22px;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__actions {
|
&__actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user