@editora/themes 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/index.css ADDED
@@ -0,0 +1,295 @@
1
+ /* Rich Text Editor - Base Theme Variables and Styles */
2
+
3
+ /* CSS Custom Properties for Theming */
4
+ :root {
5
+ /* Colors */
6
+ --rte-color-primary: #007bff;
7
+ --rte-color-primary-hover: #0056b3;
8
+ --rte-color-secondary: #6c757d;
9
+ --rte-color-success: #28a745;
10
+ --rte-color-danger: #dc3545;
11
+ --rte-color-warning: #ffc107;
12
+ --rte-color-info: #17a2b8;
13
+
14
+ /* Text Colors */
15
+ --rte-color-text-primary: #212529;
16
+ --rte-color-text-secondary: #6c757d;
17
+ --rte-color-text-muted: #868e96;
18
+ --rte-color-text-inverse: #ffffff;
19
+
20
+ /* Background Colors */
21
+ --rte-color-bg-primary: #ffffff;
22
+ --rte-color-bg-secondary: #f8f9fa;
23
+ --rte-color-bg-tertiary: #e9ecef;
24
+ --rte-color-bg-hover: #f8f9fa;
25
+ --rte-color-bg-active: #e9ecef;
26
+
27
+ /* Border Colors */
28
+ --rte-color-border: #dee2e6;
29
+ --rte-color-border-light: #f8f9fa;
30
+ --rte-color-border-focus: #007bff;
31
+
32
+ /* Shadows */
33
+ --rte-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
34
+ --rte-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
35
+ --rte-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
36
+
37
+ /* Spacing */
38
+ --rte-space-xs: 0.25rem;
39
+ --rte-space-sm: 0.5rem;
40
+ --rte-space-md: 1rem;
41
+ --rte-space-lg: 1.5rem;
42
+ --rte-space-xl: 2rem;
43
+ --rte-space-xxl: 3rem;
44
+
45
+ /* Typography */
46
+ --rte-font-family-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
47
+ --rte-font-family-mono: 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
48
+
49
+ --rte-font-size-xs: 0.75rem;
50
+ --rte-font-size-sm: 0.875rem;
51
+ --rte-font-size-base: 1rem;
52
+ --rte-font-size-lg: 1.125rem;
53
+ --rte-font-size-xl: 1.25rem;
54
+ --rte-font-size-xxl: 1.5rem;
55
+ --rte-font-size-xxxl: 2rem;
56
+
57
+ --rte-font-weight-normal: 400;
58
+ --rte-font-weight-medium: 500;
59
+ --rte-font-weight-semibold: 600;
60
+ --rte-font-weight-bold: 700;
61
+
62
+ --rte-line-height-tight: 1.25;
63
+ --rte-line-height-normal: 1.5;
64
+ --rte-line-height-relaxed: 1.75;
65
+
66
+ /* Border Radius */
67
+ --rte-radius-sm: 0.125rem;
68
+ --rte-radius: 0.25rem;
69
+ --rte-radius-md: 0.375rem;
70
+ --rte-radius-lg: 0.5rem;
71
+ --rte-radius-xl: 0.75rem;
72
+
73
+ /* Transitions */
74
+ --rte-transition-fast: 150ms ease-in-out;
75
+ --rte-transition-normal: 250ms ease-in-out;
76
+ --rte-transition-slow: 350ms ease-in-out;
77
+
78
+ /* Z-Index */
79
+ --rte-z-dropdown: 1000;
80
+ --rte-z-sticky: 1020;
81
+ --rte-z-modal: 1050;
82
+ --rte-z-popover: 1060;
83
+ --rte-z-tooltip: 1070;
84
+ }
85
+
86
+ /* Base Editor Styles */
87
+ .rte-editor {
88
+ font-family: var(--rte-font-family-base);
89
+ font-size: var(--rte-font-size-base);
90
+ line-height: var(--rte-line-height-normal);
91
+ color: var(--rte-color-text-primary);
92
+ background-color: var(--rte-color-bg-primary);
93
+ border: 1px solid var(--rte-color-border);
94
+ border-radius: var(--rte-radius);
95
+ box-shadow: var(--rte-shadow);
96
+ transition: border-color var(--rte-transition-fast), box-shadow var(--rte-transition-fast);
97
+ }
98
+
99
+ .rte-editor:focus-within {
100
+ border-color: var(--rte-color-border-focus);
101
+ box-shadow: var(--rte-shadow), 0 0 0 3px rgba(0, 123, 255, 0.1);
102
+ }
103
+
104
+ /* Toolbar Styles */
105
+ .rte-toolbar {
106
+ display: flex;
107
+ align-items: center;
108
+ padding: var(--rte-space-sm);
109
+ border-bottom: 1px solid var(--rte-color-border);
110
+ background-color: var(--rte-color-bg-secondary);
111
+ border-radius: var(--rte-radius) var(--rte-radius) 0 0;
112
+ flex-wrap: wrap;
113
+ gap: 2px;
114
+ }
115
+
116
+ .rte-toolbar-group {
117
+ display: flex;
118
+ align-items: center;
119
+ border-radius: var(--rte-radius);
120
+ overflow: hidden;
121
+ border: 1px solid var(--rte-color-border-light);
122
+ }
123
+
124
+ .rte-toolbar-button {
125
+ display: flex;
126
+ align-items: center;
127
+ justify-content: center;
128
+ width: 2rem;
129
+ height: 2rem;
130
+ padding: 0;
131
+ border: none;
132
+ background: transparent;
133
+ color: var(--rte-color-text-secondary);
134
+ cursor: pointer;
135
+ border-radius: var(--rte-radius-sm);
136
+ transition: background-color var(--rte-transition-fast), color var(--rte-transition-fast);
137
+ font-size: 14px;
138
+ line-height: 1;
139
+ }
140
+
141
+ .rte-toolbar-button svg {
142
+ flex-shrink: 0;
143
+ fill: currentColor;
144
+ stroke: currentColor;
145
+ width: 14px;
146
+ height: 14px;
147
+ }
148
+
149
+ .rte-toolbar-button:hover svg {
150
+ opacity: 0.8;
151
+ }
152
+
153
+ .rte-toolbar-button[data-active="true"] svg {
154
+ fill: var(--rte-color-text-inverse);
155
+ stroke: var(--rte-color-text-inverse);
156
+ }
157
+
158
+ .rte-toolbar-button:hover {
159
+ background-color: var(--rte-color-bg-hover);
160
+ color: var(--rte-color-text-primary);
161
+ }
162
+
163
+ .rte-toolbar-button:active,
164
+ .rte-toolbar-button[data-active="true"] {
165
+ background-color: var(--rte-color-primary);
166
+ color: var(--rte-color-text-inverse);
167
+ }
168
+
169
+ .rte-toolbar-button:disabled {
170
+ opacity: 0.5;
171
+ cursor: not-allowed;
172
+ }
173
+
174
+ /* Content Area Styles */
175
+ .rte-content {
176
+ padding: var(--rte-space-md);
177
+ min-height: 200px;
178
+ outline: none;
179
+ overflow-wrap: break-word;
180
+ word-wrap: break-word;
181
+ }
182
+
183
+ .rte-content[contenteditable="true"] {
184
+ cursor: text;
185
+ }
186
+
187
+ /* Typography Styles */
188
+ .rte-content h1,
189
+ .rte-content h2,
190
+ .rte-content h3,
191
+ .rte-content h4,
192
+ .rte-content h5,
193
+ .rte-content h6 {
194
+ margin: var(--rte-space-lg) 0 var(--rte-space-md) 0;
195
+ font-weight: var(--rte-font-weight-semibold);
196
+ line-height: var(--rte-line-height-tight);
197
+ color: var(--rte-color-text-primary);
198
+ }
199
+
200
+ .rte-content h1 { font-size: var(--rte-font-size-xxxl); }
201
+ .rte-content h2 { font-size: var(--rte-font-size-xxl); }
202
+ .rte-content h3 { font-size: var(--rte-font-size-xl); }
203
+ .rte-content h4 { font-size: var(--rte-font-size-lg); }
204
+ .rte-content h5 { font-size: var(--rte-font-size-base); }
205
+ .rte-content h6 { font-size: var(--rte-font-size-sm); }
206
+
207
+ .rte-content p {
208
+ margin: var(--rte-space-md) 0;
209
+ }
210
+
211
+ .rte-content blockquote {
212
+ margin: var(--rte-space-lg) 0;
213
+ padding: var(--rte-space-md);
214
+ padding-left: var(--rte-space-lg);
215
+ border-left: 4px solid var(--rte-color-primary);
216
+ background-color: var(--rte-color-bg-secondary);
217
+ font-style: italic;
218
+ color: var(--rte-color-text-secondary);
219
+ }
220
+
221
+ /* List Styles */
222
+ .rte-content ul,
223
+ .rte-content ol {
224
+ margin: var(--rte-space-md) 0;
225
+ padding-left: var(--rte-space-xl);
226
+ }
227
+
228
+ .rte-content li {
229
+ margin: var(--rte-space-xs) 0;
230
+ }
231
+
232
+ .rte-content ul {
233
+ list-style-type: disc;
234
+ }
235
+
236
+ .rte-content ol {
237
+ list-style-type: decimal;
238
+ }
239
+
240
+ /* Link Styles */
241
+ .rte-link {
242
+ color: var(--rte-color-primary);
243
+ text-decoration: none;
244
+ transition: color var(--rte-transition-fast);
245
+ }
246
+
247
+ .rte-link:hover {
248
+ color: var(--rte-color-primary-hover);
249
+ text-decoration: underline;
250
+ }
251
+
252
+ /* Code Styles */
253
+ .rte-content code {
254
+ font-family: var(--rte-font-family-mono);
255
+ font-size: 0.875em;
256
+ background-color: var(--rte-color-bg-tertiary);
257
+ padding: 0.125rem 0.25rem;
258
+ border-radius: var(--rte-radius-sm);
259
+ color: var(--rte-color-danger);
260
+ }
261
+
262
+ /* Selection Styles */
263
+ .rte-content::selection {
264
+ background-color: rgba(0, 123, 255, 0.2);
265
+ }
266
+
267
+ /* Placeholder Styles */
268
+ .rte-content:empty:before {
269
+ content: attr(data-placeholder);
270
+ color: var(--rte-color-text-muted);
271
+ pointer-events: none;
272
+ }
273
+
274
+ /* Focus Styles */
275
+ .rte-content:focus {
276
+ outline: none;
277
+ }
278
+
279
+ /* Utility Classes */
280
+ .rte-sr-only {
281
+ position: absolute;
282
+ width: 1px;
283
+ height: 1px;
284
+ padding: 0;
285
+ margin: -1px;
286
+ overflow: hidden;
287
+ clip: rect(0, 0, 0, 0);
288
+ white-space: nowrap;
289
+ border: 0;
290
+ }
291
+
292
+ .rte-text-left { text-align: left; }
293
+ .rte-text-center { text-align: center; }
294
+ .rte-text-right { text-align: right; }
295
+ .rte-text-justify { text-align: justify; }
@@ -0,0 +1,150 @@
1
+ /* Rich Text Editor - Dark Theme */
2
+
3
+ /* Override CSS Custom Properties for Dark Theme */
4
+ [data-theme="dark"],
5
+ .dark {
6
+ /* Colors */
7
+ --rte-color-primary: #4dabf7;
8
+ --rte-color-primary-hover: #339af0;
9
+ --rte-color-secondary: #868e96;
10
+ --rte-color-success: #40c057;
11
+ --rte-color-danger: #fa5252;
12
+ --rte-color-warning: #ffd43b;
13
+ --rte-color-info: #339af0;
14
+
15
+ /* Text Colors */
16
+ --rte-color-text-primary: #f8f9fa;
17
+ --rte-color-text-secondary: #ced4da;
18
+ --rte-color-text-muted: #868e96;
19
+ --rte-color-text-inverse: #212529;
20
+
21
+ /* Background Colors */
22
+ --rte-color-bg-primary: #212529;
23
+ --rte-color-bg-secondary: #343a40;
24
+ --rte-color-bg-tertiary: #495057;
25
+ --rte-color-bg-hover: #495057;
26
+ --rte-color-bg-active: #6c757d;
27
+
28
+ /* Border Colors */
29
+ --rte-color-border: #495057;
30
+ --rte-color-border-light: #343a40;
31
+ --rte-color-border-focus: #4dabf7;
32
+
33
+ /* Shadows */
34
+ --rte-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
35
+ --rte-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
36
+ --rte-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4), 0 4px 6px rgba(0, 0, 0, 0.3);
37
+ }
38
+
39
+ /* Dark theme specific overrides */
40
+ [data-theme="dark"] .rte-editor,
41
+ .dark .rte-editor {
42
+ background-color: var(--rte-color-bg-primary);
43
+ border-color: var(--rte-color-border);
44
+ color: var(--rte-color-text-primary);
45
+ }
46
+
47
+ [data-theme="dark"] .rte-toolbar,
48
+ .dark .rte-toolbar {
49
+ background-color: var(--rte-color-bg-secondary);
50
+ border-color: var(--rte-color-border);
51
+ }
52
+
53
+ [data-theme="dark"] .rte-toolbar-button,
54
+ .dark .rte-toolbar-button {
55
+ color: var(--rte-color-text-secondary);
56
+ }
57
+
58
+ [data-theme="dark"] .rte-toolbar-button:hover,
59
+ .dark .rte-toolbar-button:hover {
60
+ background-color: var(--rte-color-bg-hover);
61
+ color: var(--rte-color-text-primary);
62
+ }
63
+
64
+ [data-theme="dark"] .rte-toolbar-button:active,
65
+ .dark .rte-toolbar-button:active,
66
+ [data-theme="dark"] .rte-toolbar-button[data-active="true"],
67
+ .dark .rte-toolbar-button[data-active="true"] {
68
+ background-color: var(--rte-color-primary);
69
+ color: var(--rte-color-text-inverse);
70
+ }
71
+
72
+ /* Dark theme - More Button */
73
+ [data-theme="dark"] .rte-toolbar-more-button,
74
+ .dark .rte-toolbar-more-button {
75
+ background-color: var(--rte-color-bg-secondary);
76
+ border-color: var(--rte-color-border);
77
+ color: var(--rte-color-text-secondary);
78
+ }
79
+
80
+ [data-theme="dark"] .rte-toolbar-more-button:hover,
81
+ .dark .rte-toolbar-more-button:hover {
82
+ background-color: var(--rte-color-bg-hover);
83
+ color: var(--rte-color-text-primary);
84
+ }
85
+
86
+ [data-theme="dark"] .rte-toolbar-more-button.active,
87
+ .dark .rte-toolbar-more-button.active {
88
+ background-color: var(--rte-color-bg-tertiary);
89
+ border-color: var(--rte-color-border);
90
+ }
91
+
92
+ /* Dark theme - Expanded row */
93
+ [data-theme="dark"] .rte-toolbar-expanded-row,
94
+ .dark .rte-toolbar-expanded-row {
95
+ background-color: var(--rte-color-bg-secondary);
96
+ border-color: var(--rte-color-border);
97
+ }
98
+
99
+ [data-theme="dark"] .rte-content,
100
+ .dark .rte-content {
101
+ color: var(--rte-color-text-primary);
102
+ }
103
+
104
+ [data-theme="dark"] .rte-content h1,
105
+ [data-theme="dark"] .rte-content h2,
106
+ [data-theme="dark"] .rte-content h3,
107
+ [data-theme="dark"] .rte-content h4,
108
+ [data-theme="dark"] .rte-content h5,
109
+ [data-theme="dark"] .rte-content h6,
110
+ .dark .rte-content h1,
111
+ .dark .rte-content h2,
112
+ .dark .rte-content h3,
113
+ .dark .rte-content h4,
114
+ .dark .rte-content h5,
115
+ .dark .rte-content h6 {
116
+ color: var(--rte-color-text-primary);
117
+ }
118
+
119
+ [data-theme="dark"] .rte-content blockquote,
120
+ .dark .rte-content blockquote {
121
+ background-color: var(--rte-color-bg-tertiary);
122
+ color: var(--rte-color-text-secondary);
123
+ border-left-color: var(--rte-color-primary);
124
+ }
125
+
126
+ [data-theme="dark"] .rte-link,
127
+ .dark .rte-link {
128
+ color: var(--rte-color-primary);
129
+ }
130
+
131
+ [data-theme="dark"] .rte-link:hover,
132
+ .dark .rte-link:hover {
133
+ color: var(--rte-color-primary-hover);
134
+ }
135
+
136
+ [data-theme="dark"] .rte-content code,
137
+ .dark .rte-content code {
138
+ background-color: var(--rte-color-bg-tertiary);
139
+ color: var(--rte-color-warning);
140
+ }
141
+
142
+ [data-theme="dark"] .rte-content::selection,
143
+ .dark .rte-content::selection {
144
+ background-color: rgba(77, 171, 247, 0.3);
145
+ }
146
+
147
+ [data-theme="dark"] .rte-content:empty:before,
148
+ .dark .rte-content:empty:before {
149
+ color: var(--rte-color-text-muted);
150
+ }