Skip to content

Commit ddc018d

Browse files
committed
style: Refactor tooltip styles
1 parent e3920cb commit ddc018d

2 files changed

Lines changed: 41 additions & 40 deletions

File tree

public/index.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,6 @@ <h2>Miscellaneous:</h2>
128128
<button class="data-button pointer" id="listModsButton" style="margin-top:3px; margin-left:0px;">List Mods</button>
129129
</div>
130130
</div>
131-
<div class="tooltip no-display" id="tooltip">
132-
<div class="tooltip-content">
133-
<p class="tooltip-name" id="tooltipName">Name</p>
134-
<p class="tooltip-price" id="tooltipPrice">Price</p>
135-
<p class="tooltip-description" id="tooltipDesc">Description</p> <!-- Hidden when buildings are hovered since they have no description -->
136-
<p class="tooltip-quote" id="tooltipQuote">"Quote"</p>
137-
<p class="tooltip-stats" id="tooltipProduces">Produces</p><!-- Hidden when upgrades are hovered since they have no produces/producing -->
138-
<p class="tooltip-stats" id="tooltipProducing">Producing</p>
139-
</div>
140-
</div>
141131
</div> <!-- end middle -->
142132
<div class="right-side" id="rightSide">
143133
<h1>Store</h1>
@@ -152,5 +142,15 @@ <h3>Buildings</h3>
152142

153143
</div>
154144
</div> <!-- end rightSide -->
145+
<div class="tooltip" id="tooltip" style="display: none;">
146+
<div class="tooltip-content">
147+
<p class="tooltip-name" id="tooltipName">Name</p>
148+
<p class="tooltip-price" id="tooltipPrice">Price</p>
149+
<p class="tooltip-description" id="tooltipDesc">Description</p> <!-- Hidden when buildings are hovered since they have no description -->
150+
<p class="tooltip-quote" id="tooltipQuote">"Quote"</p>
151+
<p class="tooltip-stats" id="tooltipProduces">Produces</p><!-- Hidden when upgrades are hovered since they have no produces/producing -->
152+
<p class="tooltip-stats" id="tooltipProducing">Producing</p>
153+
</div>
154+
</div>
155155
</body>
156156
</html>

src/scss/tooltip.scss

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,35 @@
1111
background-color: variables.$colored-container;
1212
color: black; // for children
1313
pointer-events: none; /* if it's hovered over it won't do the flickering thing */
14-
}
15-
.tooltip-content {
16-
padding: 0px 3px 0px 3px;
17-
}
18-
.tooltip-name {
19-
font-size: 15px;
20-
margin-top: 4px;
21-
margin-bottom: 0px;
22-
}
23-
.tooltip-price {
24-
position: absolute;
25-
font-size: 15px;
26-
right: 0px;
27-
top: 0px;
28-
margin-top: 4px;
29-
margin-right: 3px;
30-
}
31-
.tooltip-quote {
32-
font-size: 12px;
33-
margin-top: 5px;
34-
overflow-y: hidden;
35-
}
36-
.tooltip-description {
37-
font-size: 13px;
38-
margin-left: 1px;
39-
}
40-
.tooltip-stats {
41-
font-size: 14px;
42-
margin-top: 5px;
43-
margin-bottom: 0px;
14+
15+
.tooltip-content {
16+
padding: 0.25rem;
17+
18+
// todo 0.7.1: random margins
19+
.tooltip-name {
20+
font-size: 1rem;
21+
margin: 0;
22+
}
23+
.tooltip-price {
24+
position: absolute;
25+
font-size: 1rem;
26+
right: 0px;
27+
top: 0px;
28+
margin-top: 0.25rem;
29+
margin-right: 0.25rem;
30+
}
31+
.tooltip-quote {
32+
font-size: 0.75rem;
33+
margin-top: 5px;
34+
overflow-y: hidden;
35+
}
36+
.tooltip-description {
37+
font-size: 0.8rem;
38+
}
39+
.tooltip-stats {
40+
font-size: 0.8rem;
41+
margin-top: 5px;
42+
margin-bottom: 0px;
43+
}
44+
}
4445
}

0 commit comments

Comments
 (0)