@usableapp/cardds 0.7.102 → 0.7.103
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/CHANGELOG.md +9 -0
- package/dist/catalog.json +1 -1
- package/lint/rules.mjs +4 -1
- package/package.json +1 -1
package/lint/rules.mjs
CHANGED
|
@@ -17,6 +17,9 @@ export const CONTROL_NAMES = {
|
|
|
17
17
|
|
|
18
18
|
const lineOf = (text, idx) => text.slice(0, idx).split('\n').length;
|
|
19
19
|
|
|
20
|
+
/** the classes a selector names; a bare state word (`is-open`) is every project's too — it only matters beside a cardds class, which is caught */
|
|
21
|
+
export const selectorClasses = (selector) => [...selector.matchAll(/(?<!\\)\.(-?[a-zA-Z_][\w-]*)/g)].map((m) => m[1]).filter((c) => !/^(is|has)-/.test(c));
|
|
22
|
+
|
|
20
23
|
/** every class cardds's CSS styles — read from the package's own css/, so the list is never copied by hand */
|
|
21
24
|
let classes;
|
|
22
25
|
export function carddsClasses(dir = CSS_DIR) {
|
|
@@ -32,7 +35,7 @@ export function carddsClasses(dir = CSS_DIR) {
|
|
|
32
35
|
// used to have for numbers (`1.5rem`) is not needed here, and it cost every class that only ever stands second in a compound selector.
|
|
33
36
|
for (const sel of css.matchAll(/([^{};]+)\{/g)) {
|
|
34
37
|
if (sel[1].trimStart().startsWith('@')) continue;
|
|
35
|
-
for (const
|
|
38
|
+
for (const c of selectorClasses(sel[1])) set.add(c);
|
|
36
39
|
}
|
|
37
40
|
}
|
|
38
41
|
if (dir === CSS_DIR) classes = set;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usableapp/cardds",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.103",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "card-first mobile design system, React-first: the components in src/ are thin wrappers over the CSS contract (css/*.css stays the only truth); gallery/ shows every story live (npm run dev), tests/ measures the geometry.",
|