yummacss 3.1.0 → 3.2.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 (44) hide show
  1. package/dist/index.js +1 -0
  2. package/package.json +60 -58
  3. package/src/{reset/_stylecent.scss → _base.scss} +6 -6
  4. package/src/_fonts.scss +6 -6
  5. package/src/abstracts/_breakpoints.scss +6 -6
  6. package/src/abstracts/_theme.scss +18 -17
  7. package/src/abstracts/_variables.scss +69 -68
  8. package/src/abstracts/functions/_ignore-neutral.scss +4 -3
  9. package/src/abstracts/mixins/_create-colors.scss +0 -3
  10. package/src/abstracts/mixins/_create-utilities.scss +1 -1
  11. package/src/{yummacss.scss → index.scss} +1 -1
  12. package/src/utilities/_background.scss +2 -2
  13. package/src/utilities/_border.scss +138 -137
  14. package/src/utilities/_box-model.scss +33 -33
  15. package/src/utilities/_color.scss +4 -4
  16. package/src/utilities/_effect.scss +30 -30
  17. package/src/utilities/_flexbox.scss +3 -3
  18. package/src/utilities/_grid.scss +5 -5
  19. package/src/utilities/_interactivity.scss +20 -20
  20. package/src/utilities/_outline.scss +12 -12
  21. package/src/utilities/_positioning.scss +121 -121
  22. package/src/utilities/_svg.scss +2 -2
  23. package/src/utilities/_table.scss +2 -2
  24. package/src/utilities/_transform.scss +2 -2
  25. package/src/utilities/_typography.scss +20 -20
  26. package/src/utilities/maps/box-model/_dimension.scss +12 -2
  27. package/src/utilities/maps/box-model/_height.scss +12 -2
  28. package/src/utilities/maps/box-model/_margin.scss +3 -2
  29. package/src/utilities/maps/box-model/_padding.scss +3 -2
  30. package/src/utilities/maps/box-model/_width.scss +12 -2
  31. package/src/utilities/maps/flexbox/_flex-basis.scss +2 -2
  32. package/src/utilities/maps/grid/_gap.scss +1 -1
  33. package/dist/cli/commands/build.js +0 -43
  34. package/dist/cli/commands/init.js +0 -17
  35. package/dist/cli/commands/watch.js +0 -48
  36. package/dist/cli/config/defaultConfig.js +0 -9
  37. package/dist/cli/lib/cli-lang.js +0 -23
  38. package/dist/cli/lib/cli-ui.js +0 -14
  39. package/dist/cli/services/configLoader.js +0 -16
  40. package/dist/cli/services/minifyService.js +0 -16
  41. package/dist/cli/services/purgeService.js +0 -12
  42. package/dist/cli/services/scssCompiler.js +0 -34
  43. package/dist/cli/src/cli.js +0 -16
  44. /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
- }
@@ -1,9 +0,0 @@
1
- const defaultConfig = {
2
- source: [""],
3
- output: "",
4
- buildOptions: {
5
- reset: true,
6
- minify: false,
7
- },
8
- };
9
- export { defaultConfig };
@@ -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
- };
@@ -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
- }
@@ -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);
File without changes