@stackoverflow/stacks 1.10.3 → 2.0.0-rc.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/README.md +15 -0
- package/dist/css/stacks.css +7428 -4429
- package/dist/css/stacks.min.css +1 -1
- package/dist/js/stacks.js +110 -265
- package/dist/js/stacks.min.js +1 -1
- package/lib/atomic/__snapshots__/color-new.less.test.ts.snap +3015 -0
- package/lib/atomic/__snapshots__/color.less.test.ts.snap +2886 -0
- package/lib/atomic/border.less +0 -258
- package/lib/atomic/color.less +26 -200
- package/lib/atomic/color.less.test.ts +12 -0
- package/lib/atomic/misc.less +7 -6
- package/lib/atomic/typography.less +0 -7
- package/lib/atomic/v1/__snapshots__/border.less.test.ts.snap +552 -0
- package/lib/atomic/v1/__snapshots__/color.less.test.ts.snap +6756 -0
- package/lib/atomic/v1/__snapshots__/typography.less.test.ts.snap +22 -0
- package/lib/atomic/v1/border.less +210 -0
- package/lib/atomic/v1/border.less.test.ts +14 -0
- package/lib/atomic/v1/color.less +183 -0
- package/lib/atomic/v1/color.less.test.ts +14 -0
- package/lib/atomic/v1/typography.less +8 -0
- package/lib/atomic/v1/typography.less.test.ts +14 -0
- package/lib/components/activity-indicator/activity-indicator.a11y.test.ts +1 -10
- package/lib/components/activity-indicator/activity-indicator.less +4 -4
- package/lib/components/anchor/anchor.a11y.test.ts +0 -12
- package/lib/components/anchor/anchor.less +4 -4
- package/lib/components/anchor/anchor.visual.test.ts +1 -1
- package/lib/components/avatar/avatar.less +2 -2
- package/lib/components/award-bling/award-bling.less +3 -3
- package/lib/components/badge/badge.a11y.test.ts +2 -51
- package/lib/components/badge/badge.less +40 -40
- package/lib/components/banner/banner.a11y.test.ts +0 -14
- package/lib/components/block-link/block-link.a11y.test.ts +0 -14
- package/lib/components/block-link/block-link.less +8 -8
- package/lib/components/breadcrumbs/breadcrumbs.a11y.test.ts +0 -2
- package/lib/components/breadcrumbs/breadcrumbs.less +1 -1
- package/lib/components/button/button.a11y.test.ts +0 -134
- package/lib/components/button/button.less +40 -40
- package/lib/components/button/button.visual.test.ts +1 -1
- package/lib/components/card/card.a11y.test.ts +0 -6
- package/lib/components/check-control/check-control.a11y.test.ts +0 -13
- package/lib/components/check-control/check-control.visual.test.ts +1 -1
- package/lib/components/checkbox_radio/checkbox_radio.less +5 -5
- package/lib/components/checkbox_radio/checkbox_radio.visual.test.ts +1 -1
- package/lib/components/code-block/code-block.less +3 -3
- package/lib/components/description/description.a11y.test.ts +0 -5
- package/lib/components/description/description.visual.test.ts +1 -1
- package/lib/components/input-fill/input-fill.less +2 -2
- package/lib/components/input-icon/input-icon.less +2 -2
- package/lib/components/input-message/input-message.less +8 -8
- package/lib/components/input_textarea/input_textarea.less +6 -6
- package/lib/components/label/label.less +11 -11
- package/lib/components/link/link.a11y.test.ts +0 -21
- package/lib/components/link/link.less +8 -8
- package/lib/components/link-preview/link-preview.less +9 -9
- package/lib/components/menu/menu.less +3 -3
- package/lib/components/modal/modal.less +5 -4
- package/lib/components/navigation/navigation.less +11 -11
- package/lib/components/notice/notice.less +48 -48
- package/lib/components/pagination/pagination.less +3 -3
- package/lib/components/popover/popover.less +2 -2
- package/lib/components/popover/tooltip.test.ts +1 -1
- package/lib/components/post-summary/post-summary.less +40 -40
- package/lib/components/progress-bar/progress-bar.less +15 -15
- package/lib/components/prose/prose.less +15 -15
- package/lib/components/select/select.less +5 -5
- package/lib/components/sidebar-widget/sidebar-widget.less +12 -12
- package/lib/components/table/table.less +7 -7
- package/lib/components/tag/tag.less +25 -25
- package/lib/components/toggle-switch/toggle-switch.a11y.test.ts +0 -7
- package/lib/components/toggle-switch/toggle-switch.less +4 -4
- package/lib/components/topbar/topbar.less +34 -34
- package/lib/components/uploader/uploader.less +15 -15
- package/lib/components/user-card/user-card.less +7 -7
- package/lib/exports/__snapshots__/color-mixins.less.test.ts.snap +539 -0
- package/lib/exports/__snapshots__/color.less.test.ts.snap +762 -0
- package/lib/exports/color-mixins.less +280 -0
- package/lib/exports/color-mixins.less.test.ts +150 -0
- package/lib/exports/color-sets.less +620 -0
- package/lib/exports/color.less +57 -0
- package/lib/exports/color.less.test.ts +12 -0
- package/lib/exports/exports.less +2 -1
- package/lib/exports/mixins.less +17 -5
- package/lib/exports/theme.less +85 -0
- package/lib/exports/v1/__snapshots__/constants-colors.less.test.ts.snap +902 -0
- package/lib/exports/v1/constants-colors.less +893 -0
- package/lib/exports/v1/constants-colors.less.test.ts +12 -0
- package/lib/stacks-static.less +5 -0
- package/lib/test/less-test-utils.ts +28 -0
- package/package.json +13 -7
- package/lib/exports/constants-colors.less +0 -1100
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { renderLess } from "../../test/less-test-utils";
|
|
3
|
+
|
|
4
|
+
describe("constants-colors", () => {
|
|
5
|
+
it("should output all the css generated by the v1 colors/theming generation mixins", async () => {
|
|
6
|
+
const css = await renderLess(`
|
|
7
|
+
@import "./lib/exports/v1/constants-colors.less";
|
|
8
|
+
`);
|
|
9
|
+
|
|
10
|
+
expect(css).toMatchSnapshot();
|
|
11
|
+
});
|
|
12
|
+
});
|
package/lib/stacks-static.less
CHANGED
|
@@ -56,6 +56,11 @@
|
|
|
56
56
|
// LESS CONSTANTS AND MIXINS
|
|
57
57
|
@import "exports/exports.less";
|
|
58
58
|
|
|
59
|
+
// -- ATOMIC CLASSES (v1 colors)
|
|
60
|
+
@import "atomic/v1/border.less"; // Deprecated
|
|
61
|
+
@import "atomic/v1/color.less"; // Deprecated
|
|
62
|
+
@import "atomic/v1/typography.less"; // Deprecated
|
|
63
|
+
|
|
59
64
|
// -- ATOMIC CLASSES
|
|
60
65
|
@import "atomic/border.less";
|
|
61
66
|
@import "atomic/color.less";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import beautify from "cssbeautify";
|
|
2
|
+
import * as less from "less";
|
|
3
|
+
import * as path from "path";
|
|
4
|
+
import * as fs from "fs";
|
|
5
|
+
|
|
6
|
+
// cssbeautify is an old package that doesn't support ES modules
|
|
7
|
+
const cssbeautify = beautify as (css: string) => string;
|
|
8
|
+
|
|
9
|
+
const getSubdirectories = (dirPath: string): string[] => {
|
|
10
|
+
const subdirs = fs
|
|
11
|
+
.readdirSync(dirPath)
|
|
12
|
+
.map((file) => path.join(dirPath, file))
|
|
13
|
+
.filter((path) => fs.statSync(path).isDirectory());
|
|
14
|
+
return subdirs.reduce(
|
|
15
|
+
(acc, subdir) => [...acc, subdir, ...getSubdirectories(subdir)],
|
|
16
|
+
subdirs
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const renderLess = async (lessCode: string) => {
|
|
21
|
+
const { css } = await less.render(lessCode, {
|
|
22
|
+
paths: getSubdirectories(path.join(__dirname, "../")),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
return cssbeautify(css);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export { renderLess };
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/StackExchange/Stacks.git"
|
|
7
7
|
},
|
|
8
|
-
"version": "
|
|
8
|
+
"version": "2.0.0-rc.1",
|
|
9
9
|
"files": [
|
|
10
10
|
"dist",
|
|
11
11
|
"lib"
|
|
@@ -22,12 +22,14 @@
|
|
|
22
22
|
"build:docs": "webpack --mode=production --config ./docs/webpack.config.js && cd ./docs && eleventy",
|
|
23
23
|
"start:webpack": "webpack --watch --config ./docs/webpack.config.js",
|
|
24
24
|
"start:eleventy": "cd ./docs && eleventy --serve",
|
|
25
|
-
"test": "npm run test:unit && npm run test:a11y && npm run test:visual",
|
|
25
|
+
"test": "npm run test:less && npm run test:unit && npm run test:a11y && npm run test:visual",
|
|
26
26
|
"test:a11y": "web-test-runner --group=a11y",
|
|
27
27
|
"test:unit": "web-test-runner --group=unit",
|
|
28
28
|
"test:unit:watch": "web-test-runner --group=unit --watch",
|
|
29
29
|
"test:visual": "pwsh run-test-visual.ps1 npx web-test-runner --group=visual",
|
|
30
30
|
"test:visual:update": "pwsh run-test-visual.ps1 npx web-test-runner --group=visual --update-visual-baseline",
|
|
31
|
+
"test:less": "vitest run .less.test.ts",
|
|
32
|
+
"test:less:update": "npm run test:less -- -u",
|
|
31
33
|
"prepublishOnly": "npm run build",
|
|
32
34
|
"format": "prettier --write ./lib",
|
|
33
35
|
"lint": "concurrently -n w: npm:lint:*",
|
|
@@ -37,7 +39,7 @@
|
|
|
37
39
|
},
|
|
38
40
|
"license": "MIT",
|
|
39
41
|
"dependencies": {
|
|
40
|
-
"@hotwired/stimulus": "^3.2.
|
|
42
|
+
"@hotwired/stimulus": "^3.2.1",
|
|
41
43
|
"@popperjs/core": "^2.11.8"
|
|
42
44
|
},
|
|
43
45
|
"devDependencies": {
|
|
@@ -50,6 +52,8 @@
|
|
|
50
52
|
"@stackoverflow/stacks-icons": "^5.5.0",
|
|
51
53
|
"@testing-library/dom": "^9.3.1",
|
|
52
54
|
"@testing-library/user-event": "^14.4.3",
|
|
55
|
+
"@types/cssbeautify": "^0.3.2",
|
|
56
|
+
"@types/less": "^3.0.3",
|
|
53
57
|
"@typescript-eslint/eslint-plugin": "^6.4.0",
|
|
54
58
|
"@typescript-eslint/parser": "^6.4.0",
|
|
55
59
|
"@web/dev-server-esbuild": "^0.4.1",
|
|
@@ -60,12 +64,13 @@
|
|
|
60
64
|
"apca-w3": "^0.1.9",
|
|
61
65
|
"concurrently": "^8.2.0",
|
|
62
66
|
"css-loader": "^6.8.1",
|
|
67
|
+
"cssbeautify": "^0.3.1",
|
|
63
68
|
"cssnano": "^6.0.1",
|
|
64
69
|
"docsearch.js": "^2.6.3",
|
|
65
70
|
"eleventy-plugin-highlightjs": "^1.1.0",
|
|
66
71
|
"eleventy-plugin-nesting-toc": "^1.3.0",
|
|
67
|
-
"eslint": "^8.
|
|
68
|
-
"eslint-config-prettier": "^9.0
|
|
72
|
+
"eslint": "^8.45.0",
|
|
73
|
+
"eslint-config-prettier": "^8.9.0",
|
|
69
74
|
"eslint-plugin-no-unsanitized": "^4.0.2",
|
|
70
75
|
"jquery": "^3.7.0",
|
|
71
76
|
"less-loader": "^11.1.3",
|
|
@@ -74,14 +79,15 @@
|
|
|
74
79
|
"mini-css-extract-plugin": "^2.7.6",
|
|
75
80
|
"postcss-less": "^6.0.0",
|
|
76
81
|
"postcss-loader": "^7.3.3",
|
|
77
|
-
"prettier": "^3.0.
|
|
82
|
+
"prettier": "^3.0.1",
|
|
78
83
|
"rollup-plugin-postcss": "^4.0.2",
|
|
79
|
-
"stylelint": "^15.10.
|
|
84
|
+
"stylelint": "^15.10.2",
|
|
80
85
|
"stylelint-config-recommended": "^13.0.0",
|
|
81
86
|
"stylelint-config-standard": "^34.0.0",
|
|
82
87
|
"terser-webpack-plugin": "^5.3.9",
|
|
83
88
|
"ts-loader": "^9.4.4",
|
|
84
89
|
"typescript": "^5.1.6",
|
|
90
|
+
"vitest": "^0.33.0",
|
|
85
91
|
"webpack": "^5.88.2",
|
|
86
92
|
"webpack-cli": "^5.1.4",
|
|
87
93
|
"webpack-merge": "^5.9.0"
|