@fsegurai/marked-extended-accordion 17.0.0-beta.3 → 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 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: Copy the Demo Theme** (Quickest)
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: Copy the Demo Theme** (Quickest)
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:
@@ -1,77 +1,100 @@
1
1
  /**
2
- * Marked Extended Accordion - Theme Styles (Example)
3
- * Visual and theming styles for marked-extended-accordion
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
- /* Base Accordion Styles */
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 #ddd;
14
- border-radius: 4px;
15
- margin: 1rem 0;
16
- background-color: #ffffff;
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: 0.75rem 1rem;
69
+ padding: var(--marked-extended-accordion-header-padding);
21
70
  cursor: pointer;
22
71
  position: relative;
23
- background-color: #f5f5f5;
24
- color: #333;
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: #e8e8e8;
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: #333;
85
+ color: var(--marked-extended-accordion-text-color);
37
86
  }
38
87
 
39
88
  .marked-extended-accordion-content {
40
- padding: 1rem;
41
- color: #24292e;
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 (Example - SCSS)
3
- * Visual and theming styles for marked-extended-accordion
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
- // Base Accordion Styles
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 $accordion-border-color-light;
30
- border-radius: 4px;
31
- margin: 1rem 0;
32
- background-color: $accordion-bg-light;
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: 0.75rem 1rem;
91
+ padding: var(--marked-extended-accordion-header-padding);
37
92
  cursor: pointer;
38
93
  position: relative;
39
- background-color: $accordion-header-bg-light;
40
- color: $accordion-text-color-light;
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: $accordion-header-bg-hover-light;
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: $accordion-text-color-light;
107
+ color: var(--marked-extended-accordion-text-color);
53
108
  }
54
109
 
55
110
  .marked-extended-accordion-content {
56
- padding: 1rem;
57
- color: $accordion-content-color-light;
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 ease-in-out;
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 ease;
18
- overflow: auto;
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 ease;
22
- overflow: auto;
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",
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",