Skip to content

Releases: jeremybanka/corners

v0.1.0

15 Jul 22:36
Compare
Choose a tag to compare

Minor Changes

  • a0b5fe3: 💥 BREAKING CHANGE: Backgrounds of layers no longer default to ⬛ black but to 🏁 transparent instead.
  • 8479511: 💥 BREAKING CHANGE: When useClipPath is false, css background is no longer automatically made 🏁 transparent.
  • 8479511: 💥 BREAKING CHANGE: The use of clip-path remains on by default. however, the flag has been renamed from noClipping to useClipPath. useClipPath: false overrides the default behavior in the same way noClipping: true did previously.

v0.0.14

11 Jun 00:10
8282011
Compare
Choose a tag to compare

Patch Changes

  • 8700300: ✨ Export interpolate utility for drawing corners. It's a simple utility, useful for placing a point partway between two other points. (e.g., x: interpolate(p1.x, p2.x, 0.5))

  • 8e4172b: 💄✨ Layers created using the layers API can now include className. The idea is to make it more convenient to target layers with styling changes.

    // src/components/containers/LAYER.ts
    export const LAYER: Record<string, Layer> = {
      DOTTED_STROKE: {
        className: "dotted-stroke",                   // <--- new
        stroke: {
          color: "black",
          width: 1,
          dashPattern: [2, 2],
        }
      }
      SOFT_SPREAD_SHADOW: {
        className: "soft-spread-shadow",              // <--- new
        shadow: {
          color: "black",
          spread: 2,
          blur: 20,
          offset: { x: 0, y: 2 },
        }
      }
    } as const
    // src/components/containers/button.ts
    import Emotion from "@emotion/styled"
    import { rounded } from "corners"
    
    import { LAYER } from "./LAYER"
    
    const styled = {
      dottedStrokeButton: Emotion(
        rounded.button, {
          noClipping: true,
          below: [
            LAYER.SOFT_SPREAD_SHADOW,
            LAYER.DOTTED_STROKE,
          ],
        }
      ),
    }
    export const button = {
      softDottedStroke: styled.dottedStrokeButton`
        &:hover {
          > svg.dotted-stroke > path {                // <--- permits targeting!
            // ... //
          }
          > svg.soft-spread-shadow > path {           // <--- permits targeting!
            // ... //
          }
        }
      `
    }
    // src/components/Component.tsx
    import { button } from "./containers/button"
    
    const Component = () => (
      <button.softDottedStroke>
        This renders a {`<button>`} node with {`<svg>`} nodes inside it, sized to fit the button.
      </button.softDottedStroke>
    )

v0.0.13

07 Dec 00:07
37a4793
Compare
Choose a tag to compare

Patch Changes

v0.0.12

06 Dec 23:24
c309608
Compare
Choose a tag to compare

Patch Changes

  • 0766edb: don't break builds with weird custom paths

v0.0.11

07 Nov 23:52
aa1b887
Compare
Choose a tag to compare

Patch Changes

  • 2587a41: Internal cleanup

    I changed the package.json file to organize dependencies better.

v0.0.10

07 Nov 08:59
659859c
Compare
Choose a tag to compare

Patch Changes

  • c87c74d: Internal Refactoring of the Layers System

v0.0.9

03 Oct 01:00
bfb8e82
Compare
Choose a tag to compare

Patch Changes

  • c74b24d: Layers API

    The Layers API is a new fluent API that provides an alternative to svg clipping paths.

    It is meant for adding shadows and strokes to your corner component that can extend beyond its original boundaries.

v0.0.8

31 Jan 02:09
1d828a9
Compare
Choose a tag to compare

Patch Changes

  • d4e10a5: Shadow, Stroke, and Fill Layers without clip-path