Skip to content

Commit 42e19b5

Browse files
authored
Merge pull request #315 from HackTricks-wiki/refine-hovered-sponsor-layout-20260624173941
Refine hovered sponsor layout
2 parents 8e4b5d5 + da81c92 commit 42e19b5

2 files changed

Lines changed: 24 additions & 23 deletions

File tree

theme/pagetoc.css

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@
106106
overflow: auto;
107107
display: flex;
108108
flex-direction: column;
109-
gap:20px;
109+
gap:14px;
110110
background-color: transparent;
111111
}
112112
.pagetoc {
113-
max-height: 60%;
113+
max-height: 48%;
114114
overflow: auto;
115115
border-left: 1px solid color-mix(in srgb, var(--table-border-color) 70%, transparent);
116116
border-radius: 12px;
@@ -119,8 +119,8 @@
119119
padding: 4px 4px;
120120
}
121121
.sidesponsor {
122-
max-height: 40%;
123-
height: 40%;
122+
max-height: 52%;
123+
height: 52%;
124124
background-color: transparent;
125125
border: 1px solid color-mix(in srgb, var(--table-border-color) 70%, transparent);
126126
border-radius: 8px;
@@ -132,12 +132,12 @@
132132
backdrop-filter: blur(6px);
133133
}
134134
.sidesponsor img {
135-
height: 45%;
136-
max-height: 150px;
137-
min-height: 95px;
135+
height: 50%;
136+
max-height: 180px;
137+
min-height: 110px;
138138
width: auto;
139-
max-width: 78%;
140-
padding: 10px;
139+
max-width: 86%;
140+
padding: 8px;
141141
object-fit: contain;
142142
align-self: center;
143143
flex: 0 0 auto;
@@ -149,20 +149,20 @@
149149
width: 42px;
150150
padding: 4px;
151151
grid-area: sponsor-image;
152-
align-self: start;
152+
align-self: center;
153153
transition-duration: 0s;
154154
}
155155
.sidesponsor:hover {
156156
display: grid !important;
157157
grid-template-columns: auto minmax(0, 1fr);
158-
grid-template-rows: max-content minmax(0, 1fr) max-content;
158+
grid-template-rows: max-content minmax(0, 1fr) auto;
159159
grid-template-areas:
160160
"sponsor-image sponsor-title"
161161
"sponsor-description sponsor-description"
162162
"sponsor-cta sponsor-cta";
163163
column-gap: 8px;
164-
row-gap: 8px;
165-
align-items: start;
164+
row-gap: 10px;
165+
align-items: center;
166166
align-content: start;
167167
overflow: hidden;
168168
}
@@ -172,8 +172,8 @@
172172
margin-left: 15px;
173173
margin-right: 15px;
174174
font-weight: 800;
175-
font-size: var(--sponsor-title-font-size, clamp(1.28rem, 7.2cqw, 1.75rem));
176-
line-height: 1.08;
175+
font-size: var(--sponsor-title-font-size, clamp(1.45rem, 7.8cqw, 2rem));
176+
line-height: 1.05;
177177
color: var(--sponsor-fg);
178178
overflow-wrap: anywhere;
179179
text-align: center;
@@ -185,11 +185,12 @@
185185
.sidesponsor:hover .sponsor-title{
186186
grid-area: sponsor-title;
187187
margin-left: 0;
188-
margin-top: 6px;
188+
margin-top: 0;
189189
margin-bottom: 0;
190190
font-size: 1.55rem;
191191
line-height: 1.15;
192192
overflow-wrap: anywhere;
193+
align-self: center;
193194
}
194195
.sidesponsor .sponsor-description{
195196
display: block;
@@ -234,9 +235,9 @@
234235
}
235236
.sidesponsor:hover .sponsor-cta{
236237
grid-area: sponsor-cta;
237-
margin-top: 0;
238-
margin-bottom: 4px;
239-
padding: 10px 14px;
238+
margin-top: 22px;
239+
margin-bottom: 8px;
240+
padding: 9px 14px;
240241
box-sizing: border-box;
241242
max-width: 100%;
242243
overflow: hidden;
@@ -260,8 +261,8 @@
260261
}
261262
}
262263
.sidesponsor-bsa {
263-
max-height: 40%;
264-
height: 40%;
264+
max-height: 52%;
265+
height: 52%;
265266
background-color: transparent;
266267
border: 1px solid color-mix(in srgb, var(--table-border-color) 70%, transparent);
267268
border-radius: 8px;

theme/sponsor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@
9797

9898
function getSponsorTitleFontSize(title) {
9999
if (title.length > 45) {
100-
return "1.25rem"
100+
return "1.35rem"
101101
}
102102

103103
if (title.length > 28) {
104-
return "1.35rem"
104+
return "1.55rem"
105105
}
106106

107107
return ""

0 commit comments

Comments
 (0)