Skip to content

Commit e2cbae5

Browse files
committed
Align applies-item styling with tab-item
1 parent 1bef5b4 commit e2cbae5

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

src/Elastic.Documentation.Site/Assets/markdown/applies-switch.css

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,24 @@
1212
@apply bg-grey-10 border-b-1 border-b-black text-black;
1313
}
1414
}
15-
16-
.applicable-info {
17-
@apply cursor-pointer!;
15+
16+
.applies-item {
17+
@apply cursor-pointer text-inherit;
18+
19+
&:hover {
20+
@apply text-inherit;
21+
}
22+
.applicable-info {
23+
@apply cursor-pointer border-none bg-transparent p-0;
24+
25+
&:not(:last-child):after {
26+
content: ',';
27+
}
28+
}
29+
.applicable-name,
30+
.applicable-meta {
31+
@apply text-base;
32+
}
1833
}
1934

2035
.applies-switch-input {

src/Elastic.Markdown/Myst/Components/ApplicableToComponent.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
@foreach (var item in Model.GetApplicabilityItems())
44
{
5-
<span class="applicable-info" data-tippy-content="@(new HtmlString(item.RenderData.TooltipText))">
5+
<span class="applicable-info" data-tippy-content="@(new HtmlString(Model.ShowTooltip ? item.RenderData.TooltipText : string.Empty))">
66
<span class="applicable-name">@item.Key</span>
77

88
@if (!string.IsNullOrEmpty(item.Key) && (item.RenderData.ShowLifecycleName || item.RenderData.ShowVersion || !string.IsNullOrEmpty(item.RenderData.BadgeLifecycleText)))

src/Elastic.Markdown/Myst/Components/ApplicableToViewModel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ public class ApplicableToViewModel
1313
private readonly ApplicabilityRenderer _applicabilityRenderer = new();
1414

1515
public required bool Inline { get; init; }
16+
17+
public bool ShowTooltip { get; init; } = true;
1618
public required ApplicableTo AppliesTo { get; init; }
1719
public required VersionsConfiguration VersionsConfig { get; init; }
1820

src/Elastic.Markdown/Myst/Directives/AppliesSwitch/AppliesItemView.cshtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
{
1717
AppliesTo = Model.AppliesTo,
1818
Inline = true,
19+
ShowTooltip = false,
1920
VersionsConfig = Model.BuildContext.VersionsConfiguration
2021
}))
2122
</span>

0 commit comments

Comments
 (0)