Skip to content

Commit 58b7520

Browse files
authored
Fix various aspects of OTel survey banner styling / display (#2641)
* Fix various aspects of OTel survey banner styling / display * Remove spurious margins to vertically center the banner text * Use less in-your-face background color for banner * Use icon instead of literal "X" for close button * Don't show the banner on every docs page, only on the homepage * Keep banner hidden via localStorage once it's dismissed once * Remove italic style from link (italic usually just makes things harder to read) Signed-off-by: Julius Volz <[email protected]> * Move banner back to every page Signed-off-by: Julius Volz <[email protected]> --------- Signed-off-by: Julius Volz <[email protected]>
1 parent 24c348b commit 58b7520

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

content/css/docs.css

+2-4
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ body {
7979
}
8080

8181
.banner {
82-
background-color: #ffc107;
83-
text-align: center;
82+
background-color: rgb(252, 232, 170);
8483
width: 100%;
8584
display: flex;
8685
gap: 32px;
@@ -100,12 +99,11 @@ body {
10099

101100
.banner a {
102101
text-decoration: underline;
103-
font-style: italic;
104102
}
105103

106104
.banner h3 {
105+
margin: 1.2em 0;
107106
font-size: 16px;
108-
font-weight: 600;
109107
font-family: Lato, sans-serif;
110108
}
111109

layouts/banner.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<div class="container banner" id="banner">
2-
<h3>We are doing a <a href="https://forms.gle/TomwH6tFGecZCUNy9" target="_blank">survey</a> about OTLP Resource Attributes in Prometheus, please participate!
2+
<h3>We are doing a <a href="https://forms.gle/TomwH6tFGecZCUNy9" target="_blank">survey</a> about OTLP Resource
3+
Attributes in Prometheus, please participate!
34
</h3>
4-
<button type="button" aria-label="Close" onclick="hideBanner()">X</button>
5+
<button type="button" aria-label="Close" onclick="hideBanner()"><i class="ti ti-x"></i></button>
56
</div>

layouts/footer.html

+5
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
if (banner) {
2525
banner.style.display = 'none';
2626
}
27+
localStorage.setItem("hide-banner", "true");
28+
}
29+
30+
if (localStorage.getItem("hide-banner") === "true") {
31+
hideBanner();
2732
}
2833
</script>
2934
</body>

0 commit comments

Comments
 (0)