Skip to content

Commit 76cfe0a

Browse files
committed
Fixed and reduced CSS for NavCode.vue
1 parent 24d79d6 commit 76cfe0a

File tree

2 files changed

+22
-62
lines changed

2 files changed

+22
-62
lines changed

src/components/CodeBlock.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ div[class*='language-']::before,
139139
.line-numbers {
140140
position: relative;
141141
font-size: var(--code-font-size);
142+
-webkit-user-select: none;
142143
user-select: none;
143144
}
144145

src/components/NavCode.vue

Lines changed: 21 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
>
99
<div>
1010
<!-- Icon like in GH -->
11-
<span id="topline">
11+
<span class="topline">
1212
<svg
1313
aria-hidden="true"
1414
height="16"
@@ -23,7 +23,7 @@
2323
</svg>
2424
</span>
2525
<span id="code">Code</span>
26-
<span id="arrow-drop-down">
26+
<span class="topline">
2727
<svg
2828
aria-hidden="true"
2929
height="16"
@@ -64,11 +64,11 @@
6464
@click="copyURL"
6565
id="text-box"
6666
>
67-
<span class="material-icons" id="copy-button">content_copy </span>
67+
<span class="material-icons copy-button">content_copy </span>
6868
</button>
6969
</div>
7070
<span class="copy-notification">Copied!</span>
71-
<p id="wget-text">Use wget or paste the link in your browser.</p>
71+
<p class="wget-text">Use wget or paste the link in your browser.</p>
7272
<hr class="solid" />
7373
</div>
7474
<NavDownload @showDownloadMsg="DownloadMsg" />
@@ -200,17 +200,12 @@ export default {
200200
<!-- Add "scoped" attribute to limit CSS to this component only -->
201201
<style scoped>
202202
/* Adjusting the top Code button */
203-
#topline {
203+
.topline {
204204
vertical-align: middle;
205205
}
206206

207207
#code {
208208
font-size: 1rem;
209-
vertical-align: unset;
210-
}
211-
212-
#arrow-drop-down {
213-
vertical-align: middle;
214209
}
215210

216211
.download-button {
@@ -237,14 +232,6 @@ export default {
237232
color: white;
238233
text-align: center;
239234
}
240-
241-
/* The container <div> - needed to position the dropdown content */
242-
.dropdown {
243-
position: relative;
244-
display: inline-block;
245-
text-align: center;
246-
}
247-
248235
/* Dropdown Content (Hidden by Default) */
249236
.dropdown-content {
250237
display: none;
@@ -257,22 +244,7 @@ export default {
257244
text-align: center; /* Center-align the dropdown content */
258245
border: 1px solid var(--c-brand-red);
259246
border-radius: 3%;
260-
}
261-
262-
/* Links inside the dropdown */
263-
.dropdown-content a {
264-
color: black;
265-
padding: 12px 16px;
266-
text-decoration: none;
267-
display: block;
268-
border: var(--c-brand-red);
269-
text-align: center; /* Center-align the dropdown links */
270-
}
271-
272-
/* Change color of dropdown links on hover */
273-
.dropdown-content a:hover {
274-
background-color: var(--c-brand-red);
275-
color: var(--c-white-light);
247+
text-align: -webkit-center;
276248
}
277249

278250
/* Show the dropdown menu on hover */
@@ -286,17 +258,17 @@ export default {
286258
}
287259

288260
.text-input-group {
289-
margin-top: 4vh;
290-
text-align: -webkit-center;
261+
margin-top: 2vh;
291262
}
292263

293264
.copy-link {
294265
--height: 1.6rem;
295266
display: flex;
296-
max-width: 250px;
267+
max-width: 50vw;
297268
font-size: 80%;
298-
margin-top: 1%;
269+
margin-top: 8%;
299270
align-self: center;
271+
margin-left: 1.1vw;
300272
}
301273
.generate {
302274
background-color: #ffffff;
@@ -334,17 +306,12 @@ export default {
334306
}
335307

336308
.copy-link-button {
337-
flex-shrink: 0;
338309
width: 2rem;
339310
height: 8%;
340311
display: flex;
341-
align-items: center;
342-
justify-content: center;
343312
background: #dddddd;
344313
color: #333333;
345-
outline: none;
346314
border: 1px solid var(--c-brand-red);
347-
cursor: pointer;
348315
font-size: 50%;
349316
}
350317

@@ -366,6 +333,17 @@ export default {
366333
display: block;
367334
z-index: 10;
368335
}
336+
.copy-button {
337+
font-size: 1rem;
338+
}
339+
.wget-text {
340+
font-size: 0.6em;
341+
}
342+
343+
/* Solid border */
344+
hr.solid {
345+
border-top: 1px solid var(--c-brand-red);
346+
}
369347

370348
.download-success {
371349
position: fixed;
@@ -399,23 +377,4 @@ export default {
399377
margin: 0;
400378
color: var(--c-brand-red);
401379
}
402-
403-
@media screen and (max-width: 768px) {
404-
.dropdown-content {
405-
min-width: 100%; /* Make the dropdown menu full width on smaller screens */
406-
}
407-
}
408-
409-
/* Solid border */
410-
hr.solid {
411-
border-top: 1px solid var(--c-brand-red);
412-
}
413-
414-
#wget-text {
415-
font-size: 0.6em;
416-
text-align: left;
417-
}
418-
#copy-button {
419-
font-size: 1rem;
420-
}
421380
</style>

0 commit comments

Comments
 (0)