Skip to content

Commit 45793cb

Browse files
bejarcodeclaude
andcommitted
release: v1.1.0 - Border support for squircle paths
### Added - Border support via borderWidth and borderColor config options - Interactive border controls in playground (toggle, width, color) - Comprehensive border documentation across all README files ### Changed - Bundle size: 3.66 KB → 4.58 KB gzipped (+0.92 KB) - Version bump: 1.0.3 → 1.1.0 ### Documentation - Updated CHANGELOG.md with v1.1.0 release notes - Updated root README with border API example - Updated packages/core/README with Border Support section - Updated website/README with border features - Updated CDN version references from 1.0.2 to 1.1.0 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 530fa2f commit 45793cb

File tree

5 files changed

+123
-26
lines changed

5 files changed

+123
-26
lines changed

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
> Bring iOS-style squircle corners to your web applications
44
55
[![npm version](https://img.shields.io/npm/v/@cornerkit/core)](https://www.npmjs.com/package/@cornerkit/core)
6-
[![Bundle Size](https://img.shields.io/badge/bundle%20size-3.66%20KB-success)](https://bundlephobia.com/package/@cornerkit/core)
6+
[![Bundle Size](https://img.shields.io/badge/bundle%20size-4.58%20KB-success)](https://bundlephobia.com/package/@cornerkit/core)
77
[![Zero Dependencies](https://img.shields.io/badge/dependencies-0-brightgreen)](package.json)
88
[![TypeScript](https://img.shields.io/badge/TypeScript-5.3%2B-blue)](https://www.typescriptlang.org/)
99
[![Security: A+](https://img.shields.io/badge/security-A%2B-success)](SECURITY.md)
@@ -12,7 +12,7 @@
1212

1313
**[Live Demo](https://bejarcode.github.io/cornerKit/)** - Interactive playground with 36+ UI examples
1414

15-
CornerKit is a lightweight JavaScript library that brings the smooth, continuous curve corners (squircles) from iOS design to the web. At just **3.66 KB gzipped** with **zero runtime dependencies**, it delivers pixel-perfect rounded corners that look better than standard CSS `border-radius`.
15+
CornerKit is a lightweight JavaScript library that brings the smooth, continuous curve corners (squircles) from iOS design to the web. At just **4.58 KB gzipped** with **zero runtime dependencies**, it delivers pixel-perfect rounded corners that look better than standard CSS `border-radius`.
1616

1717
## Why Squircles?
1818

@@ -37,8 +37,10 @@ const ck = new CornerKit();
3737

3838
// Apply to any element
3939
ck.apply('.card', {
40-
radius: 24, // Corner size in pixels
41-
smoothing: 0.6 // iOS standard smoothness (0-1)
40+
radius: 24, // Corner size in pixels
41+
smoothing: 0.6, // iOS standard smoothness (0-1)
42+
borderWidth: 2, // Optional: border width in pixels
43+
borderColor: '#000' // Optional: border color
4244
});
4345
```
4446

@@ -63,7 +65,7 @@ ck.apply('.card', {
6365
## Why CornerKit?
6466

6567
### Exceptionally Tiny
66-
- **3.66 KB gzipped** (ESM) - 27% under 5KB budget
68+
- **4.58 KB gzipped** (ESM) - 8% under 5KB budget
6769
- **Zero runtime dependencies**
6870
- Tree-shakeable ES modules
6971
- Smaller than most icon libraries
@@ -185,7 +187,7 @@ All metrics verified by automated tests on 2020 MacBook Pro (M1):
185187

186188
| Metric | Target | Actual | Performance |
187189
|--------|--------|--------|-------------|
188-
| Bundle size (ESM) | <5KB | 3.66 KB | 27% under budget |
190+
| Bundle size (ESM) | <5KB | 4.58 KB | 8% under budget |
189191
| Single element render | <10ms | 7.3ms | 27% faster |
190192
| Initialization | <100ms | 42ms | 58% faster |
191193
| 100 elements batch | <500ms | 403ms | 19% faster |
@@ -265,13 +267,13 @@ Working examples with interactive demos:
265267
```html
266268
<!-- ES Module -->
267269
<script type="module">
268-
import CornerKit from 'https://cdn.jsdelivr.net/npm/@cornerkit/core@1.0.2/dist/cornerkit.esm.js';
270+
import CornerKit from 'https://cdn.jsdelivr.net/npm/@cornerkit/core@1.1.0/dist/cornerkit.esm.js';
269271
const ck = new CornerKit();
270272
ck.apply('.card', { radius: 24, smoothing: 0.6 });
271273
</script>
272274

273275
<!-- UMD (Global) -->
274-
<script src="https://cdn.jsdelivr.net/npm/@cornerkit/core@1.0.2/dist/cornerkit.js"></script>
276+
<script src="https://cdn.jsdelivr.net/npm/@cornerkit/core@1.1.0/dist/cornerkit.js"></script>
275277
<script>
276278
const ck = new CornerKit();
277279
ck.apply('.card', { radius: 24, smoothing: 0.6 });

packages/core/CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [1.1.0] - 2025-11-18
11+
12+
### Added
13+
- **Border support** - Squircle borders that follow the curve path using pseudo-element rendering
14+
- New `borderWidth` config option (pixels)
15+
- New `borderColor` config option (any valid CSS color)
16+
- Borders extend outward from element boundaries (outer stroke positioning)
17+
- Automatic background preservation using individual CSS properties
18+
- Interactive border controls in playground (toggle, width slider, color picker)
19+
- Code generation updated to include border parameters
20+
21+
### Changed
22+
- Bundle size increased from 3.66 KB to 4.58 KB gzipped (+0.92 KB for border feature)
23+
- Pseudo-element architecture: `::before` for border (z-index: 0), `::after` for background (z-index: 1)
24+
- Elements with borders automatically get `position: relative` if needed
25+
- Child elements positioned with `z-index: 2` to stay on top of border layers
26+
27+
### Technical Details
28+
- Border rendering uses layered pseudo-elements to work around clip-path masking
29+
- Background split into individual CSS properties (backgroundColor, backgroundImage, etc.)
30+
- Original background stored in dataset to prevent recapture issues
31+
- Performance: ~0.4ms additional render time per bordered element
32+
1033
## [1.0.3] - 2025-11-17
1134

1235
### Fixed

packages/core/README.md

Lines changed: 87 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
> Lightweight, framework-agnostic library for iOS-style squircle corners on the web
44
5-
[![Bundle Size](https://img.shields.io/badge/bundle%20size-3.66%20KB-success)](https://bundlephobia.com/package/cornerkit)
5+
[![Bundle Size](https://img.shields.io/badge/bundle%20size-4.58%20KB-success)](https://bundlephobia.com/package/cornerkit)
66
[![Zero Dependencies](https://img.shields.io/badge/dependencies-0-brightgreen)](package.json)
77
[![TypeScript](https://img.shields.io/badge/TypeScript-5.3%2B-blue)](https://www.typescriptlang.org/)
88
[![Security: A+](https://img.shields.io/badge/security-A%2B-success)](security/SECURITY-AUDIT.md)
99
[![Test Coverage](https://img.shields.io/badge/coverage-97.9%25-brightgreen)](tests/)
1010
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](../../LICENSE)
1111

12-
**CornerKit** brings the beautiful, continuous curve corners (squircles) of iOS design to your web applications. At just **3.66 KB gzipped** with **zero runtime dependencies**, it delivers professional-grade rounded corners with exceptional performance.
12+
**CornerKit** brings the beautiful, continuous curve corners (squircles) of iOS design to your web applications. At just **4.58 KB gzipped** with **zero runtime dependencies**, it delivers professional-grade rounded corners with exceptional performance.
1313

1414
```bash
1515
npm install @cornerkit/core
@@ -20,7 +20,7 @@ npm install @cornerkit/core
2020
## Key Strengths
2121

2222
### Exceptionally Tiny Bundle
23-
- **3.66 KB gzipped** (27% under budget!)
23+
- **4.58 KB gzipped** (8% under budget!)
2424
- Zero runtime dependencies
2525
- Tree-shakeable ES modules
2626
- Perfect for performance-conscious projects
@@ -132,13 +132,13 @@ ck.destroy();
132132
```html
133133
<!-- ES Module -->
134134
<script type="module">
135-
import CornerKit from 'https://cdn.jsdelivr.net/npm/@cornerkit/core@1.0.2/dist/cornerkit.esm.js';
135+
import CornerKit from 'https://cdn.jsdelivr.net/npm/@cornerkit/core@1.1.0/dist/cornerkit.esm.js';
136136
const ck = new CornerKit();
137137
ck.apply('.squircle', { radius: 24, smoothing: 0.6 });
138138
</script>
139139

140140
<!-- UMD (Global) -->
141-
<script src="https://cdn.jsdelivr.net/npm/@cornerkit/core@1.0.2/dist/cornerkit.js"></script>
141+
<script src="https://cdn.jsdelivr.net/npm/@cornerkit/core@1.1.0/dist/cornerkit.js"></script>
142142
<script>
143143
const ck = new CornerKit();
144144
ck.apply('.squircle', { radius: 24, smoothing: 0.6 });
@@ -158,9 +158,11 @@ const ck = new CornerKit(config?: SquircleConfig);
158158
**Default Configuration:**
159159
```typescript
160160
{
161-
radius: 16, // Corner radius in pixels
162-
smoothing: 0.6, // Curve smoothness 0.0-1.0 (0.6 = iOS standard)
163-
tier?: 'auto' // Rendering tier: 'auto' | 'native' | 'houdini' | 'clippath' | 'fallback'
161+
radius: 16, // Corner radius in pixels
162+
smoothing: 0.6, // Curve smoothness 0.0-1.0 (0.6 = iOS standard)
163+
borderWidth?: number, // Optional: Border width in pixels
164+
borderColor?: string, // Optional: Border color (any valid CSS color)
165+
tier?: 'auto' // Rendering tier: 'auto' | 'native' | 'houdini' | 'clippath' | 'fallback'
164166
}
165167
```
166168

@@ -173,6 +175,12 @@ Apply squircle corners to element(s).
173175
ck.apply('#button'); // Use defaults
174176
ck.apply('.card', { radius: 20 }); // Override radius
175177
ck.apply(element, { radius: 24, smoothing: 0.85 }); // Custom config
178+
ck.apply('.bordered', { // With border
179+
radius: 20,
180+
smoothing: 0.8,
181+
borderWidth: 2,
182+
borderColor: '#3b82f6'
183+
});
176184
```
177185

178186
#### `applyAll(selector, config?)`
@@ -270,6 +278,69 @@ When the corner radius is large relative to the element's dimensions, CornerKit
270278

271279
This preserves the characteristic iOS-style continuous curvature even when space is constrained, rather than degrading to circular arcs with sharp transitions.
272280

281+
### Border Support
282+
283+
CornerKit supports borders that follow the squircle path using a pseudo-element rendering technique.
284+
285+
**Basic Usage:**
286+
```javascript
287+
ck.apply('#element', {
288+
radius: 24,
289+
smoothing: 0.6,
290+
borderWidth: 2, // Border width in pixels
291+
borderColor: '#3b82f6' // Any valid CSS color
292+
});
293+
```
294+
295+
**HTML Data Attributes:**
296+
```html
297+
<div
298+
data-squircle
299+
data-squircle-radius="24"
300+
data-squircle-smoothing="0.6"
301+
data-squircle-border-width="2"
302+
data-squircle-border-color="#3b82f6"
303+
>
304+
Your content
305+
</div>
306+
```
307+
308+
**How It Works:**
309+
- Uses `::before` and `::after` pseudo-elements for layered rendering
310+
- `::before` renders the border (z-index: 0, larger squircle)
311+
- `::after` renders the background (z-index: 1, normal size)
312+
- Content is positioned on top (z-index: 2)
313+
- Border extends outward from element boundaries (outer stroke positioning)
314+
315+
**Important Notes:**
316+
- Elements with borders automatically get `position: relative` if needed
317+
- Original background is preserved on the `::after` pseudo-element
318+
- Pseudo-elements `::before` and `::after` are used by CornerKit for borders
319+
- Performance: ~0.4ms additional render time per bordered element
320+
321+
**Example with React:**
322+
```jsx
323+
import CornerKit from '@cornerkit/core';
324+
325+
function BorderedCard({ children }) {
326+
const ref = useRef(null);
327+
328+
useEffect(() => {
329+
const ck = new CornerKit();
330+
ck.apply(ref.current, {
331+
radius: 24,
332+
smoothing: 0.6,
333+
borderWidth: 2,
334+
borderColor: '#3b82f6'
335+
});
336+
337+
return () => ck.remove(ref.current);
338+
}, []);
339+
340+
return <div ref={ref}>{children}</div>;
341+
}
342+
```
343+
273344
---
274345

275346
## Performance Benchmarks
@@ -280,9 +351,9 @@ All metrics verified by automated performance tests and documented in SUCCESS-CR
280351

281352
| Format | Raw Size | Gzipped | Target | Result |
282353
|--------|----------|---------|--------|--------|
283-
| **ESM** (cornerkit.esm.js) | 12.02 KB | **3.66 KB** | <5KB | **27% under budget** |
284-
| **UMD** (cornerkit.js) | 12.41 KB | **3.78 KB** | <5KB | **24% under budget** |
285-
| **CJS** (cornerkit.cjs) | 12.31 KB | **3.69 KB** | <5KB | **26% under budget** |
354+
| **ESM** (cornerkit.esm.js) | 15.77 KB | **4.58 KB** | <5KB | **8% under budget** |
355+
| **UMD** (cornerkit.js) | 16.17 KB | **4.73 KB** | <5KB | **5% under budget** |
356+
| **CJS** (cornerkit.cjs) | 16.08 KB | **4.62 KB** | <5KB | **8% under budget** |
286357

287358
**Verification**: Automated bundle size monitoring in CI ensures every build stays under the 5KB gzipped target.
288359

@@ -555,15 +626,15 @@ npm run analyze-bundle
555626
═══════════════════════════════════════
556627
557628
cornerkit.esm.js
558-
Raw size: 12.02 KB
559-
Gzipped size: 3.63 KB PASS
629+
Raw size: 15.77 KB
630+
Gzipped size: 4.58 KB PASS
560631
561632
Summary:
562633
Target: 5.00 KB (5KB gzipped)
563-
Actual (ESM): 3.63 KB
564-
Usage: 72.7% of target
634+
Actual (ESM): 4.58 KB
635+
Usage: 91.6% of target
565636
SUCCESS: Bundle size meets target (<5KB)
566-
Remaining budget: 1.37 KB
637+
Remaining budget: 0.42 KB
567638
568639
Tree-Shaking Verification
569640
OK Debug code removed

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cornerkit/core",
3-
"version": "1.0.3",
3+
"version": "1.1.0",
44
"description": "Lightweight library for iOS-style squircle corners",
55
"type": "module",
66
"sideEffects": false,

website/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ website/
5555

5656
## Features
5757

58-
- **Live Interactive Playground**: Adjust radius/smoothing sliders, see real-time updates
58+
- **Live Interactive Playground**: Adjust radius/smoothing sliders, toggle borders with width/color controls, see real-time updates
59+
- **Border Support**: Squircle borders that follow the curve path with customizable width and color
5960
- **Visual Examples Gallery**: 15+ UI components with squircles (buttons, cards, modals, etc.)
6061
- **Side-by-Side Comparison**: Squircles vs border-radius
6162
- **Browser Compatibility Info**: Automatic tier detection (Native/Houdini/ClipPath/Fallback)

0 commit comments

Comments
 (0)