Skip to content

Commit 0767804

Browse files
committed
Add tooltips to tier badges
Use the existing ff-tooltip CSS system (data-tooltip attribute) to show pricing tier availability on hover, e.g. "Available on FlowFuse Cloud: Enterprise". Includes smaller font size, tighter padding, and a 0.5s delay before showing. Applies to badges rendered via both the Eleventy transform and the Nunjucks template.
1 parent 080ece8 commit 0767804

3 files changed

Lines changed: 16 additions & 4 deletions

File tree

.eleventy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -738,13 +738,13 @@ module.exports = function(eleventyConfig) {
738738
if (!showCloud && !showSelfHosted) return '';
739739
let html = `<div class="ff-tier-badges">`;
740740
if (showCloud) {
741-
html += `<div class="ff-tier-badge ff-tier--available">`;
741+
html += `<div class="ff-tier-badge ff-tier--available ff-tooltip" data-tooltip="Available on FlowFuse Cloud: ${cloudLabel}">`;
742742
html += `<span class="ff-tier-badge__label">Cloud</span>`;
743743
html += `<span class="ff-tier-badge__value">${cloudLabel}</span>`;
744744
html += `</div>`;
745745
}
746746
if (showSelfHosted) {
747-
html += `<div class="ff-tier-badge ff-tier--available">`;
747+
html += `<div class="ff-tier-badge ff-tier--available ff-tooltip" data-tooltip="Available on FlowFuse Self-Hosted: ${selfHostedLabel}">`;
748748
html += `<span class="ff-tier-badge__label">Self-Hosted</span>`;
749749
html += `<span class="ff-tier-badge__value">${selfHostedLabel}</span>`;
750750
html += `</div>`;

src/_includes/components/tier-badges.njk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
{% if showTierCloud or showTierSelfHosted %}
44
<div class="ff-tier-badges">
55
{% if showTierCloud %}
6-
<div class="ff-tier-badge ff-tier--available">
6+
<div class="ff-tier-badge ff-tier--available ff-tooltip" data-tooltip="Available on FlowFuse Cloud: {{ tierCloud }}">
77
<span class="ff-tier-badge__label">Cloud</span>
88
<span class="ff-tier-badge__value">{{ tierCloud }}</span>
99
</div>
1010
{% endif %}
1111
{% if showTierSelfHosted %}
12-
<div class="ff-tier-badge ff-tier--available">
12+
<div class="ff-tier-badge ff-tier--available ff-tooltip" data-tooltip="Available on FlowFuse Self-Hosted: {{ tierSelfHosted }}">
1313
<span class="ff-tier-badge__label">Self-Hosted</span>
1414
<span class="ff-tier-badge__value">{{ tierSelfHosted }}</span>
1515
</div>

src/css/style.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1674,6 +1674,18 @@ h4:hover .header-anchor::before {
16741674
line-height: 1rem;
16751675
}
16761676

1677+
.ff-tier-badge.ff-tooltip:hover:after,
1678+
.ff-tier-badge.ff-tooltip:hover:before {
1679+
transition-delay: 0.5s;
1680+
}
1681+
1682+
.ff-tier-badge.ff-tooltip:hover:after {
1683+
font-size: 0.75rem;
1684+
min-width: auto;
1685+
white-space: nowrap;
1686+
padding: 4px 8px;
1687+
}
1688+
16771689
.ff-tier-badge__label {
16781690
@apply px-2.5 py-0.5 text-gray-500 font-medium bg-gray-100 border border-r-0 border-gray-200 rounded-l;
16791691
}

0 commit comments

Comments
 (0)