fix(breakpoints): rename exported functions to reflect constraint-based API: cssForCustom -> cssForConstraint and cssForCustomContainer -> cssForConstraintContainer; update README usage
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
# Changelog
|
||||
|
||||
## 2026-03-11 - 2.5.1 - fix(breakpoints)
|
||||
rename exported functions to reflect constraint-based API: cssForCustom -> cssForConstraint and cssForCustomContainer -> cssForConstraintContainer; update README usage
|
||||
|
||||
- Renamed cssForCustom to cssForConstraint
|
||||
- Renamed cssForCustomContainer to cssForConstraintContainer
|
||||
- Updated README examples to use new names
|
||||
- Function behavior and signatures unchanged; only exported names and internal comment updated
|
||||
- Consumers must update imports/usages to the new function names (breaking change)
|
||||
|
||||
## 2026-03-11 - 2.5.0 - feat(breakpoints)
|
||||
document preset viewport helpers, low-level container helpers, and exported types for breakpoints
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ import { breakpoints } from '@design.estate/dees-domtools';
|
||||
import { css as litCss } from 'lit';
|
||||
|
||||
// Viewport-level with custom constraints (emits @media + @container wccToolsViewport)
|
||||
breakpoints.cssForCustom({ maxWidth: 800 })(litCss`.box { padding: 8px; }`)
|
||||
breakpoints.cssForConstraint({ maxWidth: 800 })(litCss`.box { padding: 8px; }`)
|
||||
|
||||
// Component-level — targets a named container (no @media fallback)
|
||||
breakpoints.cssForContainer(
|
||||
@@ -135,7 +135,7 @@ breakpoints.cssForContainer(
|
||||
)
|
||||
|
||||
// Component-level with custom constraints (curried)
|
||||
breakpoints.cssForCustomContainer({ maxWidth: 500 }, 'my-component')(litCss`
|
||||
breakpoints.cssForConstraintContainer({ maxWidth: 500 }, 'my-component')(litCss`
|
||||
.grid { gap: 8px; }
|
||||
`)
|
||||
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@design.estate/dees-domtools',
|
||||
version: '2.5.0',
|
||||
version: '2.5.1',
|
||||
description: 'A package providing tools to simplify complex CSS structures and web development tasks, featuring TypeScript support and integration with various web technologies.'
|
||||
}
|
||||
|
||||
@@ -54,13 +54,13 @@ export const cssForContainer = (cssArg: CSSResult, condition: string, containerN
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Custom constraints (curried)
|
||||
// Constraint-based (curried)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export const cssForCustom = (constraints: ICssForConstraints) =>
|
||||
export const cssForConstraint = (constraints: ICssForConstraints) =>
|
||||
(cssArg: CSSResult) => cssForViewport(cssArg, buildCondition(constraints));
|
||||
|
||||
export const cssForCustomContainer = (constraints: ICssForConstraints, containerName: string) =>
|
||||
export const cssForConstraintContainer = (constraints: ICssForConstraints, containerName: string) =>
|
||||
(cssArg: CSSResult) => cssForContainer(cssArg, buildCondition(constraints), containerName);
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user