@design.estate/dees-domtools 2.3.9 → 2.5.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.
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@design.estate/dees-domtools',
|
|
6
|
-
version: '2.
|
|
6
|
+
version: '2.5.0',
|
|
7
7
|
description: 'A package providing tools to simplify complex CSS structures and web development tasks, featuring TypeScript support and integration with various web technologies.'
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSw4QkFBOEI7SUFDcEMsT0FBTyxFQUFFLE9BQU87SUFDaEIsV0FBVyxFQUFFLHFLQUFxSztDQUNuTCxDQUFBIn0=
|
|
@@ -5,6 +5,15 @@ export declare const tablet = 1024;
|
|
|
5
5
|
export declare const phablet = 600;
|
|
6
6
|
export declare const phone = 400;
|
|
7
7
|
export type TViewport = 'native' | 'desktop' | 'tablet' | 'phablet' | 'phone';
|
|
8
|
+
export interface ICssForConstraints {
|
|
9
|
+
maxWidth?: number;
|
|
10
|
+
minWidth?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare const cssForViewport: (cssArg: CSSResult, condition: string) => CSSResult;
|
|
13
|
+
export declare const cssForContainer: (cssArg: CSSResult, condition: string, containerName: string) => CSSResult;
|
|
14
|
+
export declare const cssForCustom: (constraints: ICssForConstraints) => (cssArg: CSSResult) => CSSResult;
|
|
15
|
+
export declare const cssForCustomContainer: (constraints: ICssForConstraints, containerName: string) => (cssArg: CSSResult) => CSSResult;
|
|
16
|
+
export declare const containerContextStyles: (containerName: string) => CSSResult;
|
|
8
17
|
export declare const cssForDesktop: (cssArg: CSSResult) => CSSResult;
|
|
9
18
|
export declare const cssForNotebook: (cssArg: CSSResult) => CSSResult;
|
|
10
19
|
export declare const cssForTablet: (cssArg: CSSResult) => CSSResult;
|
|
@@ -1,58 +1,71 @@
|
|
|
1
1
|
import { DomTools } from './domtools.classes.domtools.js';
|
|
2
|
-
import { CSSResult, unsafeCSS } from 'lit';
|
|
2
|
+
import { css, CSSResult, unsafeCSS } from 'lit';
|
|
3
3
|
export const desktop = 1600;
|
|
4
4
|
export const notebook = 1240;
|
|
5
5
|
export const tablet = 1024;
|
|
6
6
|
export const phablet = 600;
|
|
7
7
|
export const phone = 400;
|
|
8
|
-
|
|
8
|
+
const buildCondition = (constraints) => {
|
|
9
|
+
const parts = [];
|
|
10
|
+
if (constraints.minWidth)
|
|
11
|
+
parts.push(`(min-width: ${constraints.minWidth}px)`);
|
|
12
|
+
if (constraints.maxWidth)
|
|
13
|
+
parts.push(`(max-width: ${constraints.maxWidth}px)`);
|
|
14
|
+
return parts.join(' and ');
|
|
15
|
+
};
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
// Viewport-level: @container wccToolsViewport + @media
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
export const cssForViewport = (cssArg, condition) => {
|
|
9
20
|
return unsafeCSS(`
|
|
10
|
-
@container wccToolsViewport
|
|
21
|
+
@container wccToolsViewport ${condition} {
|
|
11
22
|
${cssArg.cssText}
|
|
12
23
|
}
|
|
13
|
-
@media
|
|
24
|
+
@media ${condition} {
|
|
14
25
|
${cssArg.cssText}
|
|
15
26
|
}
|
|
16
27
|
`);
|
|
17
28
|
};
|
|
18
|
-
|
|
29
|
+
// ---------------------------------------------------------------------------
|
|
30
|
+
// Component-level: @container <name> only
|
|
31
|
+
// ---------------------------------------------------------------------------
|
|
32
|
+
export const cssForContainer = (cssArg, condition, containerName) => {
|
|
19
33
|
return unsafeCSS(`
|
|
20
|
-
@container
|
|
21
|
-
${cssArg.cssText}
|
|
22
|
-
}
|
|
23
|
-
@media (max-width: ${notebook}px) {
|
|
34
|
+
@container ${containerName} ${condition} {
|
|
24
35
|
${cssArg.cssText}
|
|
25
36
|
}
|
|
26
37
|
`);
|
|
27
38
|
};
|
|
39
|
+
// ---------------------------------------------------------------------------
|
|
40
|
+
// Custom constraints (curried)
|
|
41
|
+
// ---------------------------------------------------------------------------
|
|
42
|
+
export const cssForCustom = (constraints) => (cssArg) => cssForViewport(cssArg, buildCondition(constraints));
|
|
43
|
+
export const cssForCustomContainer = (constraints, containerName) => (cssArg) => cssForContainer(cssArg, buildCondition(constraints), containerName);
|
|
44
|
+
// ---------------------------------------------------------------------------
|
|
45
|
+
// Container context style factory — used by @containerResponsive()
|
|
46
|
+
// ---------------------------------------------------------------------------
|
|
47
|
+
export const containerContextStyles = (containerName) => css `
|
|
48
|
+
:host {
|
|
49
|
+
container-type: inline-size;
|
|
50
|
+
container-name: ${unsafeCSS(containerName)};
|
|
51
|
+
}
|
|
52
|
+
`;
|
|
53
|
+
// ---------------------------------------------------------------------------
|
|
54
|
+
// Preset viewport breakpoint helpers (existing API, unchanged behaviour)
|
|
55
|
+
// ---------------------------------------------------------------------------
|
|
56
|
+
export const cssForDesktop = (cssArg) => {
|
|
57
|
+
return cssForViewport(cssArg, `(min-width: ${desktop}px)`);
|
|
58
|
+
};
|
|
59
|
+
export const cssForNotebook = (cssArg) => {
|
|
60
|
+
return cssForViewport(cssArg, `(max-width: ${notebook}px)`);
|
|
61
|
+
};
|
|
28
62
|
export const cssForTablet = (cssArg) => {
|
|
29
|
-
return
|
|
30
|
-
@container wccToolsViewport (max-width: ${tablet}px) {
|
|
31
|
-
${cssArg.cssText}
|
|
32
|
-
}
|
|
33
|
-
@media (max-width: ${tablet}px) {
|
|
34
|
-
${cssArg.cssText}
|
|
35
|
-
}
|
|
36
|
-
`);
|
|
63
|
+
return cssForViewport(cssArg, `(max-width: ${tablet}px)`);
|
|
37
64
|
};
|
|
38
65
|
export const cssForPhablet = (cssArg) => {
|
|
39
|
-
return
|
|
40
|
-
@container wccToolsViewport (max-width: ${phablet}px) {
|
|
41
|
-
${cssArg.cssText}
|
|
42
|
-
}
|
|
43
|
-
@media (max-width: ${phablet}px) {
|
|
44
|
-
${cssArg.cssText}
|
|
45
|
-
}
|
|
46
|
-
`);
|
|
66
|
+
return cssForViewport(cssArg, `(max-width: ${phablet}px)`);
|
|
47
67
|
};
|
|
48
68
|
export const cssForPhone = (cssArg) => {
|
|
49
|
-
return
|
|
50
|
-
@container wccToolsViewport (max-width: ${phone}px) {
|
|
51
|
-
${cssArg.cssText}
|
|
52
|
-
}
|
|
53
|
-
@media (max-width: ${phone}px) {
|
|
54
|
-
${cssArg.cssText}
|
|
55
|
-
}
|
|
56
|
-
`);
|
|
69
|
+
return cssForViewport(cssArg, `(max-width: ${phone}px)`);
|
|
57
70
|
};
|
|
58
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
71
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZG9tdG9vbHMuY3NzLmJyZWFrcG9pbnRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvZG9tdG9vbHMuY3NzLmJyZWFrcG9pbnRzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUUxRCxPQUFPLEVBQUUsR0FBRyxFQUFFLFNBQVMsRUFBRSxTQUFTLEVBQUUsTUFBTSxLQUFLLENBQUM7QUFFaEQsTUFBTSxDQUFDLE1BQU0sT0FBTyxHQUFHLElBQUksQ0FBQztBQUM1QixNQUFNLENBQUMsTUFBTSxRQUFRLEdBQUcsSUFBSSxDQUFDO0FBQzdCLE1BQU0sQ0FBQ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0sRUFBRSxlQUFlLFFBQVEsS0FBSyxDQUFDLENBQUM7QUFDOUQsQ0FBQyxDQUFDO0FBRUYsTUFBTSxDQUFDLE1BQU0sWUFBWSxHQUFHLENBQUMsTUFBaUIsRUFBRSxFQUFFO0lBQ2hELE9BQU8sY0FBYyxDQUFDLE1BQU0sRUFBRSxlQUFlLE1BQU0sS0FBSyxDQUFDLENBQUM7QUFDNUQsQ0FBQyxDQUFDO0FBRUYsTUFBTSxDQUFDLE1BQU0sYUFBYSxHQUFHLENBQUMsTUFBaUIsRUFBRSxFQUFFO0lBQ2pELE9BQU8sY0FBYyxDQUFDLE1BQU0sRUFBRSxlQUFlLE9BQU8sS0FBSyxDQUFDLENBQUM7QUFDN0QsQ0FBQyxDQUFDO0FBRUYsTUFBTSxDQUFDLE1BQU0sV0FBVyxHQUFHLENBQUMsTUFBaUIsRUFBRSxFQUFFO0lBQy9DLE9BQU8sY0FBYyxDQUFDLE1BQU0sRUFBRSxlQUFlLEtBQUssS0FBSyxDQUFDLENBQUM7QUFDM0QsQ0FBQyxDQUFDIn0=
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@design.estate/dees-domtools",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A package providing tools to simplify complex CSS structures and web development tasks, featuring TypeScript support and integration with various web technologies.",
|
|
6
6
|
"main": "dist_ts/index.js",
|
package/readme.md
CHANGED
|
@@ -110,7 +110,7 @@ const myStyles = litCss`
|
|
|
110
110
|
`;
|
|
111
111
|
```
|
|
112
112
|
|
|
113
|
-
**
|
|
113
|
+
**Preset viewport helpers** (emit both `@media` and `@container wccToolsViewport`):
|
|
114
114
|
|
|
115
115
|
- `cssForDesktop(css)` - Styles for 1600px and above
|
|
116
116
|
- `cssForNotebook(css)` - Styles for 1240px and below
|
|
@@ -118,6 +118,37 @@ const myStyles = litCss`
|
|
|
118
118
|
- `cssForPhablet(css)` - Styles for 600px and below
|
|
119
119
|
- `cssForPhone(css)` - Styles for 400px and below
|
|
120
120
|
|
|
121
|
+
**Low-level helpers** for custom constraints and component-scoped containers:
|
|
122
|
+
|
|
123
|
+
```typescript
|
|
124
|
+
import { breakpoints } from '@design.estate/dees-domtools';
|
|
125
|
+
import { css as litCss } from 'lit';
|
|
126
|
+
|
|
127
|
+
// Viewport-level with custom constraints (emits @media + @container wccToolsViewport)
|
|
128
|
+
breakpoints.cssForCustom({ maxWidth: 800 })(litCss`.box { padding: 8px; }`)
|
|
129
|
+
|
|
130
|
+
// Component-level — targets a named container (no @media fallback)
|
|
131
|
+
breakpoints.cssForContainer(
|
|
132
|
+
litCss`.grid { columns: 1; }`,
|
|
133
|
+
'(max-width: 600px)',
|
|
134
|
+
'my-component' // CSS container-name
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
// Component-level with custom constraints (curried)
|
|
138
|
+
breakpoints.cssForCustomContainer({ maxWidth: 500 }, 'my-component')(litCss`
|
|
139
|
+
.grid { gap: 8px; }
|
|
140
|
+
`)
|
|
141
|
+
|
|
142
|
+
// Generate containment styles for :host (used by @containerResponsive decorator)
|
|
143
|
+
breakpoints.containerContextStyles('my-component')
|
|
144
|
+
// → :host { container-type: inline-size; container-name: my-component; }
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**Exported types:**
|
|
148
|
+
|
|
149
|
+
- `ICssForConstraints` — `{ maxWidth?: number; minWidth?: number }`
|
|
150
|
+
- `TViewport` — `'native' | 'desktop' | 'tablet' | 'phablet' | 'phone'`
|
|
151
|
+
|
|
121
152
|
### Theme Management
|
|
122
153
|
|
|
123
154
|
Automatic theme detection with system preference support:
|
package/ts/00_commitinfo_data.ts
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@design.estate/dees-domtools',
|
|
6
|
-
version: '2.
|
|
6
|
+
version: '2.5.0',
|
|
7
7
|
description: 'A package providing tools to simplify complex CSS structures and web development tasks, featuring TypeScript support and integration with various web technologies.'
|
|
8
8
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DomTools } from './domtools.classes.domtools.js';
|
|
2
2
|
|
|
3
|
-
import { CSSResult, unsafeCSS } from 'lit';
|
|
3
|
+
import { css, CSSResult, unsafeCSS } from 'lit';
|
|
4
4
|
|
|
5
5
|
export const desktop = 1600;
|
|
6
6
|
export const notebook = 1240;
|
|
@@ -10,57 +10,90 @@ export const phone = 400;
|
|
|
10
10
|
|
|
11
11
|
export type TViewport = 'native' | 'desktop' | 'tablet' | 'phablet' | 'phone';
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
// Constraint-based helpers
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
|
|
17
|
+
export interface ICssForConstraints {
|
|
18
|
+
maxWidth?: number;
|
|
19
|
+
minWidth?: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const buildCondition = (constraints: ICssForConstraints): string => {
|
|
23
|
+
const parts: string[] = [];
|
|
24
|
+
if (constraints.minWidth) parts.push(`(min-width: ${constraints.minWidth}px)`);
|
|
25
|
+
if (constraints.maxWidth) parts.push(`(max-width: ${constraints.maxWidth}px)`);
|
|
26
|
+
return parts.join(' and ');
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// ---------------------------------------------------------------------------
|
|
30
|
+
// Viewport-level: @container wccToolsViewport + @media
|
|
31
|
+
// ---------------------------------------------------------------------------
|
|
32
|
+
|
|
33
|
+
export const cssForViewport = (cssArg: CSSResult, condition: string) => {
|
|
14
34
|
return unsafeCSS(`
|
|
15
|
-
@container wccToolsViewport
|
|
35
|
+
@container wccToolsViewport ${condition} {
|
|
16
36
|
${cssArg.cssText}
|
|
17
37
|
}
|
|
18
|
-
@media
|
|
38
|
+
@media ${condition} {
|
|
19
39
|
${cssArg.cssText}
|
|
20
40
|
}
|
|
21
41
|
`);
|
|
22
42
|
};
|
|
23
43
|
|
|
24
|
-
|
|
44
|
+
// ---------------------------------------------------------------------------
|
|
45
|
+
// Component-level: @container <name> only
|
|
46
|
+
// ---------------------------------------------------------------------------
|
|
47
|
+
|
|
48
|
+
export const cssForContainer = (cssArg: CSSResult, condition: string, containerName: string) => {
|
|
25
49
|
return unsafeCSS(`
|
|
26
|
-
@container
|
|
27
|
-
${cssArg.cssText}
|
|
28
|
-
}
|
|
29
|
-
@media (max-width: ${notebook}px) {
|
|
50
|
+
@container ${containerName} ${condition} {
|
|
30
51
|
${cssArg.cssText}
|
|
31
52
|
}
|
|
32
53
|
`);
|
|
33
54
|
};
|
|
34
55
|
|
|
56
|
+
// ---------------------------------------------------------------------------
|
|
57
|
+
// Custom constraints (curried)
|
|
58
|
+
// ---------------------------------------------------------------------------
|
|
59
|
+
|
|
60
|
+
export const cssForCustom = (constraints: ICssForConstraints) =>
|
|
61
|
+
(cssArg: CSSResult) => cssForViewport(cssArg, buildCondition(constraints));
|
|
62
|
+
|
|
63
|
+
export const cssForCustomContainer = (constraints: ICssForConstraints, containerName: string) =>
|
|
64
|
+
(cssArg: CSSResult) => cssForContainer(cssArg, buildCondition(constraints), containerName);
|
|
65
|
+
|
|
66
|
+
// ---------------------------------------------------------------------------
|
|
67
|
+
// Container context style factory — used by @containerResponsive()
|
|
68
|
+
// ---------------------------------------------------------------------------
|
|
69
|
+
|
|
70
|
+
export const containerContextStyles = (containerName: string) => css`
|
|
71
|
+
:host {
|
|
72
|
+
container-type: inline-size;
|
|
73
|
+
container-name: ${unsafeCSS(containerName)};
|
|
74
|
+
}
|
|
75
|
+
`;
|
|
76
|
+
|
|
77
|
+
// ---------------------------------------------------------------------------
|
|
78
|
+
// Preset viewport breakpoint helpers (existing API, unchanged behaviour)
|
|
79
|
+
// ---------------------------------------------------------------------------
|
|
80
|
+
|
|
81
|
+
export const cssForDesktop = (cssArg: CSSResult) => {
|
|
82
|
+
return cssForViewport(cssArg, `(min-width: ${desktop}px)`);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export const cssForNotebook = (cssArg: CSSResult) => {
|
|
86
|
+
return cssForViewport(cssArg, `(max-width: ${notebook}px)`);
|
|
87
|
+
};
|
|
88
|
+
|
|
35
89
|
export const cssForTablet = (cssArg: CSSResult) => {
|
|
36
|
-
return
|
|
37
|
-
@container wccToolsViewport (max-width: ${tablet}px) {
|
|
38
|
-
${cssArg.cssText}
|
|
39
|
-
}
|
|
40
|
-
@media (max-width: ${tablet}px) {
|
|
41
|
-
${cssArg.cssText}
|
|
42
|
-
}
|
|
43
|
-
`);
|
|
90
|
+
return cssForViewport(cssArg, `(max-width: ${tablet}px)`);
|
|
44
91
|
};
|
|
45
92
|
|
|
46
93
|
export const cssForPhablet = (cssArg: CSSResult) => {
|
|
47
|
-
return
|
|
48
|
-
@container wccToolsViewport (max-width: ${phablet}px) {
|
|
49
|
-
${cssArg.cssText}
|
|
50
|
-
}
|
|
51
|
-
@media (max-width: ${phablet}px) {
|
|
52
|
-
${cssArg.cssText}
|
|
53
|
-
}
|
|
54
|
-
`);
|
|
94
|
+
return cssForViewport(cssArg, `(max-width: ${phablet}px)`);
|
|
55
95
|
};
|
|
56
96
|
|
|
57
97
|
export const cssForPhone = (cssArg: CSSResult) => {
|
|
58
|
-
return
|
|
59
|
-
@container wccToolsViewport (max-width: ${phone}px) {
|
|
60
|
-
${cssArg.cssText}
|
|
61
|
-
}
|
|
62
|
-
@media (max-width: ${phone}px) {
|
|
63
|
-
${cssArg.cssText}
|
|
64
|
-
}
|
|
65
|
-
`);
|
|
98
|
+
return cssForViewport(cssArg, `(max-width: ${phone}px)`);
|
|
66
99
|
};
|