@design.estate/dees-domtools 2.4.0 → 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.4.0',
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=
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@design.estate/dees-domtools",
3
- "version": "2.4.0",
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
- **Available breakpoint helpers:**
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:
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@design.estate/dees-domtools',
6
- version: '2.4.0',
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
  }