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";
7
7
import path from " path" ;
8
8
import { Code } from ' @astrojs/starlight/components' ;
9
9
10
+ import NoteBox from ' @src/components/NoteBox.astro' ;
10
11
import ' @src/styles/function-page.css' ;
11
12
12
13
export async function getStaticPaths() {
@@ -62,15 +63,13 @@ if (Array.isArray(funcNotes) && funcNotes.length > 0) {
62
63
{ description && <Fragment set :html = { marked (description )} />}
63
64
64
65
<!-- 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 >
74
73
75
74
<!-- Examples -->
76
75
{ processedExamples .length > 0 && (
Original file line number Diff line number Diff line change 15
15
padding-bottom : 0.25rem ;
16
16
}
17
17
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
-
31
18
.function-example {
32
19
margin-bottom : 1.5rem ;
33
20
}
You can’t perform that action at this time.
0 commit comments