You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Then import: import 'remark-notes-plugin/styles.css'
80
+
81
+
// Both options
82
+
unified().use(remarkNotes, {
83
+
classPrefix: 'custom',
84
+
injectStyles: false
85
+
})
86
+
```
87
+
57
88
## 📝 Note Types
58
89
59
90
The plugin supports five distinct types of notes, each with its own unique style:
@@ -90,34 +121,75 @@ The plugin supports five distinct types of notes, each with its own unique style
90
121
91
122
## 🎨 Styling
92
123
93
-
Default styles are loaded automatically when you use the plugin. You can also modify the styles since the plugin uses a modular class structure that makes it easy to customize the appearance:
124
+
By default, styles are automatically injected into your document. You can customize this behavior:
125
+
126
+
### Automatic Style Injection (Default)
127
+
128
+
Styles are included automatically when you use the plugin with default settings:
Where `[type]` is one of: `note`, `tip`, `important`, `quote`, or `bonus`.
26
26
27
+
### Available CSS Classes
28
+
29
+
-`.remark-note` - Base container for all note types
30
+
-`.remark-note-[type]` - Type-specific class (e.g., `.remark-note-tip`)
31
+
-`.remark-note-header` - Header container with icon and title
32
+
-`.remark-note-icon` - Icon container
33
+
-`.remark-note-title` - Title text
34
+
-`.remark-note-content` - Content wrapper
35
+
36
+
### Custom Class Prefix
37
+
38
+
You can add a custom prefix to all CSS classes using the `classPrefix` option:
39
+
40
+
```javascript
41
+
import { unified } from'unified';
42
+
importremarkNotesfrom'remark-notes-plugin';
43
+
44
+
unified().use(remarkNotes, {
45
+
classPrefix:'my-callout'
46
+
});
47
+
```
48
+
49
+
This will generate classes like:
50
+
51
+
-`.my-callout-remark-note`
52
+
-`.my-callout-remark-note-tip`
53
+
-`.my-callout-remark-note-header`
54
+
-`.my-callout-remark-note-icon`
55
+
-`.my-callout-remark-note-title`
56
+
-`.my-callout-remark-note-content`
57
+
58
+
This is useful for avoiding CSS conflicts or integrating with existing design systems.
59
+
27
60
## Basic Customization
28
61
29
62
You can customize the notes by targeting these CSS classes in your own stylesheet:
@@ -35,15 +68,20 @@ You can customize the notes by targeting these CSS classes in your own styleshee
35
68
}
36
69
37
70
/* Change the border color of tip notes */
38
-
.remark-note.tip {
71
+
.remark-note-tip {
39
72
border-color: #4caf50;
40
73
}
41
74
42
75
/* Change the title style of important notes */
43
-
.remark-note.important.remark-note-title {
76
+
.remark-note-important.remark-note-title {
44
77
color: #f44336;
45
78
font-weight: bold;
46
79
}
80
+
81
+
/* With custom prefix 'my-callout' */
82
+
.my-callout-remark-note-tip {
83
+
border-color: #4caf50;
84
+
}
47
85
```
48
86
49
87
## Complete Customization Example
@@ -60,70 +98,70 @@ Here's a complete example that changes the styling for all note types:
60
98
}
61
99
62
100
/* Note title styles */
63
-
.remark-note.title {
101
+
.remark-note-title {
64
102
font-size: 1.1em;
65
103
font-weight: 600;
66
104
margin-bottom: 8px;
67
105
}
68
106
69
107
/* Standard note */
70
-
.remark-note.note {
108
+
.remark-note-note {
71
109
background-color: #e8f4fd;
72
110
border-left: 4pxsolid#1e88e5;
73
111
}
74
-
.remark-note.note.remark-note.title {
112
+
.remark-note-note.remark-note-title {
75
113
color: #1565c0;
76
114
}
77
115
78
116
/* Tip note */
79
-
.remark-note.tip {
117
+
.remark-note-tip {
80
118
background-color: #e8f5e9;
81
119
border-left: 4pxsolid#43a047;
82
120
}
83
-
.remark-note.tip.remark-note-title {
121
+
.remark-note-tip.remark-note-title {
84
122
color: #2e7d32;
85
123
}
86
124
87
125
/* Important note */
88
-
.remark-note.important {
126
+
.remark-note-important {
89
127
background-color: #ffebee;
90
128
border-left: 4pxsolid#e53935;
91
129
}
92
-
.remark-note.important.remark-note-title {
130
+
.remark-note-important.remark-note-title {
93
131
color: #c62828;
94
132
}
95
133
96
134
/* Quote note */
97
-
.remark-note.quote {
135
+
.remark-note-quote {
98
136
background-color: #ede7f6;
99
137
border-left: 4pxsolid#7e57c2;
100
138
}
101
-
.remark-note.quote.remark-note-title {
139
+
.remark-note-quote.remark-note-title {
102
140
color: #5e35b1;
103
141
}
104
142
105
143
/* Bonus note */
106
-
.remark-note.bonus {
144
+
.remark-note-bonus {
107
145
background-color: #fff8e1;
108
146
border-left: 4pxsolid#ffb300;
109
147
}
110
-
.remark-note.bonus.remark-note-title {
148
+
.remark-note-bonus.remark-note-title {
111
149
color: #ff8f00;
112
150
}
113
151
```
114
152
115
153
## Applying Custom Styles
116
154
117
-
Add your custom styles to your project after importing the default styles. For example:
155
+
Add your custom styles to your project. If you're using manual CSS import (with `injectStyles: false`), import your custom styles after the default ones:
118
156
119
157
```javascript
120
-
// Import the default styles first
121
-
import'remark-notes-plugin/dist/styles.css';
158
+
// Import the default styles first (only if injectStyles: false)
159
+
import'remark-notes-plugin/styles.css';
122
160
// Then import your custom styles
123
161
import'./your-custom-styles.css';
124
162
```
125
163
126
-
This ensures that your custom styles override the default ones.
164
+
If you're using the default auto-injection, simply include your custom stylesheet in your project and the styles will override the defaults due to CSS specificity.
127
165
128
166
## Dark Mode Support
129
167
@@ -151,6 +189,10 @@ Or if you're using a theme toggle, you can use CSS classes:
151
189
background-color: #1e1e1e;
152
190
color: #e0e0e0;
153
191
}
192
+
193
+
.dark-theme.remark-note-title {
194
+
color: #ffffff;
195
+
}
154
196
```
155
197
156
-
Adapt these examples to fit your website's specific styling needs and color scheme.
198
+
Adapt these examples to fit your website's specific styling needs and color scheme.
0 commit comments