yummacss 3.1.0 → 3.2.1
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/dist/index.js +1 -0
- package/package.json +60 -58
- package/src/_base.scss +150 -0
- package/src/_fonts.scss +6 -6
- package/src/abstracts/_breakpoints.scss +6 -6
- package/src/abstracts/_theme.scss +18 -17
- package/src/abstracts/_variables.scss +69 -68
- package/src/abstracts/functions/_ignore-neutral.scss +4 -3
- package/src/abstracts/mixins/_create-colors.scss +0 -3
- package/src/abstracts/mixins/_create-utilities.scss +1 -1
- package/src/index.scss +2 -0
- package/src/utilities/_background.scss +2 -2
- package/src/utilities/_border.scss +138 -137
- package/src/utilities/_box-model.scss +33 -33
- package/src/utilities/_color.scss +4 -4
- package/src/utilities/_effect.scss +30 -30
- package/src/utilities/_flexbox.scss +3 -3
- package/src/utilities/_grid.scss +5 -5
- package/src/utilities/_interactivity.scss +20 -20
- package/src/utilities/_outline.scss +12 -12
- package/src/utilities/_positioning.scss +121 -121
- package/src/utilities/_svg.scss +2 -2
- package/src/utilities/_table.scss +2 -2
- package/src/utilities/_transform.scss +2 -2
- package/src/utilities/_typography.scss +20 -20
- package/src/utilities/maps/box-model/_dimension.scss +12 -2
- package/src/utilities/maps/box-model/_height.scss +12 -2
- package/src/utilities/maps/box-model/_margin.scss +3 -2
- package/src/utilities/maps/box-model/_padding.scss +3 -2
- package/src/utilities/maps/box-model/_width.scss +12 -2
- package/src/utilities/maps/flexbox/_flex-basis.scss +2 -2
- package/src/utilities/maps/grid/_gap.scss +1 -1
- package/dist/cli/commands/build.js +0 -43
- package/dist/cli/commands/init.js +0 -17
- package/dist/cli/commands/watch.js +0 -48
- package/dist/cli/config/defaultConfig.js +0 -9
- package/dist/cli/lib/cli-lang.js +0 -23
- package/dist/cli/lib/cli-ui.js +0 -14
- package/dist/cli/services/configLoader.js +0 -16
- package/dist/cli/services/minifyService.js +0 -16
- package/dist/cli/services/purgeService.js +0 -12
- package/dist/cli/services/scssCompiler.js +0 -34
- package/dist/cli/src/cli.js +0 -16
- package/src/reset/_stylecent.scss +0 -231
- package/src/yummacss.scss +0 -4
- /package/src/{yummacss-core.scss → core.scss} +0 -0
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import chok from "chokidar";
|
|
2
|
-
import { globby } from "globby";
|
|
3
|
-
import { messages } from "../lib/cli-lang.js";
|
|
4
|
-
import { cli } from "../lib/cli-ui.js";
|
|
5
|
-
import { loadConfig } from "../services/configLoader.js";
|
|
6
|
-
import { build } from "./build.js";
|
|
7
|
-
let currentConfig;
|
|
8
|
-
let buildTimeout = null;
|
|
9
|
-
let changedFiles = new Set();
|
|
10
|
-
export async function watch() {
|
|
11
|
-
const watchSpinner = cli.startSpinner(messages.watch.start);
|
|
12
|
-
try {
|
|
13
|
-
currentConfig = await loadConfig();
|
|
14
|
-
await build(currentConfig, true);
|
|
15
|
-
const files = await globby(currentConfig.source);
|
|
16
|
-
const watcher = chok.watch(files, {
|
|
17
|
-
awaitWriteFinish: {
|
|
18
|
-
pollInterval: 50,
|
|
19
|
-
stabilityThreshold: 200,
|
|
20
|
-
},
|
|
21
|
-
ignored: /(^|[/\\])\../,
|
|
22
|
-
ignoreInitial: true,
|
|
23
|
-
persistent: true,
|
|
24
|
-
});
|
|
25
|
-
watcher
|
|
26
|
-
.on("add", (path) => handleChange(path, "added"))
|
|
27
|
-
.on("change", (path) => handleChange(path, "changed"))
|
|
28
|
-
.on("unlink", (path) => handleChange(path, "removed"));
|
|
29
|
-
function handleChange(path, event) {
|
|
30
|
-
changedFiles.add(path);
|
|
31
|
-
if (buildTimeout) {
|
|
32
|
-
clearTimeout(buildTimeout);
|
|
33
|
-
}
|
|
34
|
-
buildTimeout = setTimeout(async () => {
|
|
35
|
-
if (changedFiles.size > 0) {
|
|
36
|
-
await build(currentConfig, true);
|
|
37
|
-
changedFiles.clear();
|
|
38
|
-
}
|
|
39
|
-
buildTimeout = null;
|
|
40
|
-
}, 500); // 500ms
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
catch (error) {
|
|
44
|
-
watchSpinner.fail(messages.watch.fail);
|
|
45
|
-
cli.error(error instanceof Error ? error.message : messages.common.unknownError);
|
|
46
|
-
process.exit(1);
|
|
47
|
-
}
|
|
48
|
-
}
|
package/dist/cli/lib/cli-lang.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export const messages = {
|
|
2
|
-
build: {
|
|
3
|
-
start: "Building...",
|
|
4
|
-
compiling: "Compiling...",
|
|
5
|
-
usingCache: "Using cache...",
|
|
6
|
-
purging: "Purging...",
|
|
7
|
-
minifying: "Minifying...",
|
|
8
|
-
success: (ms, output) => `Build done in ${ms}ms. (${output})`,
|
|
9
|
-
fail: "Build failed.",
|
|
10
|
-
},
|
|
11
|
-
init: {
|
|
12
|
-
start: "Creating config...",
|
|
13
|
-
success: "Config created.",
|
|
14
|
-
fail: "Config failed.",
|
|
15
|
-
},
|
|
16
|
-
watch: {
|
|
17
|
-
start: "Watching...",
|
|
18
|
-
fail: "Watch failed.",
|
|
19
|
-
},
|
|
20
|
-
common: {
|
|
21
|
-
unknownError: "Unknown error.",
|
|
22
|
-
},
|
|
23
|
-
};
|
package/dist/cli/lib/cli-ui.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import ora from "ora";
|
|
2
|
-
const spinner = ora({
|
|
3
|
-
spinner: "sand",
|
|
4
|
-
});
|
|
5
|
-
const cli = {
|
|
6
|
-
success: (msg) => console.log(`✔ ${msg}`),
|
|
7
|
-
info: (msg) => console.log(`ℹ ${msg}`),
|
|
8
|
-
error: (msg) => console.log(`✗ ${msg}`),
|
|
9
|
-
startSpinner: (text) => {
|
|
10
|
-
const spinner = ora({ spinner: "sand", color: "white" }).start(text);
|
|
11
|
-
return spinner;
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
export { spinner, cli };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { join } from "path";
|
|
2
|
-
import { pathToFileURL } from "url";
|
|
3
|
-
import { defaultConfig } from "../config/defaultConfig.js";
|
|
4
|
-
export async function loadConfig() {
|
|
5
|
-
const configPath = join(process.cwd(), "yumma.config.js");
|
|
6
|
-
const configUrl = pathToFileURL(configPath).href;
|
|
7
|
-
const { default: userConfig } = (await import(configUrl));
|
|
8
|
-
return {
|
|
9
|
-
...defaultConfig,
|
|
10
|
-
...userConfig,
|
|
11
|
-
buildOptions: {
|
|
12
|
-
...defaultConfig.buildOptions,
|
|
13
|
-
...userConfig.buildOptions,
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { transform } from "lightningcss";
|
|
2
|
-
export function minifyCSS(css, config) {
|
|
3
|
-
try {
|
|
4
|
-
const result = transform({
|
|
5
|
-
filename: "style.css",
|
|
6
|
-
code: Buffer.from(css),
|
|
7
|
-
minify: config.buildOptions.minify,
|
|
8
|
-
sourceMap: false,
|
|
9
|
-
});
|
|
10
|
-
return result.code.toString();
|
|
11
|
-
}
|
|
12
|
-
catch (error) {
|
|
13
|
-
console.error("Minification error:", error);
|
|
14
|
-
throw error;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { globby } from "globby";
|
|
2
|
-
import { PurgeCSS } from "purgecss";
|
|
3
|
-
export async function purgeCSS(css, config) {
|
|
4
|
-
const purgeCSSResult = await new PurgeCSS().purge({
|
|
5
|
-
content: await globby(config.source),
|
|
6
|
-
css: [{ raw: css }],
|
|
7
|
-
defaultExtractor: (content) => {
|
|
8
|
-
return content.match(/[\w-/\\:]+/g) || [];
|
|
9
|
-
},
|
|
10
|
-
});
|
|
11
|
-
return purgeCSSResult[0].css;
|
|
12
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { dirname, join } from "path";
|
|
2
|
-
import { fileURLToPath } from "url";
|
|
3
|
-
import * as sass from "sass-embedded";
|
|
4
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
5
|
-
const __dirname = dirname(__filename);
|
|
6
|
-
const packageRoot = join(__dirname, "../../..");
|
|
7
|
-
export async function compileSCSS(config) {
|
|
8
|
-
const scssFile = config.buildOptions.reset
|
|
9
|
-
? "yummacss.scss"
|
|
10
|
-
: "yummacss-core.scss";
|
|
11
|
-
try {
|
|
12
|
-
const result = await sass.compileAsync(join(packageRoot, "src", scssFile), {
|
|
13
|
-
style: "expanded",
|
|
14
|
-
loadPaths: [join(packageRoot, "src")],
|
|
15
|
-
importers: [
|
|
16
|
-
{
|
|
17
|
-
findFileUrl(url) {
|
|
18
|
-
return new URL(url, `file://${join(packageRoot, "src/")}`);
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
],
|
|
22
|
-
});
|
|
23
|
-
return {
|
|
24
|
-
css: result.css,
|
|
25
|
-
dependencies: result.loadedUrls
|
|
26
|
-
.filter((url) => url.protocol === "file:")
|
|
27
|
-
.map((url) => fileURLToPath(url)),
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
catch (error) {
|
|
31
|
-
console.error("SCSS compilation error:", error);
|
|
32
|
-
throw error;
|
|
33
|
-
}
|
|
34
|
-
}
|
package/dist/cli/src/cli.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Command } from "commander";
|
|
2
|
-
import { build } from "../commands/build.js";
|
|
3
|
-
import { init } from "../commands/init.js";
|
|
4
|
-
import { watch } from "../commands/watch.js";
|
|
5
|
-
const program = new Command();
|
|
6
|
-
program.name("yummacss").description("Yumma CSS CLI");
|
|
7
|
-
program.command("init").description("Create config file.").action(init);
|
|
8
|
-
program
|
|
9
|
-
.command("build")
|
|
10
|
-
.description("Build styles.")
|
|
11
|
-
.action(() => build().catch(() => process.exit(1)));
|
|
12
|
-
program
|
|
13
|
-
.command("watch")
|
|
14
|
-
.description("Build styles automatically.")
|
|
15
|
-
.action(() => watch().catch(() => process.exit(1)));
|
|
16
|
-
program.parse(process.argv);
|
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
@use "../abstracts/variables" as vars;
|
|
2
|
-
|
|
3
|
-
/** -- Box sizing --
|
|
4
|
-
* 1. Use a more intuitive box-sizing model to make the design consistent.
|
|
5
|
-
* 2. Remove default margin and padding.
|
|
6
|
-
* 3. Reset default border styles.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
*,
|
|
10
|
-
*::before,
|
|
11
|
-
*::after {
|
|
12
|
-
box-sizing: border-box; /* 1 */
|
|
13
|
-
border: 0 solid; /* 3 */
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
* {
|
|
17
|
-
margin: 0; /* 2 */
|
|
18
|
-
padding: 0; /* 2 */
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/** -- Document --
|
|
22
|
-
* 1. Improve font smoothing.
|
|
23
|
-
* 2. Set a default system font.
|
|
24
|
-
* 3. Add accessible line-height.
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
body {
|
|
28
|
-
-webkit-font-smoothing: antialiased; /* 1 */
|
|
29
|
-
font-family: vars.$yma-font-system; /* 2 */
|
|
30
|
-
line-height: 1.5; /* 3 */
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/** -- Media Elements --
|
|
34
|
-
* 1. Ensure all media elements like images, videos, and canvases are block-level.
|
|
35
|
-
* 2. Limit their maximum width to the parent container.
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
canvas,
|
|
39
|
-
img,
|
|
40
|
-
picture,
|
|
41
|
-
svg,
|
|
42
|
-
video {
|
|
43
|
-
display: block; /* 1 */
|
|
44
|
-
max-width: 100%; /* 2 */
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/** -- Form Elements --
|
|
48
|
-
* 1. Reset background and border styles for form elements.
|
|
49
|
-
* 2. Use `inherit` to ensure font consistency within forms.
|
|
50
|
-
* 3. Add default padding for usability.
|
|
51
|
-
*/
|
|
52
|
-
|
|
53
|
-
button,
|
|
54
|
-
input,
|
|
55
|
-
optgroup,
|
|
56
|
-
select,
|
|
57
|
-
textarea {
|
|
58
|
-
background-color: vars.$yma-color-transparent; /* 1 */
|
|
59
|
-
font-family: inherit; /* 2 */
|
|
60
|
-
padding: 0.5rem; /* 3 */
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Add a default border to form elements that do not have a class attribute.
|
|
65
|
-
*/
|
|
66
|
-
|
|
67
|
-
button:not([class]),
|
|
68
|
-
input:not([class]),
|
|
69
|
-
optgroup:not([class]),
|
|
70
|
-
select:not([class]),
|
|
71
|
-
textarea:not([class]) {
|
|
72
|
-
border: 1px solid vars.$yma-color-silver; /* 1 */
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Apply consistent focus styles to interactive elements.
|
|
77
|
-
*/
|
|
78
|
-
|
|
79
|
-
a,
|
|
80
|
-
button,
|
|
81
|
-
input,
|
|
82
|
-
select,
|
|
83
|
-
summary,
|
|
84
|
-
textarea {
|
|
85
|
-
&:focus {
|
|
86
|
-
outline: 2px solid vars.$yma-color-transparent;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Set a minimum height for textareas without a defined `rows` attribute.
|
|
92
|
-
*/
|
|
93
|
-
|
|
94
|
-
textarea:not([rows]) {
|
|
95
|
-
min-height: 10em;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Ensure the buttons have a pointer cursor.
|
|
100
|
-
*/
|
|
101
|
-
|
|
102
|
-
button {
|
|
103
|
-
cursor: pointer;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/** Disabled States
|
|
107
|
-
* 1. Reduce opacity and set a "not-allowed" cursor for disabled elements.
|
|
108
|
-
*/
|
|
109
|
-
|
|
110
|
-
button:disabled,
|
|
111
|
-
input:disabled,
|
|
112
|
-
select:disabled,
|
|
113
|
-
textarea:disabled {
|
|
114
|
-
cursor: not-allowed; /* 1 */
|
|
115
|
-
opacity: 0.5; /* 1 */
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/** -- Typography --
|
|
119
|
-
* 1. Avoid text overflows.
|
|
120
|
-
* 2. Improve line wrapping for headings.
|
|
121
|
-
* 3. Add a consistent font weight for bold text.
|
|
122
|
-
*/
|
|
123
|
-
|
|
124
|
-
h1,
|
|
125
|
-
h2,
|
|
126
|
-
h3,
|
|
127
|
-
h4,
|
|
128
|
-
h5,
|
|
129
|
-
h6,
|
|
130
|
-
p {
|
|
131
|
-
overflow-wrap: break-word; /* 1 */
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
h1,
|
|
135
|
-
h2,
|
|
136
|
-
h3,
|
|
137
|
-
h4,
|
|
138
|
-
h5,
|
|
139
|
-
h6 {
|
|
140
|
-
font-size: 1rem; /* 3 */
|
|
141
|
-
font-weight: 600; /* 3 */
|
|
142
|
-
text-wrap: balance; /* 2 */
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
p {
|
|
146
|
-
text-wrap: pretty; /* 2 */
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Add the correct font weight in Chrome, Edge, and Safari.
|
|
151
|
-
*/
|
|
152
|
-
|
|
153
|
-
b,
|
|
154
|
-
strong {
|
|
155
|
-
font-weight: 700;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* Add the correct font size in all browsers.
|
|
160
|
-
*/
|
|
161
|
-
|
|
162
|
-
small {
|
|
163
|
-
font-size: 80%;
|
|
164
|
-
line-height: 1.4;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* 1. Correct the inheritance and scaling of font size in all browsers.
|
|
169
|
-
* 2. Correct the odd `em` font sizing in all browsers.
|
|
170
|
-
*/
|
|
171
|
-
|
|
172
|
-
pre,
|
|
173
|
-
code,
|
|
174
|
-
kbd,
|
|
175
|
-
samp {
|
|
176
|
-
font-family: monospace, monospace; /* 1 */
|
|
177
|
-
font-size: 1em; /* 2 */
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
/** -- Links --
|
|
181
|
-
* 1. Remove underline styling from links by default.
|
|
182
|
-
* 3. Reset color to inherit from parent element.
|
|
183
|
-
*/
|
|
184
|
-
|
|
185
|
-
a {
|
|
186
|
-
color: inherit; /* 3 */
|
|
187
|
-
text-decoration: none; /* 1 */
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
/** -- Lists --
|
|
191
|
-
* Remove default list styling and padding.
|
|
192
|
-
*/
|
|
193
|
-
|
|
194
|
-
ol,
|
|
195
|
-
ul {
|
|
196
|
-
list-style: none;
|
|
197
|
-
padding: 0;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
/** -- Tables --
|
|
201
|
-
* 1. Add a consistent font weight for bold text.
|
|
202
|
-
*/
|
|
203
|
-
|
|
204
|
-
th {
|
|
205
|
-
font-size: 1rem; /* 1 */
|
|
206
|
-
font-weight: 600; /* 1 */
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/** -- Miscellaneous --
|
|
210
|
-
* 1. Add the correct height in Firefox.
|
|
211
|
-
* 2. Correct text decoration.
|
|
212
|
-
* 3. Add spacing around horizontal rules.
|
|
213
|
-
*/
|
|
214
|
-
|
|
215
|
-
hr {
|
|
216
|
-
border-top: 1px solid vars.$yma-color-silver; /* 2 */
|
|
217
|
-
height: 0; /* 1 */
|
|
218
|
-
margin: 1em 0; /* 3 */
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* Ensure details and summary elements display correctly.
|
|
223
|
-
*/
|
|
224
|
-
|
|
225
|
-
details {
|
|
226
|
-
display: block;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
summary {
|
|
230
|
-
display: list-item;
|
|
231
|
-
}
|
package/src/yummacss.scss
DELETED
|
File without changes
|