Molbap HF Staff commited on
Commit
9b2eb8e
·
1 Parent(s): c4e70ae
Files changed (2) hide show
  1. src/transformers-custom.css +48 -33
  2. webpack.config.js +26 -7
src/transformers-custom.css CHANGED
@@ -75,9 +75,10 @@
75
  }
76
 
77
  .tenet-list li.tenet:hover {
78
- transform: translateY(-4px);
79
- box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
80
- border-color: rgba(0, 123, 255, 0.3);
 
81
  }
82
 
83
  /* Colorful numbering system */
@@ -262,38 +263,32 @@ img {
262
  margin: 1.5rem 0;
263
  }
264
 
265
- /* Table of contents styling - Fixed sidebar like ultrascale */
266
- d-contents {
267
- display: block !important;
268
- visibility: visible !important;
269
- opacity: 1 !important;
270
- }
271
-
272
  @media (min-width: 1200px) {
 
 
 
 
273
  d-contents {
274
- position: fixed !important;
275
- top: 0 !important;
276
- right: 0 !important;
277
- width: 280px !important;
278
- height: 100vh !important;
279
  background: white !important;
280
- border-left: 1px solid rgba(0, 0, 0, 0.1) !important;
281
- padding: 2rem 1.5rem !important;
 
 
 
 
 
282
  overflow-y: auto !important;
283
- z-index: 2000 !important;
284
- box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1) !important;
 
 
285
  display: block !important;
286
  visibility: visible !important;
287
- }
288
-
289
- /* Add margin to main content to avoid overlap */
290
- d-article {
291
- margin-right: 300px !important;
292
- }
293
-
294
- d-contents nav {
295
- position: sticky;
296
- top: 2rem;
297
  }
298
  }
299
 
@@ -442,11 +437,31 @@ d-contents nav a[title]:hover:before {
442
  }
443
  }
444
 
445
- /* Improve code syntax highlighting */
446
- .hljs {
447
  background: #f8f9fa !important;
448
- border-radius: 6px;
449
- padding: 1rem;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
450
  }
451
 
452
  /* Distill article improvements */
 
75
  }
76
 
77
  .tenet-list li.tenet:hover {
78
+ transform: translateY(-8px) scale(1.02);
79
+ box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
80
+ border-color: rgba(0, 123, 255, 0.5);
81
+ background: linear-gradient(135deg, #ffffff 0%, #f0f8ff 100%);
82
  }
83
 
84
  /* Colorful numbering system */
 
263
  margin: 1.5rem 0;
264
  }
265
 
266
+ /* Table of contents styling - Fixed top left like ultrascale */
 
 
 
 
 
 
267
  @media (min-width: 1200px) {
268
+ d-article {
269
+ overflow: visible;
270
+ }
271
+
272
  d-contents {
273
+ position: sticky !important;
274
+ top: 10px !important;
275
+ align-self: start !important;
 
 
276
  background: white !important;
277
+ grid-column-start: 1 !important;
278
+ grid-column-end: 4 !important;
279
+ grid-row: auto / span 6 !important;
280
+ justify-self: end !important;
281
+ margin-top: 0em !important;
282
+ padding-right: 3em !important;
283
+ padding-left: 2em !important;
284
  overflow-y: auto !important;
285
+ height: calc(100vh - 40px) !important;
286
+ scrollbar-width: none !important;
287
+ transition: max-height 0.3s ease-out !important;
288
+ z-index: -100 !important;
289
  display: block !important;
290
  visibility: visible !important;
291
+ border-right: 1px solid rgba(0, 0, 0, 0.1) !important;
 
 
 
 
 
 
 
 
 
292
  }
293
  }
294
 
 
437
  }
438
  }
439
 
440
+ /* Improve code syntax highlighting with Prism */
441
+ pre[class*="language-"] {
442
  background: #f8f9fa !important;
443
+ border: 1px solid #e9ecef !important;
444
+ border-radius: 8px !important;
445
+ padding: 1.5rem !important;
446
+ margin: 1.5rem 0 !important;
447
+ overflow-x: auto !important;
448
+ font-size: 0.9em !important;
449
+ line-height: 1.5 !important;
450
+ }
451
+
452
+ code[class*="language-"] {
453
+ background: none !important;
454
+ font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace !important;
455
+ color: #383a42 !important;
456
+ }
457
+
458
+ /* Inline code */
459
+ p code, li code {
460
+ background: #f1f3f4 !important;
461
+ padding: 0.2em 0.4em !important;
462
+ border-radius: 3px !important;
463
+ font-size: 0.9em !important;
464
+ color: #d73a49 !important;
465
  }
466
 
467
  /* Distill article improvements */
webpack.config.js CHANGED
@@ -185,11 +185,30 @@ module.exports = {
185
  }
186
  }
187
 
 
 
 
 
 
 
 
188
  // Try multiple times to ensure it runs after distill.js
189
- document.addEventListener('DOMContentLoaded', initializeTOC);
190
- setTimeout(initializeTOC, 100);
191
- setTimeout(initializeTOC, 500);
192
- setTimeout(initializeTOC, 1000);
 
 
 
 
 
 
 
 
 
 
 
 
193
  </script>`;
194
 
195
  // Create full HTML document with distill template
@@ -198,14 +217,14 @@ module.exports = {
198
  <head>
199
  <script src="distill.bundle.js" type="module" fetchpriority="high" blocking></script>
200
  <script src="main.bundle.js" type="module" fetchpriority="low" defer></script>
201
- <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
202
- <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/python.min.js"></script>
203
  <script src="https://d3js.org/d3.v7.min.js"></script>
204
  <meta name="viewport" content="width=device-width, initial-scale=1">
205
  <meta charset="utf8">
206
  <title>Transformers Feature Showcase</title>
207
  <link rel="stylesheet" href="style.css">
208
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/atom-one-light.min.css">
209
  </head>
210
  <body>
211
  <d-front-matter>
 
185
  }
186
  }
187
 
188
+ // Initialize Prism syntax highlighting
189
+ function initializeSyntaxHighlighting() {
190
+ if (typeof Prism !== 'undefined') {
191
+ Prism.highlightAll();
192
+ }
193
+ }
194
+
195
  // Try multiple times to ensure it runs after distill.js
196
+ document.addEventListener('DOMContentLoaded', function() {
197
+ initializeTOC();
198
+ initializeSyntaxHighlighting();
199
+ });
200
+ setTimeout(function() {
201
+ initializeTOC();
202
+ initializeSyntaxHighlighting();
203
+ }, 100);
204
+ setTimeout(function() {
205
+ initializeTOC();
206
+ initializeSyntaxHighlighting();
207
+ }, 500);
208
+ setTimeout(function() {
209
+ initializeTOC();
210
+ initializeSyntaxHighlighting();
211
+ }, 1000);
212
  </script>`;
213
 
214
  // Create full HTML document with distill template
 
217
  <head>
218
  <script src="distill.bundle.js" type="module" fetchpriority="high" blocking></script>
219
  <script src="main.bundle.js" type="module" fetchpriority="low" defer></script>
220
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-core.min.js"></script>
221
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/autoloader/prism-autoloader.min.js"></script>
222
  <script src="https://d3js.org/d3.v7.min.js"></script>
223
  <meta name="viewport" content="width=device-width, initial-scale=1">
224
  <meta charset="utf8">
225
  <title>Transformers Feature Showcase</title>
226
  <link rel="stylesheet" href="style.css">
227
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism.min.css">
228
  </head>
229
  <body>
230
  <d-front-matter>