File tree Expand file tree Collapse file tree 3 files changed +29
-22
lines changed Expand file tree Collapse file tree 3 files changed +29
-22
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ // Componente reutilizável para exibir uma caixa de nota estilizada.
3+ // Ele usa um slot padrão para receber o conteúdo da nota.
4+ ---
5+ <div class =" custom-note-box" >
6+ <slot /> { /* O conteúdo da nota será inserido aqui */ }
7+ </div >
8+
9+ <style >
10+ .custom-note-box {
11+ background-color: var(--sl-color-blue-low); /* Tema Claro */
12+ border-left: 4px solid var(--sl-color-blue);
13+ border-radius: 8px;
14+ padding: 1rem 1.25rem;
15+ margin-bottom: 1rem; /* Espaço abaixo se houver múltiplas notas */
16+ color: var(--sl-color-text);
17+ }
18+ html[data-theme="dark"] .custom-note-box {
19+ background-color: var(--sl-color-gray-5); /* Tema Escuro */
20+ }
21+ </style >
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import fs from "fs";
77import path from " path" ;
88import { Code } from ' @astrojs/starlight/components' ;
99
10+ import NoteBox from ' @src/components/NoteBox.astro' ;
1011import ' @src/styles/function-page.css' ;
1112
1213export async function getStaticPaths() {
@@ -62,15 +63,13 @@ if (Array.isArray(funcNotes) && funcNotes.length > 0) {
6263 { description && <Fragment set :html = { marked (description )} />}
6364
6465 <!-- Notes -->
65- { notesContent .length > 0 && (
66- <div class = " notes-section" >
67- { notesContent .map ((note ) => (
68- <div class = " custom-note-box" >
69- <Fragment set :html = { marked (note )} />
70- </div >
71- ))}
72- </div >
73- )}
66+ <div class =" notes-section" >
67+ { notesContent .map ((note ) => (
68+ <NoteBox >
69+ <Fragment set :html = { marked (note )} />
70+ </NoteBox >
71+ ))}
72+ </div >
7473
7574 <!-- Examples -->
7675 { processedExamples .length > 0 && (
Original file line number Diff line number Diff line change 1515 padding-bottom : 0.25rem ;
1616}
1717
18- .custom-note-box {
19- background-color : var (--sl-color-blue-low );
20- border-left : 4px solid var (--sl-color-blue );
21- border-radius : 8px ;
22- padding : 1rem 1.25rem ;
23- margin-bottom : 1rem ;
24- color : var (--sl-color-text );
25- }
26-
27- html [data-theme = "dark" ] .custom-note-box {
28- background-color : var (--sl-color-gray-5 );
29- }
30-
3118.function-example {
3219 margin-bottom : 1.5rem ;
3320}
You can’t perform that action at this time.
0 commit comments