You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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>
**[Live Demo](https://bejarcode.github.io/cornerKit/)** - Interactive playground with 36+ UI examples
14
14
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`.
16
16
17
17
## Why Squircles?
18
18
@@ -37,8 +37,10 @@ const ck = new CornerKit();
37
37
38
38
// Apply to any element
39
39
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
42
44
});
43
45
```
44
46
@@ -63,7 +65,7 @@ ck.apply('.card', {
63
65
## Why CornerKit?
64
66
65
67
### Exceptionally Tiny
66
-
-**3.66 KB gzipped** (ESM) - 27% under 5KB budget
68
+
-**4.58 KB gzipped** (ESM) - 8% under 5KB budget
67
69
-**Zero runtime dependencies**
68
70
- Tree-shakeable ES modules
69
71
- Smaller than most icon libraries
@@ -185,7 +187,7 @@ All metrics verified by automated tests on 2020 MacBook Pro (M1):
**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.
@@ -270,6 +278,69 @@ When the corner radius is large relative to the element's dimensions, CornerKit
270
278
271
279
This preserves the characteristic iOS-style continuous curvature even when space is constrained, rather than degrading to circular arcs with sharp transitions.
272
280
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
+
importCornerKitfrom'@cornerkit/core';
324
+
325
+
functionBorderedCard({ children }) {
326
+
constref=useRef(null);
327
+
328
+
useEffect(() => {
329
+
constck=newCornerKit();
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
+
273
344
---
274
345
275
346
## Performance Benchmarks
@@ -280,9 +351,9 @@ All metrics verified by automated performance tests and documented in SUCCESS-CR
280
351
281
352
| Format | Raw Size | Gzipped | Target | Result |
282
353
|--------|----------|---------|--------|--------|
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**|
286
357
287
358
**Verification**: Automated bundle size monitoring in CI ensures every build stays under the 5KB gzipped target.
0 commit comments