@fsegurai/marked-extended-accordion 17.0.0-beta.2 → 17.0.0-beta.4
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/README.custom.md +2 -4
- package/README.md +2 -4
- package/dist/styles/README.md +10 -220
- package/dist/styles/accordion-theme.css +64 -41
- package/dist/styles/accordion-theme.scss +70 -41
- package/dist/styles/accordion.css +20 -4
- package/dist/styles/accordion.scss +10 -2
- package/package.json +1 -1
package/README.custom.md
CHANGED
|
@@ -336,11 +336,9 @@ The extension generates semantic HTML using native `<details>` and `<summary>` e
|
|
|
336
336
|
|
|
337
337
|
#### Styling Methods
|
|
338
338
|
|
|
339
|
-
**Method 1:
|
|
339
|
+
**Method 1: Use the Provided Theme File** (Quickest)
|
|
340
340
|
|
|
341
|
-
-
|
|
342
|
-
|
|
343
|
-
View: [accordion-theme.css](https://github.com/fsegurai/marked-extensions/blob/main/demo/styles/extensions/accordion-theme.css)
|
|
341
|
+
View: [accordion-theme.css](https://github.com/fsegurai/marked-extensions/blob/main/packages/accordion/styles/accordion-theme.css)
|
|
344
342
|
|
|
345
343
|
- Includes base styles + light/dark theme support
|
|
346
344
|
- Copy to your project:
|
package/README.md
CHANGED
|
@@ -388,11 +388,9 @@ The extension generates semantic HTML using native `<details>` and `<summary>` e
|
|
|
388
388
|
|
|
389
389
|
#### Styling Methods
|
|
390
390
|
|
|
391
|
-
**Method 1:
|
|
391
|
+
**Method 1: Use the Provided Theme File** (Quickest)
|
|
392
392
|
|
|
393
|
-
-
|
|
394
|
-
|
|
395
|
-
View: [accordion-theme.css](https://github.com/fsegurai/marked-extensions/blob/main/demo/styles/extensions/accordion-theme.css)
|
|
393
|
+
View: [accordion-theme.css](https://github.com/fsegurai/marked-extensions/blob/main/packages/accordion/styles/accordion-theme.css)
|
|
396
394
|
|
|
397
395
|
- Includes base styles + light/dark theme support
|
|
398
396
|
- Copy to your project:
|
package/dist/styles/README.md
CHANGED
|
@@ -2,251 +2,41 @@
|
|
|
2
2
|
|
|
3
3
|
This directory contains the CSS and SCSS files for styling the accordion component.
|
|
4
4
|
|
|
5
|
-
## File Structure
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
styles/
|
|
9
|
-
├── accordion.css # Minimal structural CSS (required)
|
|
10
|
-
├── accordion.scss # SCSS version with variables (required if using SCSS)
|
|
11
|
-
├── accordion-theme.css # Example theme (optional)
|
|
12
|
-
├── accordion-theme.scss # SCSS theme with variables (optional)
|
|
13
|
-
└── README.md # This file
|
|
14
|
-
```
|
|
15
|
-
|
|
16
5
|
## Quick Start
|
|
17
6
|
|
|
18
7
|
### Minimal Setup (CSS)
|
|
19
8
|
|
|
20
|
-
For basic functionality, you only need the structural styles:
|
|
21
|
-
|
|
22
9
|
```javascript
|
|
23
10
|
import '@fsegurai/marked-extended-accordion/styles/accordion.css';
|
|
24
11
|
```
|
|
25
12
|
|
|
26
13
|
### With Theme (CSS)
|
|
27
14
|
|
|
28
|
-
To include a basic theme with light/dark mode support:
|
|
29
|
-
|
|
30
15
|
```javascript
|
|
31
16
|
import '@fsegurai/marked-extended-accordion/styles/accordion.css';
|
|
32
17
|
import '@fsegurai/marked-extended-accordion/styles/accordion-theme.css';
|
|
33
18
|
```
|
|
34
19
|
|
|
35
|
-
### Using CDN
|
|
36
|
-
|
|
37
|
-
For projects without build tools, use jsDelivr CDN:
|
|
20
|
+
### Using CDN
|
|
38
21
|
|
|
39
22
|
```html
|
|
40
|
-
<!-- Minimal structural styles (required) -->
|
|
41
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fsegurai/marked-extended-accordion@latest/styles/accordion.css">
|
|
42
|
-
|
|
43
|
-
<!-- Optional theme -->
|
|
44
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fsegurai/marked-extended-accordion@latest/styles/accordion-theme.css">
|
|
45
23
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
<link rel="stylesheet"
|
|
24
|
+
<link rel="stylesheet"
|
|
25
|
+
href="https://cdn.jsdelivr.net/npm/@fsegurai/marked-extended-accordion@latest/dist/styles/accordion.css">
|
|
26
|
+
<link rel="stylesheet"
|
|
27
|
+
href="https://cdn.jsdelivr.net/npm/@fsegurai/marked-extended-accordion@latest/dist/styles/accordion-theme.css">
|
|
49
28
|
```
|
|
50
29
|
|
|
51
30
|
### Using SCSS
|
|
52
31
|
|
|
53
|
-
For full customization with SCSS variables:
|
|
54
|
-
|
|
55
32
|
```scss
|
|
56
|
-
// Customize variables (optional)
|
|
57
|
-
$accordion-animation-duration: 0.5s;
|
|
58
|
-
$accordion-transition-timing: ease-out;
|
|
59
|
-
|
|
60
|
-
// Import structural styles
|
|
61
33
|
@import '@fsegurai/marked-extended-accordion/styles/accordion.scss';
|
|
62
|
-
|
|
63
|
-
// Customize theme colors (optional)
|
|
64
|
-
$accordion-border-color-light: #007bff;
|
|
65
|
-
$accordion-bg-light: #f8f9fa;
|
|
66
|
-
|
|
67
|
-
// Import theme
|
|
68
34
|
@import '@fsegurai/marked-extended-accordion/styles/accordion-theme.scss';
|
|
69
35
|
```
|
|
70
36
|
|
|
71
|
-
##
|
|
72
|
-
|
|
73
|
-
### accordion.css / accordion.scss
|
|
74
|
-
|
|
75
|
-
**Required for functionality**
|
|
76
|
-
|
|
77
|
-
Contains minimal structural CSS needed for the accordion to work properly:
|
|
78
|
-
- Layout and positioning
|
|
79
|
-
- Animation keyframes
|
|
80
|
-
- Basic overflow and display rules
|
|
81
|
-
|
|
82
|
-
**SCSS Variables (accordion.scss only):**
|
|
83
|
-
- `$accordion-animation-duration`: Animation duration (default: `0.3s`)
|
|
84
|
-
- `$accordion-transition-timing`: Transition timing function (default: `ease-in-out`)
|
|
85
|
-
- `$accordion-fade-distance`: Distance for fade animation (default: `-10px`)
|
|
86
|
-
|
|
87
|
-
### accordion-theme.css / accordion-theme.scss
|
|
88
|
-
|
|
89
|
-
**Optional theme styles**
|
|
90
|
-
|
|
91
|
-
Provides a complete visual theme with:
|
|
92
|
-
- Border and background colors
|
|
93
|
-
- Padding and spacing
|
|
94
|
-
- Hover effects
|
|
95
|
-
- Light/dark mode support via `prefers-color-scheme`
|
|
96
|
-
|
|
97
|
-
**SCSS Variables (accordion-theme.scss only):**
|
|
98
|
-
|
|
99
|
-
Light Mode:
|
|
100
|
-
- `$accordion-border-color-light`: Border color (default: `#ddd`)
|
|
101
|
-
- `$accordion-bg-light`: Background color (default: `#ffffff`)
|
|
102
|
-
- `$accordion-header-bg-light`: Header background (default: `#f5f5f5`)
|
|
103
|
-
- `$accordion-header-bg-hover-light`: Header hover background (default: `#e8e8e8`)
|
|
104
|
-
- `$accordion-text-color-light`: Text color (default: `#333`)
|
|
105
|
-
- `$accordion-content-color-light`: Content text color (default: `#24292e`)
|
|
106
|
-
|
|
107
|
-
Dark Mode:
|
|
108
|
-
- `$accordion-border-color-dark`: Border color (default: `#444c56`)
|
|
109
|
-
- `$accordion-bg-dark`: Background color (default: `#22272e`)
|
|
110
|
-
- `$accordion-header-bg-dark`: Header background (default: `#2d333b`)
|
|
111
|
-
- `$accordion-header-bg-hover-dark`: Header hover background (default: `#343b45`)
|
|
112
|
-
- `$accordion-text-color-dark`: Text color (default: `#d1d5da`)
|
|
113
|
-
- `$accordion-content-color-dark`: Content text color (default: `#d1d5da`)
|
|
114
|
-
|
|
115
|
-
## Framework-Specific Integration
|
|
116
|
-
|
|
117
|
-
### Vanilla HTML/JavaScript
|
|
118
|
-
|
|
119
|
-
For projects without build tools, use CDN links:
|
|
120
|
-
|
|
121
|
-
```html
|
|
122
|
-
<!DOCTYPE html>
|
|
123
|
-
<html lang="en">
|
|
124
|
-
<head>
|
|
125
|
-
<meta charset="UTF-8">
|
|
126
|
-
<title>Accordion Example</title>
|
|
127
|
-
|
|
128
|
-
<!-- Import styles from CDN -->
|
|
129
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fsegurai/marked-extended-accordion@latest/styles/accordion.css">
|
|
130
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fsegurai/marked-extended-accordion@latest/styles/accordion-theme.css">
|
|
131
|
-
|
|
132
|
-
<!-- Import marked and extension -->
|
|
133
|
-
<script src="https://cdn.jsdelivr.net/npm/marked@17/lib/marked.umd.js"></script>
|
|
134
|
-
<script src="https://cdn.jsdelivr.net/npm/@fsegurai/marked-extended-accordion@latest/dist/index.umd.js"></script>
|
|
135
|
-
</head>
|
|
136
|
-
<body>
|
|
137
|
-
<div id="content"></div>
|
|
138
|
-
<script>
|
|
139
|
-
marked.use(markedExtendedAccordion());
|
|
140
|
-
document.getElementById('content').innerHTML = marked.parse('::::accordion{title="Hello"}\\nWorld\\n::::accordionend');
|
|
141
|
-
</script>
|
|
142
|
-
</body>
|
|
143
|
-
</html>
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
### Angular
|
|
147
|
-
|
|
148
|
-
```typescript
|
|
149
|
-
// In angular.json:
|
|
150
|
-
{
|
|
151
|
-
"styles": [
|
|
152
|
-
"node_modules/@fsegurai/marked-extended-accordion/styles/accordion.css",
|
|
153
|
-
"node_modules/@fsegurai/marked-extended-accordion/styles/accordion-theme.css"
|
|
154
|
-
]
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
// Or in styles.scss:
|
|
158
|
-
@import '@fsegurai/marked-extended-accordion/styles/accordion.scss';
|
|
159
|
-
@import '@fsegurai/marked-extended-accordion/styles/accordion-theme.scss';
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
### React
|
|
163
|
-
|
|
164
|
-
```javascript
|
|
165
|
-
// In your main index.js or App.js:
|
|
166
|
-
import '@fsegurai/marked-extended-accordion/styles/accordion.css';
|
|
167
|
-
import '@fsegurai/marked-extended-accordion/styles/accordion-theme.css';
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
### Vue
|
|
171
|
-
|
|
172
|
-
```javascript
|
|
173
|
-
// In main.js:
|
|
174
|
-
import '@fsegurai/marked-extended-accordion/styles/accordion.css';
|
|
175
|
-
import '@fsegurai/marked-extended-accordion/styles/accordion-theme.css';
|
|
176
|
-
|
|
177
|
-
// Or in a component:
|
|
178
|
-
<style>
|
|
179
|
-
@import '@fsegurai/marked-extended-accordion/styles/accordion.css';
|
|
180
|
-
@import '@fsegurai/marked-extended-accordion/styles/accordion-theme.css';
|
|
181
|
-
</style>
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
### Next.js
|
|
185
|
-
|
|
186
|
-
```javascript
|
|
187
|
-
// In pages/_app.js or app/layout.js:
|
|
188
|
-
import '@fsegurai/marked-extended-accordion/styles/accordion.css';
|
|
189
|
-
import '@fsegurai/marked-extended-accordion/styles/accordion-theme.css';
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
### Vite
|
|
193
|
-
|
|
194
|
-
```javascript
|
|
195
|
-
// In main.js:
|
|
196
|
-
import '@fsegurai/marked-extended-accordion/styles/accordion.css';
|
|
197
|
-
import '@fsegurai/marked-extended-accordion/styles/accordion-theme.css';
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
## Custom Styling
|
|
201
|
-
|
|
202
|
-
If you prefer to create your own theme, you can:
|
|
203
|
-
|
|
204
|
-
1. Import only `accordion.css` for structural styles
|
|
205
|
-
2. Write your own CSS targeting these classes:
|
|
206
|
-
- `.marked-extended-accordion` - Main container
|
|
207
|
-
- `.marked-extended-accordion-header` - Header/title area
|
|
208
|
-
- `.marked-extended-accordion-title` - Title element
|
|
209
|
-
- `.marked-extended-accordion-content` - Content area
|
|
210
|
-
|
|
211
|
-
Example:
|
|
212
|
-
|
|
213
|
-
```css
|
|
214
|
-
/* Import only structural styles */
|
|
215
|
-
@import '@fsegurai/marked-extended-accordion/styles/accordion.css';
|
|
216
|
-
|
|
217
|
-
/* Your custom theme */
|
|
218
|
-
.marked-extended-accordion {
|
|
219
|
-
border: 2px solid #007bff;
|
|
220
|
-
border-radius: 8px;
|
|
221
|
-
margin: 1rem 0;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
.marked-extended-accordion-header {
|
|
225
|
-
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
226
|
-
padding: 1rem;
|
|
227
|
-
color: white;
|
|
228
|
-
cursor: pointer;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
.marked-extended-accordion-content {
|
|
232
|
-
padding: 1.5rem;
|
|
233
|
-
background: #f8f9fa;
|
|
234
|
-
}
|
|
235
|
-
```
|
|
236
|
-
|
|
237
|
-
## Browser Support
|
|
238
|
-
|
|
239
|
-
The styles use modern CSS features including:
|
|
240
|
-
- CSS Custom Properties (CSS Variables)
|
|
241
|
-
- CSS Animations
|
|
242
|
-
- `@media (prefers-color-scheme)`
|
|
243
|
-
|
|
244
|
-
Supported browsers:
|
|
245
|
-
- Chrome/Edge 88+
|
|
246
|
-
- Firefox 85+
|
|
247
|
-
- Safari 14+
|
|
248
|
-
|
|
249
|
-
## License
|
|
250
|
-
|
|
251
|
-
MIT
|
|
37
|
+
## Files
|
|
252
38
|
|
|
39
|
+
- **accordion.css** - Minimal structural CSS (required)
|
|
40
|
+
- **accordion.scss** - SCSS with customizable variables
|
|
41
|
+
- **accordion-theme.css** - Complete theme with hover previews
|
|
42
|
+
- **accordion-theme.scss** - SCSS theme with customizable colors
|
|
@@ -1,77 +1,100 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Marked Extended Accordion - Theme Styles
|
|
3
|
-
* Visual
|
|
2
|
+
* Marked Extended Accordion - Full Theme Styles
|
|
3
|
+
* Visual styles with customizable CSS variables and light/dark support.
|
|
4
4
|
*
|
|
5
|
-
* This is an example theme. You can customize it or create your own.
|
|
6
5
|
* Import this file after the structural styles:
|
|
7
6
|
* @import '@fsegurai/marked-extended-accordion/styles/accordion.css';
|
|
8
7
|
* @import '@fsegurai/marked-extended-accordion/styles/accordion-theme.css';
|
|
9
8
|
*/
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
:root {
|
|
11
|
+
--marked-extended-accordion-border-color: var(--app-border-light, #ddd);
|
|
12
|
+
--marked-extended-accordion-background-color: var(--md-sys-color-surface-container, #ffffff);
|
|
13
|
+
--marked-extended-accordion-header-background-color: var(--md-sys-color-surface-container-high, #f5f5f5);
|
|
14
|
+
--marked-extended-accordion-header-hover-background-color: var(--md-sys-color-surface-container-highest, #e8e8e8);
|
|
15
|
+
--marked-extended-accordion-text-color: var(--app-text-primary, #333);
|
|
16
|
+
--marked-extended-accordion-content-color: var(--app-text-primary, #24292e);
|
|
17
|
+
--marked-extended-accordion-radius: 4px;
|
|
18
|
+
--marked-extended-accordion-margin: 1rem 0;
|
|
19
|
+
--marked-extended-accordion-header-padding: 0.75rem 1rem;
|
|
20
|
+
--marked-extended-accordion-content-padding: 1rem;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
body.light {
|
|
24
|
+
--marked-extended-accordion-border-color: var(--app-border-light, #ddd);
|
|
25
|
+
--marked-extended-accordion-background-color: var(--md-sys-color-surface-container, #ffffff);
|
|
26
|
+
--marked-extended-accordion-header-background-color: var(--md-sys-color-surface-container-high, #f5f5f5);
|
|
27
|
+
--marked-extended-accordion-header-hover-background-color: var(--md-sys-color-surface-container-highest, #e8e8e8);
|
|
28
|
+
--marked-extended-accordion-text-color: var(--app-text-primary, #333);
|
|
29
|
+
--marked-extended-accordion-content-color: var(--app-text-primary, #24292e);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
body.dark {
|
|
33
|
+
--marked-extended-accordion-border-color: #444c56;
|
|
34
|
+
--marked-extended-accordion-background-color: #22272e;
|
|
35
|
+
--marked-extended-accordion-header-background-color: #2d333b;
|
|
36
|
+
--marked-extended-accordion-header-hover-background-color: #343b45;
|
|
37
|
+
--marked-extended-accordion-text-color: #d1d5da;
|
|
38
|
+
--marked-extended-accordion-content-color: #d1d5da;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@media (prefers-color-scheme: dark) {
|
|
42
|
+
:root {
|
|
43
|
+
--marked-extended-accordion-border-color: #444c56;
|
|
44
|
+
--marked-extended-accordion-background-color: #22272e;
|
|
45
|
+
--marked-extended-accordion-header-background-color: #2d333b;
|
|
46
|
+
--marked-extended-accordion-header-hover-background-color: #343b45;
|
|
47
|
+
--marked-extended-accordion-text-color: #d1d5da;
|
|
48
|
+
--marked-extended-accordion-content-color: #d1d5da;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
body.light {
|
|
52
|
+
--marked-extended-accordion-border-color: var(--app-border-light, #ddd);
|
|
53
|
+
--marked-extended-accordion-background-color: var(--md-sys-color-surface-container, #ffffff);
|
|
54
|
+
--marked-extended-accordion-header-background-color: var(--md-sys-color-surface-container-high, #f5f5f5);
|
|
55
|
+
--marked-extended-accordion-header-hover-background-color: var(--md-sys-color-surface-container-highest, #e8e8e8);
|
|
56
|
+
--marked-extended-accordion-text-color: var(--app-text-primary, #333);
|
|
57
|
+
--marked-extended-accordion-content-color: var(--app-text-primary, #24292e);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
12
61
|
.marked-extended-accordion {
|
|
13
|
-
border: 1px solid
|
|
14
|
-
border-radius:
|
|
15
|
-
margin:
|
|
16
|
-
background-color:
|
|
62
|
+
border: 1px solid var(--marked-extended-accordion-border-color);
|
|
63
|
+
border-radius: var(--marked-extended-accordion-radius);
|
|
64
|
+
margin: var(--marked-extended-accordion-margin);
|
|
65
|
+
background-color: var(--marked-extended-accordion-background-color);
|
|
17
66
|
}
|
|
18
67
|
|
|
19
68
|
.marked-extended-accordion-header {
|
|
20
|
-
padding:
|
|
69
|
+
padding: var(--marked-extended-accordion-header-padding);
|
|
21
70
|
cursor: pointer;
|
|
22
71
|
position: relative;
|
|
23
|
-
background-color:
|
|
24
|
-
color:
|
|
72
|
+
background-color: var(--marked-extended-accordion-header-background-color);
|
|
73
|
+
color: var(--marked-extended-accordion-text-color);
|
|
25
74
|
transition: background-color 0.2s ease;
|
|
26
75
|
}
|
|
27
76
|
|
|
28
77
|
.marked-extended-accordion-header:hover {
|
|
29
|
-
background-color:
|
|
78
|
+
background-color: var(--marked-extended-accordion-header-hover-background-color);
|
|
30
79
|
}
|
|
31
80
|
|
|
32
81
|
.marked-extended-accordion-title {
|
|
33
82
|
margin: 0;
|
|
34
83
|
display: inline;
|
|
35
84
|
font-weight: 600;
|
|
36
|
-
color:
|
|
85
|
+
color: var(--marked-extended-accordion-text-color);
|
|
37
86
|
}
|
|
38
87
|
|
|
39
88
|
.marked-extended-accordion-content {
|
|
40
|
-
padding:
|
|
41
|
-
color:
|
|
89
|
+
padding: var(--marked-extended-accordion-content-padding);
|
|
90
|
+
color: var(--marked-extended-accordion-content-color);
|
|
42
91
|
}
|
|
43
92
|
|
|
44
93
|
.marked-extended-accordion-content img {
|
|
45
94
|
max-width: 100%;
|
|
46
|
-
width: 100%;
|
|
47
95
|
height: auto;
|
|
48
96
|
display: block;
|
|
49
|
-
object-fit: cover;
|
|
50
97
|
margin: 0;
|
|
51
98
|
}
|
|
52
99
|
|
|
53
|
-
/* Dark Theme Support */
|
|
54
|
-
@media (prefers-color-scheme: dark) {
|
|
55
|
-
.marked-extended-accordion {
|
|
56
|
-
border-color: #444c56;
|
|
57
|
-
background-color: #22272e;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.marked-extended-accordion-header {
|
|
61
|
-
background-color: #2d333b;
|
|
62
|
-
color: #d1d5da;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.marked-extended-accordion-header:hover {
|
|
66
|
-
background-color: #343b45;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.marked-extended-accordion-title {
|
|
70
|
-
color: #d1d5da;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.marked-extended-accordion-content {
|
|
74
|
-
color: #d1d5da;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
100
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Marked Extended Accordion - Theme Styles (
|
|
3
|
-
* Visual
|
|
2
|
+
* Marked Extended Accordion - Full Theme Styles (SCSS)
|
|
3
|
+
* Visual styles with customizable variables and light/dark support.
|
|
4
4
|
*
|
|
5
|
-
* This is an example theme. You can customize it or create your own.
|
|
6
5
|
* Import this file after the structural styles:
|
|
7
6
|
* @import '@fsegurai/marked-extended-accordion/styles/accordion.scss';
|
|
8
7
|
* @import '@fsegurai/marked-extended-accordion/styles/accordion-theme.scss';
|
|
@@ -24,24 +23,80 @@ $accordion-header-bg-hover-dark: #343b45 !default;
|
|
|
24
23
|
$accordion-text-color-dark: #d1d5da !default;
|
|
25
24
|
$accordion-content-color-dark: #d1d5da !default;
|
|
26
25
|
|
|
27
|
-
//
|
|
26
|
+
// Layout Variables
|
|
27
|
+
$accordion-radius: 4px !default;
|
|
28
|
+
$accordion-margin: 1rem 0 !default;
|
|
29
|
+
$accordion-header-padding: 0.75rem 1rem !default;
|
|
30
|
+
$accordion-content-padding: 1rem !default;
|
|
31
|
+
|
|
32
|
+
:root {
|
|
33
|
+
--marked-extended-accordion-border-color: var(--app-border-light, #{$accordion-border-color-light});
|
|
34
|
+
--marked-extended-accordion-background-color: var(--md-sys-color-surface-container, #{$accordion-bg-light});
|
|
35
|
+
--marked-extended-accordion-header-background-color: var(--md-sys-color-surface-container-high, #{$accordion-header-bg-light});
|
|
36
|
+
--marked-extended-accordion-header-hover-background-color: var(--md-sys-color-surface-container-highest, #{$accordion-header-bg-hover-light});
|
|
37
|
+
--marked-extended-accordion-text-color: var(--app-text-primary, #{$accordion-text-color-light});
|
|
38
|
+
--marked-extended-accordion-content-color: var(--app-text-primary, #{$accordion-content-color-light});
|
|
39
|
+
--marked-extended-accordion-radius: #{$accordion-radius};
|
|
40
|
+
--marked-extended-accordion-margin: #{$accordion-margin};
|
|
41
|
+
--marked-extended-accordion-header-padding: #{$accordion-header-padding};
|
|
42
|
+
--marked-extended-accordion-content-padding: #{$accordion-content-padding};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
body.light {
|
|
46
|
+
--marked-extended-accordion-border-color: var(--app-border-light, #{$accordion-border-color-light});
|
|
47
|
+
--marked-extended-accordion-background-color: var(--md-sys-color-surface-container, #{$accordion-bg-light});
|
|
48
|
+
--marked-extended-accordion-header-background-color: var(--md-sys-color-surface-container-high, #{$accordion-header-bg-light});
|
|
49
|
+
--marked-extended-accordion-header-hover-background-color: var(--md-sys-color-surface-container-highest, #{$accordion-header-bg-hover-light});
|
|
50
|
+
--marked-extended-accordion-text-color: var(--app-text-primary, #{$accordion-text-color-light});
|
|
51
|
+
--marked-extended-accordion-content-color: var(--app-text-primary, #{$accordion-content-color-light});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
body.dark {
|
|
55
|
+
--marked-extended-accordion-border-color: #{$accordion-border-color-dark};
|
|
56
|
+
--marked-extended-accordion-background-color: #{$accordion-bg-dark};
|
|
57
|
+
--marked-extended-accordion-header-background-color: #{$accordion-header-bg-dark};
|
|
58
|
+
--marked-extended-accordion-header-hover-background-color: #{$accordion-header-bg-hover-dark};
|
|
59
|
+
--marked-extended-accordion-text-color: #{$accordion-text-color-dark};
|
|
60
|
+
--marked-extended-accordion-content-color: #{$accordion-content-color-dark};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@media (prefers-color-scheme: dark) {
|
|
64
|
+
:root {
|
|
65
|
+
--marked-extended-accordion-border-color: #{$accordion-border-color-dark};
|
|
66
|
+
--marked-extended-accordion-background-color: #{$accordion-bg-dark};
|
|
67
|
+
--marked-extended-accordion-header-background-color: #{$accordion-header-bg-dark};
|
|
68
|
+
--marked-extended-accordion-header-hover-background-color: #{$accordion-header-bg-hover-dark};
|
|
69
|
+
--marked-extended-accordion-text-color: #{$accordion-text-color-dark};
|
|
70
|
+
--marked-extended-accordion-content-color: #{$accordion-content-color-dark};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
body.light {
|
|
74
|
+
--marked-extended-accordion-border-color: var(--app-border-light, #{$accordion-border-color-light});
|
|
75
|
+
--marked-extended-accordion-background-color: var(--md-sys-color-surface-container, #{$accordion-bg-light});
|
|
76
|
+
--marked-extended-accordion-header-background-color: var(--md-sys-color-surface-container-high, #{$accordion-header-bg-light});
|
|
77
|
+
--marked-extended-accordion-header-hover-background-color: var(--md-sys-color-surface-container-highest, #{$accordion-header-bg-hover-light});
|
|
78
|
+
--marked-extended-accordion-text-color: var(--app-text-primary, #{$accordion-text-color-light});
|
|
79
|
+
--marked-extended-accordion-content-color: var(--app-text-primary, #{$accordion-content-color-light});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
28
83
|
.marked-extended-accordion {
|
|
29
|
-
border: 1px solid
|
|
30
|
-
border-radius:
|
|
31
|
-
margin:
|
|
32
|
-
background-color:
|
|
84
|
+
border: 1px solid var(--marked-extended-accordion-border-color);
|
|
85
|
+
border-radius: var(--marked-extended-accordion-radius);
|
|
86
|
+
margin: var(--marked-extended-accordion-margin);
|
|
87
|
+
background-color: var(--marked-extended-accordion-background-color);
|
|
33
88
|
}
|
|
34
89
|
|
|
35
90
|
.marked-extended-accordion-header {
|
|
36
|
-
padding:
|
|
91
|
+
padding: var(--marked-extended-accordion-header-padding);
|
|
37
92
|
cursor: pointer;
|
|
38
93
|
position: relative;
|
|
39
|
-
background-color:
|
|
40
|
-
color:
|
|
94
|
+
background-color: var(--marked-extended-accordion-header-background-color);
|
|
95
|
+
color: var(--marked-extended-accordion-text-color);
|
|
41
96
|
transition: background-color 0.2s ease;
|
|
42
97
|
|
|
43
98
|
&:hover {
|
|
44
|
-
background-color:
|
|
99
|
+
background-color: var(--marked-extended-accordion-header-hover-background-color);
|
|
45
100
|
}
|
|
46
101
|
}
|
|
47
102
|
|
|
@@ -49,45 +104,19 @@ $accordion-content-color-dark: #d1d5da !default;
|
|
|
49
104
|
margin: 0;
|
|
50
105
|
display: inline;
|
|
51
106
|
font-weight: 600;
|
|
52
|
-
color:
|
|
107
|
+
color: var(--marked-extended-accordion-text-color);
|
|
53
108
|
}
|
|
54
109
|
|
|
55
110
|
.marked-extended-accordion-content {
|
|
56
|
-
padding:
|
|
57
|
-
color:
|
|
111
|
+
padding: var(--marked-extended-accordion-content-padding);
|
|
112
|
+
color: var(--marked-extended-accordion-content-color);
|
|
58
113
|
|
|
59
114
|
img {
|
|
60
115
|
max-width: 100%;
|
|
61
|
-
width: 100%;
|
|
62
116
|
height: auto;
|
|
63
117
|
display: block;
|
|
64
|
-
object-fit: cover;
|
|
65
118
|
margin: 0;
|
|
66
119
|
}
|
|
67
120
|
}
|
|
68
121
|
|
|
69
|
-
// Dark Theme Support
|
|
70
|
-
@media (prefers-color-scheme: dark) {
|
|
71
|
-
.marked-extended-accordion {
|
|
72
|
-
border-color: $accordion-border-color-dark;
|
|
73
|
-
background-color: $accordion-bg-dark;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.marked-extended-accordion-header {
|
|
77
|
-
background-color: $accordion-header-bg-dark;
|
|
78
|
-
color: $accordion-text-color-dark;
|
|
79
|
-
|
|
80
|
-
&:hover {
|
|
81
|
-
background-color: $accordion-header-bg-hover-dark;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.marked-extended-accordion-title {
|
|
86
|
-
color: $accordion-text-color-dark;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.marked-extended-accordion-content {
|
|
90
|
-
color: $accordion-content-color-dark;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
122
|
|
|
@@ -6,22 +6,31 @@
|
|
|
6
6
|
* @import '@fsegurai/marked-extended-accordion/styles/accordion.css';
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
:root {
|
|
10
|
+
--marked-extended-accordion-animation-duration: 0.3s;
|
|
11
|
+
--marked-extended-accordion-transition-timing: ease-in-out;
|
|
12
|
+
--marked-extended-accordion-animation-easing: ease;
|
|
13
|
+
--marked-extended-accordion-fade-distance: -10px;
|
|
14
|
+
}
|
|
15
|
+
|
|
9
16
|
.marked-extended-accordion {
|
|
10
17
|
overflow: hidden;
|
|
11
18
|
}
|
|
12
19
|
|
|
13
20
|
.marked-extended-accordion .marked-extended-accordion-content {
|
|
14
|
-
transition: opacity 0.3s
|
|
21
|
+
transition: opacity var(--marked-extended-accordion-animation-duration, 0.3s)
|
|
22
|
+
var(--marked-extended-accordion-transition-timing, ease-in-out);
|
|
15
23
|
width: 100%;
|
|
16
24
|
box-sizing: border-box;
|
|
17
|
-
animation: accordion-fade 0.3s
|
|
18
|
-
|
|
25
|
+
animation: accordion-fade var(--marked-extended-accordion-animation-duration, 0.3s)
|
|
26
|
+
var(--marked-extended-accordion-animation-easing, ease);
|
|
27
|
+
overflow: visible;
|
|
19
28
|
}
|
|
20
29
|
|
|
21
30
|
@keyframes accordion-fade {
|
|
22
31
|
from {
|
|
23
32
|
opacity: 0;
|
|
24
|
-
transform: translateY(-10px);
|
|
33
|
+
transform: translateY(var(--marked-extended-accordion-fade-distance, -10px));
|
|
25
34
|
}
|
|
26
35
|
to {
|
|
27
36
|
opacity: 1;
|
|
@@ -29,3 +38,10 @@
|
|
|
29
38
|
}
|
|
30
39
|
}
|
|
31
40
|
|
|
41
|
+
@media (prefers-reduced-motion: reduce) {
|
|
42
|
+
.marked-extended-accordion .marked-extended-accordion-content {
|
|
43
|
+
transition: none;
|
|
44
|
+
animation: none;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
// Customizable variables
|
|
10
10
|
$accordion-animation-duration: 0.3s !default;
|
|
11
11
|
$accordion-transition-timing: ease-in-out !default;
|
|
12
|
+
$accordion-animation-easing: ease !default;
|
|
12
13
|
$accordion-fade-distance: -10px !default;
|
|
13
14
|
|
|
14
15
|
.marked-extended-accordion {
|
|
@@ -18,8 +19,8 @@ $accordion-fade-distance: -10px !default;
|
|
|
18
19
|
transition: opacity $accordion-animation-duration $accordion-transition-timing;
|
|
19
20
|
width: 100%;
|
|
20
21
|
box-sizing: border-box;
|
|
21
|
-
animation: accordion-fade $accordion-animation-duration
|
|
22
|
-
overflow:
|
|
22
|
+
animation: accordion-fade $accordion-animation-duration $accordion-animation-easing;
|
|
23
|
+
overflow: visible;
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
|
|
@@ -34,3 +35,10 @@ $accordion-fade-distance: -10px !default;
|
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
|
|
38
|
+
@media (prefers-reduced-motion: reduce) {
|
|
39
|
+
.marked-extended-accordion .marked-extended-accordion-content {
|
|
40
|
+
transition: none;
|
|
41
|
+
animation: none;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fsegurai/marked-extended-accordion",
|
|
3
|
-
"version": "17.0.0-beta.
|
|
3
|
+
"version": "17.0.0-beta.4",
|
|
4
4
|
"description": "Extension for Marked.js that adds support for extended accordion blocks, allowing the creation of expandable panels with content. It supports any Markdown rendering and can be customized to fit your needs.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|