bullframe.css 5.0.1 → 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 (142) hide show
  1. package/CHANGELOG.md +276 -234
  2. package/LICENSE +2 -2
  3. package/README.md +34 -455
  4. package/dist/css/bullframe-classless-dark.css +1218 -932
  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 +1316 -936
  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 +1038 -715
  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 +1943 -1459
  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 +2005 -1489
  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 +769 -491
  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 +1911 -1383
  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 +71 -29
  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/css/bullframe-classless-dark-prefers.css +0 -1340
  40. package/dist/css/bullframe-classless-dark-prefers.css.map +0 -1
  41. package/dist/css/bullframe-classless-dark-prefers.min.css +0 -3
  42. package/dist/css/bullframe-classless-dark-prefers.min.css.map +0 -1
  43. package/dist/css/bullframe-dark-prefers.css +0 -2356
  44. package/dist/css/bullframe-dark-prefers.css.map +0 -1
  45. package/dist/css/bullframe-dark-prefers.min.css +0 -3
  46. package/dist/css/bullframe-dark-prefers.min.css.map +0 -1
  47. package/dist/docs/demo/css/style.css +0 -131
  48. package/dist/docs/demo/icons/android-chrome-192x192.png +0 -0
  49. package/dist/docs/demo/icons/android-chrome-384x384.png +0 -0
  50. package/dist/docs/demo/icons/apple-touch-icon.png +0 -0
  51. package/dist/docs/demo/icons/favicon-16x16.png +0 -0
  52. package/dist/docs/demo/icons/favicon-32x32.png +0 -0
  53. package/dist/docs/demo/icons/favicon.ico +0 -0
  54. package/dist/docs/demo/icons/mstile-150x150.png +0 -0
  55. package/dist/docs/demo/icons/safari-pinned-tab.svg +0 -28
  56. package/dist/docs/demo/images/logo.png +0 -0
  57. package/dist/docs/demo/images/placeholder-img-130x140.jpg +0 -0
  58. package/dist/docs/demo/images/placeholder-img-16x16.jpg +0 -0
  59. package/dist/docs/demo/images/placeholder-img-800x400.jpg +0 -0
  60. package/dist/docs/demo/images/video-poster.png +0 -0
  61. package/dist/docs/demo/index.html +0 -1152
  62. package/dist/docs/github-readme/bf-logo-full-dark.png +0 -0
  63. package/dist/docs/github-readme/bf-logo-full-light.png +0 -0
  64. package/prettier.config.js +0 -26
  65. package/src/docs/demo/css/style.css +0 -131
  66. package/src/docs/demo/icons/android-chrome-192x192.png +0 -0
  67. package/src/docs/demo/icons/android-chrome-384x384.png +0 -0
  68. package/src/docs/demo/icons/apple-touch-icon.png +0 -0
  69. package/src/docs/demo/icons/favicon-16x16.png +0 -0
  70. package/src/docs/demo/icons/favicon-32x32.png +0 -0
  71. package/src/docs/demo/icons/favicon.ico +0 -0
  72. package/src/docs/demo/icons/mstile-150x150.png +0 -0
  73. package/src/docs/demo/icons/safari-pinned-tab.svg +0 -28
  74. package/src/docs/demo/images/logo.png +0 -0
  75. package/src/docs/demo/images/placeholder-img-130x140.jpg +0 -0
  76. package/src/docs/demo/images/placeholder-img-16x16.jpg +0 -0
  77. package/src/docs/demo/images/placeholder-img-800x400.jpg +0 -0
  78. package/src/docs/demo/images/video-poster.png +0 -0
  79. package/src/docs/demo/index.html +0 -1152
  80. package/src/docs/github-readme/bf-logo-full-dark.png +0 -0
  81. package/src/docs/github-readme/bf-logo-full-light.png +0 -0
  82. package/src/scss/bullframe-classless-dark-prefers.scss +0 -2
  83. package/src/scss/bullframe-classless-dark.scss +0 -2
  84. package/src/scss/bullframe-classless-system-default.scss +0 -2
  85. package/src/scss/bullframe-classless.scss +0 -49
  86. package/src/scss/bullframe-dark-prefers.scss +0 -2
  87. package/src/scss/bullframe-dark.scss +0 -2
  88. package/src/scss/bullframe-system-default.scss +0 -2
  89. package/src/scss/bullframe-utilities.scss +0 -21
  90. package/src/scss/bullframe.scss +0 -49
  91. package/src/scss/custom/_author-styles.scss +0 -5
  92. package/src/scss/forms/_forms-normalization.scss +0 -316
  93. package/src/scss/forms/_forms-styling-radio-checkbox.scss +0 -82
  94. package/src/scss/forms/_forms-styling-range.scss +0 -113
  95. package/src/scss/forms/_forms-styling-select.scss +0 -65
  96. package/src/scss/forms/_forms-styling.scss +0 -131
  97. package/src/scss/miscellaneous/_misc-accessibility.scss +0 -36
  98. package/src/scss/miscellaneous/_misc-anchors.scss +0 -37
  99. package/src/scss/miscellaneous/_misc-embedded-content.scss +0 -117
  100. package/src/scss/miscellaneous/_misc-focus.scss +0 -79
  101. package/src/scss/miscellaneous/_misc-interactive.scss +0 -48
  102. package/src/scss/miscellaneous/_misc-layout.scss +0 -30
  103. package/src/scss/miscellaneous/_misc-lists.scss +0 -53
  104. package/src/scss/miscellaneous/_misc-scrolling.scss +0 -5
  105. package/src/scss/miscellaneous/_misc-shame.scss +0 -37
  106. package/src/scss/miscellaneous/_misc-tables.scss +0 -53
  107. package/src/scss/mixins/_mixin-dark-prefers.scss +0 -414
  108. package/src/scss/mixins/_mixin-dark.scss +0 -396
  109. package/src/scss/mixins/_mixin-grid-flex.scss +0 -80
  110. package/src/scss/mixins/_mixin-layout.scss +0 -42
  111. package/src/scss/mixins/_mixin-texts.scss +0 -37
  112. package/src/scss/typography/_typography-blockquotes.scss +0 -28
  113. package/src/scss/typography/_typography-headings.scss +0 -45
  114. package/src/scss/typography/_typography-html-body.scss +0 -75
  115. package/src/scss/typography/_typography-misc.scss +0 -90
  116. package/src/scss/typography/_typography-monospaced-elements.scss +0 -59
  117. package/src/scss/utilities/_utility-buttons.scss +0 -73
  118. package/src/scss/utilities/_utility-debugging.scss +0 -31
  119. package/src/scss/utilities/_utility-embeds.scss +0 -34
  120. package/src/scss/utilities/_utility-filters.scss +0 -21
  121. package/src/scss/utilities/_utility-form-states.scss +0 -89
  122. package/src/scss/utilities/_utility-global-dark-classless.scss +0 -3
  123. package/src/scss/utilities/_utility-global-dark-prefers-classless.scss +0 -3
  124. package/src/scss/utilities/_utility-global-dark-prefers.scss +0 -3
  125. package/src/scss/utilities/_utility-global-dark-scrollbars.scss +0 -34
  126. package/src/scss/utilities/_utility-global-dark.scss +0 -4
  127. package/src/scss/utilities/_utility-global-system-default-classless.scss +0 -3
  128. package/src/scss/utilities/_utility-global-system-default.scss +0 -3
  129. package/src/scss/utilities/_utility-grid-system.scss +0 -140
  130. package/src/scss/utilities/_utility-layout.scss +0 -187
  131. package/src/scss/utilities/_utility-lists.scss +0 -17
  132. package/src/scss/utilities/_utility-print.scss +0 -101
  133. package/src/scss/utilities/_utility-reduced-motion.scss +0 -29
  134. package/src/scss/utilities/_utility-spacing.scss +0 -148
  135. package/src/scss/utilities/_utility-tables.scss +0 -34
  136. package/src/scss/utilities/_utility-texts.scss +0 -225
  137. package/src/scss/utilities/_utility-z-index.scss +0 -83
  138. package/src/scss/variables/_variables-breakpoints.scss +0 -6
  139. package/src/scss/variables/_variables-colors.scss +0 -34
  140. package/src/scss/variables/_variables-spacing.scss +0 -24
  141. package/src/scss/variables/_variables-texts.scss +0 -8
  142. package/vite.config.js +0 -116
@@ -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,116 +0,0 @@
1
- import { defineConfig } from "vite";
2
- import autoprefixer from "autoprefixer";
3
- import cssnano from "cssnano";
4
- import path from "path";
5
- import fs from "fs";
6
- import { glob } from "glob";
7
- import * as sass from "sass"; // Needed for compileAsync
8
- import postcss from "postcss";
9
-
10
- function buildAllScss() {
11
- return {
12
- name: "build-all-scss",
13
- async closeBundle() {
14
- const files = await glob("src/scss/**/*.scss");
15
-
16
- const scssFiles = files.filter(
17
- (file) => !path.basename(file).startsWith("_")
18
- );
19
-
20
- for (const file of scssFiles) {
21
- const name = path.basename(file, ".scss");
22
- const outDir = "dist/css";
23
- const outFile = path.join(outDir, `${name}.css`);
24
- const minFile = path.join(outDir, `${name}.min.css`);
25
-
26
- const result = await sass.compileAsync(file, {
27
- style: "expanded",
28
- sourceMap: true,
29
- });
30
-
31
- const cssWithHeader =
32
- `/*! Bullframe CSS v5.0.0 | MIT License | https://github.com/marcop135/bullframe.css */\n` +
33
- result.css;
34
-
35
- const postcssResult = await postcss([autoprefixer()]).process(
36
- cssWithHeader,
37
- {
38
- from: file,
39
- to: outFile,
40
- map: {
41
- prev: result.sourceMap,
42
- inline: false,
43
- },
44
- }
45
- );
46
-
47
- fs.mkdirSync(outDir, { recursive: true });
48
- fs.writeFileSync(outFile, postcssResult.css);
49
- fs.writeFileSync(`${outFile}.map`, postcssResult.map.toString());
50
-
51
- const minified = await postcss([autoprefixer(), cssnano()]).process(
52
- cssWithHeader,
53
- {
54
- from: file,
55
- to: minFile,
56
- map: { inline: false },
57
- }
58
- );
59
-
60
- fs.writeFileSync(minFile, minified.css);
61
- fs.writeFileSync(`${minFile}.map`, minified.map.toString());
62
- }
63
- },
64
- };
65
- }
66
-
67
- function copyDocsFiles() {
68
- return {
69
- name: "copy-docs-files",
70
- closeBundle() {
71
- const srcDir = path.resolve(__dirname, "src/docs");
72
- const destDir = path.resolve(__dirname, "dist/docs");
73
-
74
- function copyRecursive(src, dest) {
75
- if (!fs.existsSync(dest)) fs.mkdirSync(dest, { recursive: true });
76
-
77
- const entries = fs.readdirSync(src, { withFileTypes: true });
78
-
79
- for (const entry of entries) {
80
- const srcPath = path.join(src, entry.name);
81
- const destPath = path.join(dest, entry.name);
82
-
83
- if (entry.isDirectory()) {
84
- copyRecursive(srcPath, destPath);
85
- } else {
86
- fs.copyFileSync(srcPath, destPath);
87
- }
88
- }
89
- }
90
-
91
- copyRecursive(srcDir, destDir);
92
- },
93
- };
94
- }
95
-
96
- export default defineConfig({
97
- root: "src",
98
- build: {
99
- outDir: "../dist",
100
- emptyOutDir: true,
101
- rollupOptions: {
102
- input: path.resolve(__dirname, "src/docs/demo/index.html"),
103
- output: {
104
- entryFileNames: `[name].js`,
105
- chunkFileNames: `[name].js`,
106
- assetFileNames: `[name][extname]`,
107
- },
108
- },
109
- assetsDir: "", // Avoid dist/assets
110
- sourcemap: true,
111
- },
112
- plugins: [buildAllScss(), copyDocsFiles()],
113
- server: {
114
- open: "/docs/demo/index.html",
115
- },
116
- });