Skip to content

Commit a9eaca4

Browse files
Tweak "Applicable Properties" appearance
1 parent c3f9284 commit a9eaca4

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

src/components/syntaxes/SyntaxBadge.astro

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ interface Props {
77
entries: {
88
text: string,
99
cardRef?: string,
10+
cardRefText?: string,
1011
}[],
1112
wrap?: boolean,
1213
description?: string,
@@ -17,15 +18,13 @@ const { badgeProps, entries, wrap, description }: Props = Astro.props;
1718

1819
<span class="prefix-badge" title={description}>
1920
<Badge {...badgeProps} class="cb"/>
20-
{entries.map(({ text, cardRef }, index) =>
21+
{entries.map(({ text, cardRef, cardRefText }, index) =>
2122
<>
22-
{wrap && <br>}
2323
{cardRef ? (
24-
<p>
25-
<a href=`#${cardRef}`>
26-
{text}
27-
</a>
28-
{index != entries.length - 1 && ', '}
24+
<p data-wrap={wrap}>
25+
<a href=`#${cardRef}`>{text}</a>
26+
{cardRefText}
27+
{!wrap && index != entries.length - 1 && ', '}
2928
</p>
3029
) : text}
3130
</>
@@ -36,9 +35,11 @@ const { badgeProps, entries, wrap, description }: Props = Astro.props;
3635
.prefix-badge:not(:last-of-type) {
3736
margin-bottom: 0.75em;
3837
}
39-
p {
38+
p:not([data-wrap="true"]) {
4039
display: inline-flex;
4140
align-items: center;
41+
}
42+
p {
4243
padding: 0;
4344
margin: 0;
4445

src/components/syntaxes/cards/TypeCard.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const { type, currentVersion }: Props = Astro.props;
2020
entries={type.properties
2121
.sort(((a, b) => a.property.name.localeCompare(b.property.name)))
2222
.map(property =>
23-
({text: `${property.property.name} (${property.description})`, cardRef: property.property.id})
23+
({text: property.property.name, cardRef: property.property.id, cardRefText: property.description})
2424
)
2525
}
2626
wrap={true}

0 commit comments

Comments
 (0)