Files
promptfoo--promptfoo/site/blog/jailbreaking-vs-prompt-injection/components/CollapsibleCode.module.css
T
wehub-resource-sync 0d3cb498a3
CI / Shell Format Check (push) Has been cancelled
CI / Check Ruby (3.4) (push) Has been cancelled
CI / CI Config (push) Has been cancelled
CI / Test on Node ${{ matrix.node }} and ${{ matrix.os }}${{ matrix.shard && format(' (shard {0}/3)', matrix.shard) || '' }} (push) Has been cancelled
CI / Build on Node ${{ matrix.node }} (push) Has been cancelled
CI / Style Check (push) Has been cancelled
CI / Generate Assets (push) Has been cancelled
CI / Check Python (3.14) (push) Has been cancelled
CI / Check Python (3.9) (push) Has been cancelled
CI / Build Docs (push) Has been cancelled
CI / Code Scan Action (push) Has been cancelled
CI / Site tests (push) Has been cancelled
CI / webui tests (push) Has been cancelled
CI / Run Integration Tests (push) Has been cancelled
CI / Run Smoke Tests (push) Has been cancelled
CI / Go Tests (push) Has been cancelled
CI / Share Test (push) Has been cancelled
CI / Redteam (Production API) (push) Has been cancelled
CI / Redteam (Staging API) (push) Has been cancelled
CI / GitHub Actions Lint (push) Has been cancelled
CI / Check Ruby (3.0) (push) Has been cancelled
release-please / release-please (push) Has been cancelled
release-please / build (push) Has been cancelled
release-please / publish-npm (push) Has been cancelled
release-please / publish-npm-backfill (push) Has been cancelled
release-please / docker (push) Has been cancelled
release-please / publish-code-scan-action (push) Has been cancelled
release-please / attest-code-scan-action (push) Has been cancelled
Deploy local.promptfoo.app / Deploy to Cloudflare Pages (push) Has been cancelled
Test and Publish Multi-arch Docker Image / test (push) Has been cancelled
Test and Publish Multi-arch Docker Image / build-docker-and-push-digests (map[digest-suffix:linux-amd64 platform:linux/amd64 runner:ubuntu-latest]) (push) Has been cancelled
Test and Publish Multi-arch Docker Image / build-docker-and-push-digests (map[digest-suffix:linux-arm64 platform:linux/arm64 runner:ubuntu-24.04-arm]) (push) Has been cancelled
Test and Publish Multi-arch Docker Image / merge-docker-digests (push) Has been cancelled
Test and Publish Multi-arch Docker Image / Attest Multi-arch Image (push) Has been cancelled
Validate Renovate Config / Validate Renovate Configuration (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:24:08 +08:00

281 lines
5.0 KiB
CSS

.collapsibleCode {
margin: 1.5rem 0;
border: 1px solid #e2e8f0;
border-radius: 8px;
background: white;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
overflow: hidden;
}
.header {
background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
padding: 1rem 1.5rem;
border-bottom: 1px solid #e2e8f0;
cursor: pointer;
display: flex;
justify-content: space-between;
align-items: center;
transition: background-color 0.2s ease;
user-select: none;
}
.header:hover {
background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%);
}
.title {
display: flex;
align-items: center;
gap: 0.5rem;
font-weight: 600;
color: #374151;
font-size: 1rem;
}
.icon {
font-size: 0.8rem;
transition: transform 0.2s ease;
color: #6b7280;
}
.actions {
display: flex;
align-items: center;
gap: 1rem;
font-size: 0.875rem;
color: #6b7280;
}
.lineCount {
background: #e2e8f0;
padding: 0.25rem 0.5rem;
border-radius: 4px;
font-size: 0.75rem;
color: #475569;
}
.expandText {
font-weight: 500;
}
.codeContainer {
overflow: hidden;
}
.expanded .fullCode {
opacity: 1;
max-height: none;
}
.preview {
position: relative;
max-height: 120px;
overflow: hidden;
}
.preview pre {
margin: 0;
background: #f8fafc;
padding: 1rem 1.5rem;
border: none;
border-radius: 0;
font-size: 0.875rem;
line-height: 1.5;
}
.preview code {
background: transparent;
padding: 0;
border-radius: 0;
}
.fade {
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 60px;
background: linear-gradient(transparent, #f8fafc);
display: flex;
align-items: end;
justify-content: center;
padding-bottom: 0.5rem;
cursor: pointer;
pointer-events: all;
}
.expandHint {
background: rgba(59, 130, 246, 0.1);
color: #3b82f6;
padding: 0.25rem 0.75rem;
border-radius: 4px;
font-size: 0.75rem;
font-weight: 500;
border: 1px solid rgba(59, 130, 246, 0.2);
cursor: pointer;
transition: all 0.2s ease;
pointer-events: none;
}
.fade:hover .expandHint {
background: rgba(59, 130, 246, 0.2);
border-color: rgba(59, 130, 246, 0.4);
transform: translateY(-1px);
}
.fullCode {
background: #f8fafc;
}
.codeHeader {
background: #e2e8f0;
padding: 0.5rem 1.5rem;
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid #cbd5e1;
}
.language {
font-size: 0.75rem;
font-weight: 600;
color: #475569;
letter-spacing: 0.05em;
}
.copyButton {
background: #3b82f6;
color: white;
border: none;
padding: 0.375rem 0.75rem;
border-radius: 4px;
font-size: 0.75rem;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease;
}
.copyButton:hover {
background: #2563eb;
transform: translateY(-1px);
}
.fullCode pre {
margin: 0;
background: #f8fafc;
padding: 1.5rem;
border: none;
border-radius: 0;
font-size: 0.875rem;
line-height: 1.6;
overflow-x: auto;
}
.fullCode code {
background: transparent;
padding: 0;
border-radius: 0;
white-space: pre-wrap;
word-break: break-word;
}
html[data-theme='dark'] .collapsibleCode {
border-color: var(--ifm-color-emphasis-300);
background: var(--ifm-background-surface-color);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
html[data-theme='dark'] .header {
background: linear-gradient(
135deg,
var(--ifm-background-color) 0%,
var(--ifm-background-surface-color) 100%
);
border-bottom-color: var(--ifm-color-emphasis-300);
}
html[data-theme='dark'] .header:hover {
background: linear-gradient(
135deg,
var(--ifm-background-surface-color) 0%,
var(--ifm-color-emphasis-200) 100%
);
}
html[data-theme='dark'] .title {
color: var(--ifm-font-color-base);
}
html[data-theme='dark'] .icon,
html[data-theme='dark'] .actions {
color: var(--ifm-color-emphasis-700);
}
html[data-theme='dark'] .lineCount {
background: var(--ifm-color-emphasis-200);
color: var(--ifm-font-color-base);
}
html[data-theme='dark'] .preview pre,
html[data-theme='dark'] .fullCode,
html[data-theme='dark'] .fullCode pre {
background: var(--ifm-background-color);
}
html[data-theme='dark'] .fade {
background: linear-gradient(transparent, var(--ifm-background-color));
}
html[data-theme='dark'] .expandHint {
background: rgba(59, 130, 246, 0.18);
border-color: rgba(59, 130, 246, 0.35);
}
html[data-theme='dark'] .fade:hover .expandHint {
background: rgba(59, 130, 246, 0.3);
border-color: rgba(59, 130, 246, 0.55);
}
html[data-theme='dark'] .codeHeader {
background: var(--ifm-color-emphasis-200);
border-bottom-color: var(--ifm-color-emphasis-300);
}
html[data-theme='dark'] .language {
color: var(--ifm-color-emphasis-800);
}
/* Mobile responsive */
@media (max-width: 640px) {
.header {
padding: 0.875rem 1rem;
}
.title {
font-size: 0.9rem;
}
.actions {
gap: 0.5rem;
}
.expandText {
display: none;
}
.preview pre,
.fullCode pre {
padding: 1rem;
font-size: 0.8rem;
}
.codeHeader {
padding: 0.5rem 1rem;
}
.copyButton {
padding: 0.25rem 0.5rem;
font-size: 0.7rem;
}
}