bullframe.css 5.1.0 → 6.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.
Files changed (117) hide show
  1. package/CHANGELOG.md +39 -2
  2. package/LICENSE +1 -1
  3. package/README.md +34 -458
  4. package/dist/css/bullframe-classless-dark.css +1270 -909
  5. package/dist/css/bullframe-classless-dark.css.map +1 -1
  6. package/dist/css/bullframe-classless-dark.min.css +1 -3
  7. package/dist/css/bullframe-classless-dark.min.css.map +1 -1
  8. package/dist/css/bullframe-classless-system-default.css +1339 -899
  9. package/dist/css/bullframe-classless-system-default.css.map +1 -1
  10. package/dist/css/bullframe-classless-system-default.min.css +1 -3
  11. package/dist/css/bullframe-classless-system-default.min.css.map +1 -1
  12. package/dist/css/bullframe-classless.css +1098 -713
  13. package/dist/css/bullframe-classless.css.map +1 -1
  14. package/dist/css/bullframe-classless.min.css +1 -3
  15. package/dist/css/bullframe-classless.min.css.map +1 -1
  16. package/dist/css/bullframe-dark.css +2105 -1541
  17. package/dist/css/bullframe-dark.css.map +1 -1
  18. package/dist/css/bullframe-dark.min.css +1 -3
  19. package/dist/css/bullframe-dark.min.css.map +1 -1
  20. package/dist/css/bullframe-system-default.css +2107 -1529
  21. package/dist/css/bullframe-system-default.css.map +1 -1
  22. package/dist/css/bullframe-system-default.min.css +1 -3
  23. package/dist/css/bullframe-system-default.min.css.map +1 -1
  24. package/dist/css/bullframe-utilities.css +766 -490
  25. package/dist/css/bullframe-utilities.css.map +1 -1
  26. package/dist/css/bullframe-utilities.min.css +1 -2
  27. package/dist/css/bullframe-utilities.min.css.map +1 -1
  28. package/dist/css/bullframe.css +1900 -1310
  29. package/dist/css/bullframe.css.map +1 -1
  30. package/dist/css/bullframe.min.css +1 -3
  31. package/dist/css/bullframe.min.css.map +1 -1
  32. package/package.json +70 -28
  33. package/.browserslistrc +0 -3
  34. package/.editorconfig +0 -15
  35. package/.htmlhintrc +0 -12
  36. package/.prettierignore +0 -1
  37. package/.stylelintignore +0 -3
  38. package/.stylelintrc.json +0 -26
  39. package/dist/apple-touch-icon.png +0 -0
  40. package/dist/css/bullframe-classless-dark-prefers.css +0 -1280
  41. package/dist/css/bullframe-classless-dark-prefers.css.map +0 -1
  42. package/dist/css/bullframe-classless-dark-prefers.min.css +0 -3
  43. package/dist/css/bullframe-classless-dark-prefers.min.css.map +0 -1
  44. package/dist/css/bullframe-dark-prefers.css +0 -2296
  45. package/dist/css/bullframe-dark-prefers.css.map +0 -1
  46. package/dist/css/bullframe-dark-prefers.min.css +0 -3
  47. package/dist/css/bullframe-dark-prefers.min.css.map +0 -1
  48. package/dist/docs/demo/index.html +0 -1154
  49. package/dist/favicon-16x16.png +0 -0
  50. package/dist/favicon-32x32.png +0 -0
  51. package/dist/favicon.ico +0 -0
  52. package/dist/index.css +0 -1
  53. package/dist/index.js.map +0 -1
  54. package/dist/placeholder-img-800x400.jpg +0 -0
  55. package/dist/video-poster.png +0 -0
  56. package/prettier.config.js +0 -26
  57. package/src/scss/bullframe-classless-dark-prefers.scss +0 -2
  58. package/src/scss/bullframe-classless-dark.scss +0 -2
  59. package/src/scss/bullframe-classless-system-default.scss +0 -2
  60. package/src/scss/bullframe-classless.scss +0 -49
  61. package/src/scss/bullframe-dark-prefers.scss +0 -2
  62. package/src/scss/bullframe-dark.scss +0 -2
  63. package/src/scss/bullframe-system-default.scss +0 -2
  64. package/src/scss/bullframe-utilities.scss +0 -21
  65. package/src/scss/bullframe.scss +0 -49
  66. package/src/scss/custom/_author-styles.scss +0 -5
  67. package/src/scss/forms/_forms-normalization.scss +0 -300
  68. package/src/scss/forms/_forms-styling-radio-checkbox.scss +0 -81
  69. package/src/scss/forms/_forms-styling-range.scss +0 -106
  70. package/src/scss/forms/_forms-styling-select.scss +0 -58
  71. package/src/scss/forms/_forms-styling.scss +0 -118
  72. package/src/scss/miscellaneous/_misc-accessibility.scss +0 -36
  73. package/src/scss/miscellaneous/_misc-anchors.scss +0 -37
  74. package/src/scss/miscellaneous/_misc-embedded-content.scss +0 -117
  75. package/src/scss/miscellaneous/_misc-focus.scss +0 -80
  76. package/src/scss/miscellaneous/_misc-interactive.scss +0 -48
  77. package/src/scss/miscellaneous/_misc-layout.scss +0 -30
  78. package/src/scss/miscellaneous/_misc-lists.scss +0 -53
  79. package/src/scss/miscellaneous/_misc-scrolling.scss +0 -5
  80. package/src/scss/miscellaneous/_misc-shame.scss +0 -37
  81. package/src/scss/miscellaneous/_misc-tables.scss +0 -53
  82. package/src/scss/mixins/_mixin-dark-prefers.scss +0 -413
  83. package/src/scss/mixins/_mixin-dark.scss +0 -415
  84. package/src/scss/mixins/_mixin-grid-flex.scss +0 -80
  85. package/src/scss/mixins/_mixin-layout.scss +0 -42
  86. package/src/scss/mixins/_mixin-texts.scss +0 -37
  87. package/src/scss/typography/_typography-blockquotes.scss +0 -28
  88. package/src/scss/typography/_typography-headings.scss +0 -45
  89. package/src/scss/typography/_typography-html-body.scss +0 -75
  90. package/src/scss/typography/_typography-misc.scss +0 -90
  91. package/src/scss/typography/_typography-monospaced-elements.scss +0 -59
  92. package/src/scss/utilities/_utility-buttons.scss +0 -73
  93. package/src/scss/utilities/_utility-debugging.scss +0 -31
  94. package/src/scss/utilities/_utility-embeds.scss +0 -34
  95. package/src/scss/utilities/_utility-filters.scss +0 -21
  96. package/src/scss/utilities/_utility-form-states.scss +0 -89
  97. package/src/scss/utilities/_utility-global-dark-classless.scss +0 -3
  98. package/src/scss/utilities/_utility-global-dark-prefers-classless.scss +0 -3
  99. package/src/scss/utilities/_utility-global-dark-prefers.scss +0 -3
  100. package/src/scss/utilities/_utility-global-dark-scrollbars.scss +0 -34
  101. package/src/scss/utilities/_utility-global-dark.scss +0 -4
  102. package/src/scss/utilities/_utility-global-system-default-classless.scss +0 -3
  103. package/src/scss/utilities/_utility-global-system-default.scss +0 -3
  104. package/src/scss/utilities/_utility-grid-system.scss +0 -140
  105. package/src/scss/utilities/_utility-layout.scss +0 -187
  106. package/src/scss/utilities/_utility-lists.scss +0 -17
  107. package/src/scss/utilities/_utility-print.scss +0 -101
  108. package/src/scss/utilities/_utility-reduced-motion.scss +0 -29
  109. package/src/scss/utilities/_utility-spacing.scss +0 -148
  110. package/src/scss/utilities/_utility-tables.scss +0 -34
  111. package/src/scss/utilities/_utility-texts.scss +0 -225
  112. package/src/scss/utilities/_utility-z-index.scss +0 -83
  113. package/src/scss/variables/_variables-breakpoints.scss +0 -6
  114. package/src/scss/variables/_variables-colors.scss +0 -34
  115. package/src/scss/variables/_variables-spacing.scss +0 -24
  116. package/src/scss/variables/_variables-texts.scss +0 -8
  117. package/vite.config.js +0 -148
@@ -1,225 +0,0 @@
1
- @use '../variables/variables-colors' as bf-v-color;
2
- @use '../variables/variables-texts' as bf-v-text;
3
- @use '../variables/variables-spacing' as bf-v-space;
4
- @use '../variables/variables-breakpoints' as bf-v-bp;
5
- @use 'sass:color';
6
-
7
- .bf-t-transform-uppercase {
8
- text-transform: uppercase !important;
9
- }
10
-
11
- .bf-t-transform-none {
12
- text-transform: none !important;
13
- }
14
-
15
- .bf-t-left {
16
- text-align: left !important;
17
- }
18
-
19
- .bf-t-center {
20
- text-align: center !important;
21
- }
22
-
23
- .bf-t-right {
24
- text-align: right !important;
25
- }
26
-
27
- .bf-t-shadow {
28
- text-shadow: 0 0 2px bf-v-color.$bf-dark !important;
29
- text-shadow: 0 0 0.2rem bf-v-color.$bf-dark !important;
30
- }
31
-
32
- .bf-t-italic {
33
- font-style: italic !important;
34
- }
35
-
36
- // useful to 'reset' <i> inherited style
37
- .bf-t-style-normal {
38
- font-style: normal !important;
39
- }
40
-
41
- // useful to 'reset' <b> inherited style
42
- .bf-t-weight-300 {
43
- font-weight: 300 !important;
44
- }
45
-
46
- .bf-t-weight-400 {
47
- font-weight: 400 !important;
48
- }
49
-
50
- .bf-t-weight-500 {
51
- font-weight: 500 !important;
52
- }
53
-
54
- .bf-t-weight-600 {
55
- font-weight: 600 !important;
56
- }
57
-
58
- .bf-t-weight-700 {
59
- font-weight: 700 !important;
60
- }
61
-
62
- .bf-t-weight-800 {
63
- font-weight: 800 !important;
64
- }
65
-
66
- .bf-text-break {
67
- word-wrap: break-word !important;
68
- }
69
-
70
- .bf-t-truncate {
71
- max-width: 100% !important;
72
- overflow: hidden !important;
73
- text-overflow: ellipsis !important;
74
- white-space: nowrap !important;
75
- word-wrap: normal !important;
76
- }
77
-
78
- .bf-t-truncate--multiline-2 {
79
- overflow: hidden !important;
80
- text-overflow: ellipsis !important;
81
- display: -webkit-box !important;
82
- line-clamp: 2 !important;
83
- -webkit-line-clamp: 2 !important;
84
- -webkit-box-orient: vertical !important;
85
- }
86
-
87
- .bf-t-truncate--multiline-3 {
88
- overflow: hidden !important;
89
- text-overflow: ellipsis !important;
90
- display: -webkit-box !important;
91
- line-clamp: 3 !important;
92
- -webkit-line-clamp: 3 !important;
93
- -webkit-box-orient: vertical !important;
94
- }
95
-
96
- .bf-no-select {
97
- user-select: none !important;
98
-
99
- // this is a not standard CSS property, so it's for webkit only
100
- // https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-touch-callout
101
- // useful on iOS
102
- // https://css-tricks.com/force-selection-text-block/#article-header-id-7
103
- // https://ishadeed.com/article/selection-in-css scroll down to
104
- // 'selection on mobile' section
105
- -webkit-touch-callout: none !important;
106
- }
107
-
108
- .bf-font-sans-serif {
109
- font-family:
110
- /* Safari for OS X and iOS (San Francisco) */
111
- -apple-system,
112
- /* Chrome < 56 for OS X (San Francisco) */ BlinkMacSystemFont,
113
- /* Windows */ 'Segoe UI',
114
- /* Android */ Roboto,
115
- /* Linux with KDE */ Oxygen-Sans,
116
- /* Ubuntu (all variants) */ Ubuntu,
117
- /* Linux with GNOME Shell */ Cantarell,
118
- /* macOS 1.10 and below */ 'Helvetica Neue',
119
- Helvetica,
120
- /* Basic web fallback */ Arial,
121
- sans-serif,
122
- /* emoji fonts */ 'Apple Color Emoji',
123
- 'Segoe UI Emoji',
124
- 'Segoe UI Symbol',
125
- 'Noto Color Emoji' !important;
126
- }
127
-
128
- .bf-font-serif {
129
- font-family:
130
- Georgia,
131
- Times,
132
- 'Times New Roman',
133
- serif,
134
- /* emoji fonts */ 'Apple Color Emoji',
135
- 'Segoe UI Emoji',
136
- 'Segoe UI Symbol',
137
- 'Noto Color Emoji' !important;
138
- }
139
-
140
- .bf-font-monospace {
141
- font-family:
142
- /* macOS 1.10+ */
143
- Menlo,
144
- Consolas,
145
- 'Roboto Mono',
146
- 'Ubuntu Monospace',
147
- 'Noto Mono',
148
- 'Oxygen Mono',
149
- 'Liberation Mono',
150
- monospace,
151
- 'Apple Color Emoji',
152
- 'Segoe UI Emoji',
153
- 'Segoe UI Symbol',
154
- 'Noto Color Emoji' !important;
155
- }
156
-
157
- .bf-h1,
158
- .bf-h2,
159
- .bf-h3,
160
- .bf-h4,
161
- .bf-h5,
162
- .bf-h6 { // fallback
163
- font-weight: 600 !important;
164
- margin-top: 0 !important;
165
- line-height: 1.2 !important;
166
- margin-bottom: bf-v-space.$bf-spacing-lg-px !important;
167
- margin-bottom: bf-v-space.$bf-spacing-lg-rem !important;
168
- }
169
-
170
- .bf-h1 {
171
- font-size: 36px !important;
172
- font-size: 3.6rem !important;
173
- }
174
-
175
- .bf-h2 {
176
- font-size: 30px !important;
177
- font-size: 3rem !important;
178
- }
179
-
180
- .bf-h3 {
181
- font-size: 24px !important;
182
- font-size: 2.4rem !important;
183
- }
184
-
185
- .bf-h4 {
186
- font-size: 20px !important;
187
- font-size: 2rem !important;
188
- }
189
-
190
- .bf-h5,
191
- .bf-h6 {
192
- font-size: 16px !important;
193
- font-size: 1.6rem !important;
194
- }
195
-
196
- p.bf-lead {
197
- font-size: 120% !important;
198
- }
199
-
200
- // responsive typography
201
- // https://codepen.io/marcop135/pen/eYmPmJm
202
- // https://css-tricks.com/snippets/css/fluid-typography/
203
- //
204
- // old browsers that don't support CSS variables ignore what follows
205
- // (mostly IE and Opera Mini)
206
- // in this way, old browsers will ignore 'calc' property too, avoiding issues
207
- // https://caniuse.com/#feat=calc
208
- // https://caniuse.com/#feat=css-variables
209
- // https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties
210
- body.bf-responsive-typography {
211
- --body-rt-font-size-flex: calc(1.5rem + 3 * ((100vw - 320px) / 680));
212
- --body-rt-font-size-max: 1.8rem;
213
- }
214
-
215
- @media (min-width: 320px) {
216
- body.bf-responsive-typography {
217
- font-size: var(--body-rt-font-size-flex);
218
- }
219
- }
220
-
221
- @media (min-width: 1000px) {
222
- body.bf-responsive-typography {
223
- font-size: var(--body-rt-font-size-max);
224
- }
225
- }
@@ -1,83 +0,0 @@
1
- .bf-z-index-1 {
2
- z-index: 1;
3
- }
4
-
5
- .bf-z-index-2 {
6
- z-index: 2;
7
- }
8
-
9
- .bf-z-index-3 {
10
- z-index: 3;
11
- }
12
-
13
- .bf-z-index-4 {
14
- z-index: 4;
15
- }
16
-
17
- .bf-z-index-5 {
18
- z-index: 5;
19
- }
20
-
21
- .bf-z-index-6 {
22
- z-index: 6;
23
- }
24
-
25
- .bf-z-index-7 {
26
- z-index: 7;
27
- }
28
-
29
- .bf-z-index-8 {
30
- z-index: 8;
31
- }
32
-
33
- .bf-z-index-9 {
34
- z-index: 9;
35
- }
36
-
37
- .bf-z-index-10 {
38
- z-index: 10;
39
- }
40
-
41
- .bf-z-index-20 {
42
- z-index: 20;
43
- }
44
-
45
- .bf-z-index-30 {
46
- z-index: 30;
47
- }
48
-
49
- .bf-z-index-40 {
50
- z-index: 40;
51
- }
52
-
53
- .bf-z-index-50 {
54
- z-index: 50;
55
- }
56
-
57
- .bf-z-index-60 {
58
- z-index: 60;
59
- }
60
-
61
- .bf-z-index-70 {
62
- z-index: 70;
63
- }
64
-
65
- .bf-z-index-80 {
66
- z-index: 80;
67
- }
68
-
69
- .bf-z-index-90 {
70
- z-index: 90;
71
- }
72
-
73
- .bf-z-index-100 {
74
- z-index: 100;
75
- }
76
-
77
- .bf-z-index-200 {
78
- z-index: 200;
79
- }
80
-
81
- .bf-z-index-300 {
82
- z-index: 200;
83
- }
@@ -1,6 +0,0 @@
1
- $bf-breakpoint-xs: 0;
2
- $bf-breakpoint-sm: 576px;
3
- $bf-breakpoint-md: 768px;
4
- $bf-breakpoint-lg: 992px;
5
- $bf-breakpoint-xl: 1200px;
6
- $bf-breakpoint-xxl: 1400px;
@@ -1,34 +0,0 @@
1
- @use 'sass:color';
2
-
3
- // TIP: make colors lighter/darker with Sass
4
- // https://sass-lang.com/documentation/modules/color/
5
- // e.g., lighter: "color: color.adjust($gray, $lightness: 15%);"
6
- // e.g., darker: "color: color.adjust($gray, $lightness: -15%);"
7
-
8
- // customise/enlarge this small selection as needed
9
-
10
- // hex to rgba online converter http://www.hex2rgba.devoth.com/
11
-
12
- // backgrounds, texts and borders
13
- $bf-white: #fff; // rgba(255,255,255,1)
14
- $bf-light: #f0f0f0; // rgba(240,240,240,1)
15
- $bf-gray-light-extra: #e9e9e9; // rgba(233,233,233,1)
16
- $bf-gray-light: #ccc; // rgba(204,204,204,1)
17
- $bf-gray: #999; // rgba(153,153,153,1)
18
- $bf-gray-dark: #666; // rgba(102,102,102,1)
19
- $bf-gray-dark-extra: #333; // rgba(51,51,51,1)
20
- $bf-dark: #222; // rgba(34,34,34,1)
21
- $bf-dark-extra: #111; // rgba(17,17,17,1)
22
- $bf-black: #000; // rgba(0,0,0,1)
23
-
24
- // <mark> and <ins>
25
- $bf-yellow-light: #ff9; // rgba(255,255,153,1)
26
- $bf-yellow: #ff0; // rgba(255,255,0,1)
27
-
28
- // anchors and accent
29
- $bf-blue: #007bff; // rgba(0,123,255,1)
30
- $bf-blue-light: #0056b3; // rgba(0,86,179,1)
31
- $bf-blue-light-extra: #bed8fe; // rgba(190, 216, 254, 1)
32
-
33
- // invalid forms
34
- $bf-red: #f00; // rgba(255,0,0,1)
@@ -1,24 +0,0 @@
1
- // customise this spacing selection as needed
2
-
3
- // the REM unit is the default,
4
- // preceded by the PX unit as fallback for old browsers (IE)
5
- // https://caniuse.com/#search=rem
6
- //
7
- // e.g.
8
- // html { font-size: 62.5%; }
9
- // body { font-size: 16px; }
10
- // h1 { font-size: 30px; font-size: 3rem; }
11
-
12
- $bf-spacing-sm-px: 2.5px;
13
- $bf-spacing-md-px: 5px;
14
- $bf-spacing-lg-px: 10px;
15
- $bf-spacing-xl-px: 20px;
16
- $bf-spacing-xxl-px: 30px;
17
- $bf-spacing-sm-rem: 0.25rem;
18
- $bf-spacing-md-rem: 0.5rem;
19
- $bf-spacing-lg-rem: 1rem;
20
- $bf-spacing-xl-rem: 2rem;
21
- $bf-spacing-xxl-rem: 3rem;
22
-
23
- // ! grid system only
24
- $bf-spacing-grid-gutter-rem: 1.5rem;
@@ -1,8 +0,0 @@
1
- $bf-font-sans-serif:
2
- -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell,
3
- 'Helvetica Neue', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
4
- 'Segoe UI Symbol', 'Noto Color Emoji';
5
- $bf-font-serif: Georgia, Times, 'Times New Roman', serif;
6
- $bf-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
7
- $bf-body-font-size-rem: 1.6rem;
8
- $bf-body-line-height: 1.5;
package/vite.config.js DELETED
@@ -1,148 +0,0 @@
1
- // Vite config tools and dependencies
2
- import { defineConfig } from "vite";
3
- import autoprefixer from "autoprefixer";
4
- import cssnano from "cssnano";
5
- import path from "path";
6
- import fs from "fs";
7
- import { glob } from "glob";
8
- import * as sass from "sass";
9
- import postcss from "postcss";
10
-
11
- // Custom PostCSS plugin: adds license header as a comment at the top of each CSS file
12
- const addHeader = () => {
13
- return {
14
- postcssPlugin: "add-header",
15
- Once(root) {
16
- root.prepend({
17
- type: "comment",
18
- text: "! Bullframe CSS v5.1.0 | MIT License | https://github.com/marcop135/bullframe.css ",
19
- });
20
- },
21
- };
22
- };
23
- addHeader.postcss = true;
24
-
25
- // Custom Vite plugin: compiles all SCSS files (except partials) to CSS and minified CSS
26
- function buildAllScss() {
27
- return {
28
- name: "build-all-scss",
29
- async closeBundle() {
30
- // Find all SCSS files in src/scss (excluding partials that start with _)
31
- const files = await glob("src/scss/**/*.scss");
32
- const scssFiles = files.filter(
33
- (file) => !path.basename(file).startsWith("_")
34
- );
35
-
36
- // Output directory for generated CSS
37
- const outDir = path.resolve("dist/css");
38
- fs.mkdirSync(outDir, { recursive: true });
39
-
40
- // Compile and process each SCSS file
41
- for (const file of scssFiles) {
42
- const name = path.basename(file, ".scss");
43
- const outFile = path.join(outDir, `${name}.css`);
44
- const minFile = path.join(outDir, `${name}.min.css`);
45
-
46
- // Step 1: Compile SCSS to CSS with source maps
47
- const result = await sass.compileAsync(file, {
48
- style: "expanded",
49
- sourceMap: true,
50
- sourceMapIncludeSources: true,
51
- });
52
-
53
- // Step 2: Run PostCSS with header + autoprefixer
54
- const postcssResult = await postcss([
55
- addHeader(),
56
- autoprefixer(),
57
- ]).process(result.css, {
58
- from: path.resolve(file),
59
- to: outFile,
60
- map: {
61
- prev: result.sourceMap ? JSON.stringify(result.sourceMap) : false,
62
- inline: false,
63
- annotation: true,
64
- },
65
- });
66
-
67
- // Write normal CSS and source map
68
- fs.writeFileSync(outFile, postcssResult.css);
69
- if (postcssResult.map) {
70
- fs.writeFileSync(`${outFile}.map`, postcssResult.map.toString());
71
- }
72
-
73
- // Step 3: Minify with cssnano + autoprefixer (again) + source maps
74
- const minified = await postcss([autoprefixer(), cssnano()]).process(
75
- postcssResult.css,
76
- {
77
- from: outFile,
78
- to: minFile,
79
- map: {
80
- prev: postcssResult.map ? postcssResult.map.toString() : false,
81
- inline: false,
82
- annotation: true,
83
- },
84
- }
85
- );
86
-
87
- // Write minified CSS and source map
88
- fs.writeFileSync(minFile, minified.css);
89
- if (minified.map) {
90
- fs.writeFileSync(`${minFile}.map`, minified.map.toString());
91
- }
92
- }
93
- },
94
- };
95
- }
96
-
97
- // Copy static files from src/docs to dist/docs (e.g. demo HTML, images, etc.)
98
- function copyDocsFiles() {
99
- return {
100
- name: "copy-docs-files",
101
- closeBundle() {
102
- const srcDir = path.resolve(__dirname, "src/docs");
103
- const destDir = path.resolve(__dirname, "dist/docs");
104
-
105
- function copyRecursive(src, dest) {
106
- if (!fs.existsSync(dest)) fs.mkdirSync(dest, { recursive: true });
107
-
108
- const entries = fs.readdirSync(src, { withFileTypes: true });
109
-
110
- for (const entry of entries) {
111
- const srcPath = path.join(src, entry.name);
112
- const destPath = path.join(dest, entry.name);
113
-
114
- if (entry.isDirectory()) {
115
- copyRecursive(srcPath, destPath);
116
- } else {
117
- fs.copyFileSync(srcPath, destPath);
118
- }
119
- }
120
- }
121
-
122
- copyRecursive(srcDir, destDir);
123
- },
124
- };
125
- }
126
-
127
- // Main Vite config
128
- export default defineConfig({
129
- root: "src", // Vite project root
130
- build: {
131
- outDir: "../dist", // Output directory
132
- emptyOutDir: true, // Clean before build
133
- rollupOptions: {
134
- input: path.resolve(__dirname, "src/docs/demo/index.html"), // Entry point for HTML
135
- output: {
136
- entryFileNames: `[name].js`,
137
- chunkFileNames: `[name].js`,
138
- assetFileNames: `[name][extname]`, // Keep asset file names flat
139
- },
140
- },
141
- assetsDir: "", // No subdir for assets
142
- sourcemap: true, // Enable source maps
143
- },
144
- plugins: [buildAllScss()], // Use the custom SCSS build plugin
145
- server: {
146
- open: "/docs/demo/index.html", // Dev server opens demo page
147
- },
148
- });