Skip to content

Commit c914974

Browse files
committed
minor updates
1 parent 3ac8272 commit c914974

File tree

2 files changed

+1
-163
lines changed

2 files changed

+1
-163
lines changed

public/globals.css

Lines changed: 0 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -911,154 +911,6 @@ article iframe,
911911
color: #414651 !important;
912912
}
913913

914-
/* YAML styles */
915-
916-
.split-layout {
917-
display: grid;
918-
grid-template-columns: 1fr 1fr;
919-
gap: 2rem;
920-
margin: 2rem 0;
921-
}
922-
923-
@media (max-width: 768px) {
924-
.split-layout {
925-
grid-template-columns: 1fr;
926-
}
927-
}
928-
929-
.content-panel {
930-
padding-right: 1rem;
931-
}
932-
933-
.content-section {
934-
padding: 1rem 1.25rem;
935-
margin-bottom: 0.75rem;
936-
border-left: 4px solid transparent;
937-
border-radius: 0.25rem;
938-
cursor: pointer;
939-
transition: all 0.2s;
940-
}
941-
942-
.content-section:hover {
943-
border-left-color: #e5e7eb;
944-
background-color: #f9fafb;
945-
}
946-
947-
.content-section.active {
948-
border-left-color: #cd3c4d;
949-
background-color: #fef2f2;
950-
}
951-
952-
.content-section h4 {
953-
margin: 0 0 0.5rem 0;
954-
font-size: 1rem;
955-
font-weight: 600;
956-
}
957-
958-
.content-section p {
959-
margin-bottom: 1rem;
960-
line-height: 1.6;
961-
}
962-
963-
.content-section p:first-of-type {
964-
margin-top: 0;
965-
}
966-
967-
.content-section div {
968-
margin-bottom: 1.5rem;
969-
}
970-
971-
.content-section div:last-child,
972-
.content-section p:last-child {
973-
margin-bottom: 0;
974-
}
975-
976-
/* hide top-level test copy button */
977-
[data-testid="copy-code-button"] {
978-
display: none !important;
979-
}
980-
981-
/* CodePanel */
982-
.code-panel {
983-
position: sticky;
984-
top: 8rem;
985-
align-self: flex-start;
986-
max-height: calc(100vh - 8rem);
987-
border-radius: 0.5rem;
988-
overflow: hidden;
989-
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
990-
}
991-
992-
.code-header {
993-
background: #0c1e3d;
994-
color: #e2e8f0;
995-
padding: 0.75rem 1rem;
996-
font-family: monospace;
997-
font-size: 0.875rem;
998-
border-bottom: 1px solid #0a1628;
999-
display: flex;
1000-
justify-content: space-between;
1001-
align-items: center;
1002-
}
1003-
1004-
.copy-btn {
1005-
background: #1e293b;
1006-
border: 1px solid #334155;
1007-
padding: 4px 6px;
1008-
border-radius: 4px;
1009-
color: #e2e8f0;
1010-
cursor: pointer;
1011-
transition: background 0.2s;
1012-
display: flex;
1013-
align-items: center;
1014-
justify-content: center;
1015-
}
1016-
1017-
.copy-btn:hover {
1018-
background: #334155;
1019-
}
1020-
1021-
.copy-btn svg {
1022-
width: 16px;
1023-
height: 16px;
1024-
}
1025-
1026-
.copy-btn[data-copied="true"] .icon-copy {
1027-
display: none;
1028-
}
1029-
1030-
.copy-btn[data-copied="false"] .icon-check {
1031-
display: none;
1032-
}
1033-
1034-
.code-content {
1035-
background: #0c1e3d;
1036-
overflow-y: auto;
1037-
max-height: calc(100vh - 10rem);
1038-
position: relative;
1039-
}
1040-
1041-
.code-content *:not(.line-highlight) {
1042-
background: #0c1e3d !important;
1043-
border: none !important;
1044-
}
1045-
1046-
.code-content pre {
1047-
margin: 0 !important;
1048-
padding: 14px 16px !important;
1049-
border-radius: 0 !important;
1050-
}
1051-
1052-
.line-highlight {
1053-
position: absolute;
1054-
left: 0;
1055-
right: 0;
1056-
background: #1e3a5f;
1057-
border-left: 3px solid #cd3c4d;
1058-
pointer-events: none;
1059-
z-index: 1;
1060-
}
1061-
1062914
#chat-assistant-sheet {
1063915
margin-top: 2rem !important;
1064916
min-height: 90% !important;

snippets/components/CodePreview.jsx

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import React, { useEffect, useRef, useState } from 'react';
22
import './CodePreview.css';
33

4-
/* ------------------------------
5-
* Layout wrapper
6-
* ----------------------------- */
74
export const CodePreview = ({ children }) => {
85
const [instanceId] = useState(
96
() => `preview-${Math.random().toString(36).slice(2)}`
@@ -41,9 +38,6 @@ export const ContentSection = ({ id, title, lines, children }) => (
4138
</div>
4239
);
4340

44-
/* ------------------------------
45-
* Code panel
46-
* ----------------------------- */
4741
export const CodePanel = ({
4842
children,
4943
fileName = 'config.yaml',
@@ -54,9 +48,6 @@ export const CodePanel = ({
5448
const isProgrammaticScroll = useRef(false);
5549
const hoverTimeout = useRef(null);
5650

57-
/* ----------------------------------------------------
58-
* STEP 1: Wait for Mintlify MDX <pre> and wrap lines
59-
* -------------------------------------------------- */
6051
useEffect(() => {
6152
let tries = 0;
6253

@@ -98,9 +89,7 @@ export const CodePanel = ({
9889
wrapLines();
9990
}, [children, showLineNumbers]);
10091

101-
/* ----------------------------------------------------
102-
* STEP 2: Highlight + sync logic
103-
* -------------------------------------------------- */
92+
// Highlight logic
10493
useEffect(() => {
10594
const panel = codePanelRef.current;
10695
const content = codeContentRef.current;
@@ -208,9 +197,6 @@ export const CodePanel = ({
208197
waitForLines();
209198
}, []);
210199

211-
/* ----------------------------------------------------
212-
* Copy handler
213-
* -------------------------------------------------- */
214200
const handleCopy = (e) => {
215201
const btn = e.currentTarget;
216202
const text =

0 commit comments

Comments
 (0)