Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Jun 28, 2023

This PR contains the following updates:

Package Change Age Confidence
styled-components (source) ^5.3.5^6.0.0 age confidence

Release Notes

styled-components/styled-components (styled-components)

v6.3.5

Compare Source

Patch Changes
  • 7ff7002: Fix: Line comments (//) in multiline CSS declarations no longer cause parsing errors (fixes #​5613)

    JS-style line comments (//) placed after multiline declarations like calc() were not being properly stripped, causing CSS parsing issues. Comments are now correctly removed anywhere in the CSS while preserving valid syntax.

    Example that now works:

    const Box = styled.div`
      max-height: calc(100px + 200px + 300px); // This comment no longer breaks parsing
      background-color: green;
    `;
  • 7ff7002: Fix: Contain invalid CSS syntax to just the affected line

    In styled-components v6, invalid CSS syntax (like unbalanced braces) could cause all subsequent styles to be ignored. This fix ensures that malformed CSS only affects the specific declaration, not subsequent valid styles.

    Example that now works:

    const Circle = styled.div`
      width: 100px;
      line-height: ${() => '14px}'}; // ⛔️ This malformed line is dropped
      background-color: green; // ✅ Now preserved (was ignored in v6)
    `;

v6.3.4

Compare Source

Patch Changes
  • 8e8c282: Fixed createGlobalStyle to not use useLayoutEffect on the server, which was causing a warning and broken styles in v6.3.x. The check typeof React.useLayoutEffect === 'function' is not reliable for detecting server vs client environments in React 18+, so we now use the __SERVER__ build constant instead.

v6.3.3

Compare Source

Patch Changes
  • 6e4d1e7: fix: suppress false "created dynamically" warnings in React Server Components

    The dynamic creation warning check now properly detects RSC environments and skips validation when IS_RSC is true. This eliminates false warnings for module-level styled components in server components, which were incorrectly flagged due to RSC's different module evaluation context. Module-level styled components in RSC files no longer trigger warnings since they cannot be created inside render functions by definition.

v6.3.2

Compare Source

Patch Changes
  • a4b4a6b: fix: include TypeScript declaration files in npm package

    Fixed Rollup TypeScript plugin configuration to override tsconfig.json's noEmit setting, ensuring TypeScript declaration files are generated during build.

  • a4b4a6b: fix: resolve TypeScript error blocking type declaration emission

    Fixed TypeScript error in StyledComponent when merging style attributes from attrs. Added explicit type cast to React.CSSProperties to safely merge CSS property objects. This error was preventing TypeScript declaration files from being generated during build.

v6.3.1

Compare Source

Patch Changes
  • 046e880: Ensure TypeScript declaration files are included in npm package, needed to tweak a Rollup setting.

v6.3.0

Compare Source

Minor Changes
  • 28fd502: Add React Server Components (RSC) support

    styled-components now automatically detects RSC environments and handles CSS delivery appropriately:

    • No 'use client' directive required: Components work in RSC without any wrapper or directive
    • Automatic CSS injection: In RSC mode, styled components emit inline <style> tags that React 19 automatically hoists and deduplicates
    • Zero configuration: Works out of the box with Next.js App Router and other RSC-enabled frameworks
    • Backward compatible: Existing SSR patterns with ServerStyleSheet continue to work unchanged

    RSC best practices:

    • Prefer static styles over dynamic interpolations to avoid serialization overhead
    • Use data attributes for discrete variants (e.g., &[data-size='lg'])
    • CSS custom properties work perfectly in styled-components, can be set via inline style, and cascade to children:
    const Container = styled.div``;
    const Button = styled.button`
      background: var(--color-primary, blue);
    `;
    
    // Variables set on parent cascade to all DOM children
    <Container style={{ '--color-primary': 'orchid' }}>
      <Button>Inherits orchid background</Button>
    </Container>;
    • Use build-time CSS variable generation for theming since ThemeProvider is a no-op in RSC

    Technical details:

    • RSC detection via typeof React.createContext === 'undefined'
    • ThemeProvider and StyleSheetManager become no-ops in RSC (children pass-through)
    • React hooks are conditionally accessed via runtime guards
    • CSS is retrieved from the StyleSheet Tag for inline delivery in RSC mode
  • 856cf06: feat: update built-in element aliases to include modern HTML and SVG elements

    Added support for modern HTML and SVG elements that were previously missing:

    HTML elements:

    • search - HTML5 search element
    • slot - Web Components slot element
    • template - HTML template element

    SVG filter elements:

    • All fe* filter primitive elements (feBlend, feColorMatrix, feComponentTransfer, etc.)
    • clipPath, linearGradient, radialGradient - gradient and clipping elements
    • textPath - SVG text path element
    • switch, symbol, use - SVG structural elements

    This ensures styled-components has comprehensive coverage of all styleable HTML and SVG elements supported by modern browsers and React.

Patch Changes
  • 418adbe: fix(types): add CSS custom properties (variables) support to style prop

    CSS custom properties (CSS variables like --primary-color) are now fully supported in TypeScript without errors:

    • .attrs({ style: { '--var': 'value' } }) - CSS variables in attrs
    • <Component style={{ '--var': 'value' }} /> - CSS variables in component props
    • Mixed usage with regular CSS properties works seamlessly
  • aef2ad6: Update shared css property handling tools to latest versions.

v6.2.0

Compare Source

v6.1.19

Compare Source

Patch Changes
  • aa997d8: fix for React Native >=0.79 crashes when using unsupported web-only CSS values (e.g., fit-content, min-content, max-content). The fix emits a warning and ignores the property using those values, instead of causing crashes.

v6.1.18

Compare Source

Patch Changes
  • 76b18a4: fix react 19 compatibility
  • bdac7af: Quickfix to support expo sdk >= 53 and react-native >=0.79.

v6.1.17

Compare Source

Patch Changes
  • 47a4dcb: Fix for loose DefaultTheme type definition
  • a8c0f5b: fix: add info link to console

v6.1.16

Compare Source

Patch Changes
  • 246c77b: Resolve TS error related to ExoticComponentWithDisplayName API from React.
  • 4757191: Native typings weren't on the correct folder, which caused issues on React Native projects using this library

v6.1.15

Compare Source

Patch Changes
  • b9688ae: chore: update postcss to version 8.4.49 and nanoid to version 3.3.8

v6.1.14

Compare Source

Patch Changes
  • 6908326: Add changesets for release management
  • 18ebf6d: Prevent styled() from injecting an undefined ref prop in React 19

v6.1.13

Compare Source

What's Changed

New Contributors

Full Changelog: styled-components/styled-components@v6.1.12...v6.1.13

v6.1.12

Compare Source

What's Changed

New Contributors

Full Changelog: styled-components/styled-components@v6.1.11...v6.1.12

v6.1.11

Compare Source

What's Changed

Full Changelog: styled-components/styled-components@v6.1.10...v6.1.11

v6.1.10

Compare Source

What's Changed

New Contributors

Full Changelog: styled-components/styled-components@v6.1.9...v6.1.10

v6.1.9

Compare Source

What's Changed

New Contributors

Full Changelog: styled-components/styled-components@v6.1.8...v6.1.9

v6.1.8

Compare Source

Revert adding peerDependencies from v6.1.7; apparently some package managers have differing behaviors around peerDependenciesMeta[package].optional which is causing issues. Will revisit at a later date if possible.

Full Changelog: styled-components/styled-components@v6.1.7...v6.1.8

v6.1.7

Compare Source

What's Changed

  • chore: add all missing peer dependency statements by @​quantizor in #​4243

    NOTE: this change may cause some installed dependency duplication until this NPM bug is addressed but yarn and pnpm have correct behavior. Bun also has a similar bug.

    Overall these changes ensure that styled-components is specifying a known working version of all utilized libraries, while instructing the client package manager that higher semver-compliant versions are permissible and should work, assuming the relevant libraries are compliant in practice.

Full Changelog: styled-components/styled-components@v6.1.6...v6.1.7

v6.1.6

Compare Source

What's Changed

Full Changelog: styled-components/styled-components@v6.1.5...v6.1.6

v6.1.5

Compare Source

What's Changed

Full Changelog: styled-components/styled-components@v6.1.4...v6.1.5

v6.1.4

Compare Source

What's Changed

Full Changelog: styled-components/styled-components@v6.1.3...v6.1.4

v6.1.3

Compare Source

What's Changed

New Contributors

Full Changelog: styled-components/styled-components@v6.1.2...v6.1.3

v6.1.2

What's Changed

New Contributors

Full Changelog: styled-components/styled-components@v6.1.1...v6.1.2

v6.1.1

What's Changed

New Contributors

Full Changelog: styled-components/styled-components@v6.1.0...v6.1.1

v6.1.0

Compare Source

What's Changed

New Contributors

Full Changelog: styled-components/styled-components@v6.0.9...v6.1.0

v6.0.9

Compare Source

fix bundling to not hardcode window (should fix some testing use cases that were incorrectly assuming a server environment when JSDOM and similar are in use)

Full Changelog: styled-components/styled-components@v6.0.8...v6.0.9

v6.0.8

Compare Source

What's Changed

New Contributors

Full Changelog: styled-components/styled-components@v6.0.7...v6.0.8

v6.0.7

Compare Source

What's Changed

New Contributors

Full Changelog: styled-components/styled-components@v6.0.6...v6.0.7

v6.0.6

Compare Source

What's Changed

New Contributors

Full Changelog: styled-components/styled-components@v6.0.5...v6.0.6

v6.0.5

Compare Source

What's Changed

New Contributors

Full Changelog: styled-components/styled-components@v6.0.4...v6.0.5

v6.0.4

Compare Source

What's Changed

  • refactor: dev warning on unknown props retargeted specifically toward HTML targets rather than other React components by @​woodreamz in #​4084
  • fix: untyped event handler callbacks by @​ziolekjj in #​4086

New Contributors

Full Changelog: styled-components/styled-components@v6.0.3...v6.0.4

v6.0.3

Compare Source

What's Changed

New Contributors

Full Changelog: styled-components/styled-components@v6.0.2...v6.0.3

v6.0.2

Compare Source

What's Changed

  • fix: StyleSheetManager must accept undefined props by @​gineika in #​4069
  • fix: replace slow Omit type by @​gineika in #​4068
  • drop displayName in production to save bytes, it's already present in the static className if you're using the babel plugin or equivalent
  • refactor use of flatMap and at with ES5-compliant variants

New Contributors

Full Changelog: styled-components/styled-components@v6.0.1...v6.0.2

v6.0.1

Compare Source

Fixed an issue where a dev-time warning was being triggered too eagerly.

Full Changelog: styled-components/styled-components@v6.0.0...v6.0.1

v6.0.0

Compare Source

yarn add styled-components

Changed in this version

  • fix(types): prevent prop bleed on styling properties (fixes #​4053, c0f8015)
  • feat(types): ship csstype via "CSS" namespace (e6c4f0a)
  • chore: bump stylis to 4.3 (fixes #​4007, fa58875)
  • reduced some sources of unnecessary branching logic

Breaking changes in v6

Migration guide → https://styled-components.com/docs/faqs#what-do-i-need-to-do-to-migrate-to-v6

  • now using stylis v4 (if using stylis-plugin-rtl you'll need to upgrade to the newer version)
  • styled-components now provides its own types; if you installed @types/styled-components in the past, you'll want to remove it
  • dropped $as and $forwardedAs props (use as or forwardedAs)
  • dropped automatic prop filtering; use transient props ($ prefix) for stuff you don't want to be passed to child component / HTML
  • StyleSheetManager
    • replaced disableVendorPrefixes with enableVendorPrefixes prop
    • dropped automatic vendor prefixing; if you need to support older browsers, you can re-enable it easily with the above prop
      <StyleSheetManager enableVendorPrefixes>
        {/* your React tree and ThemeProvider goes here */}
      </StyleSheetManager>
  • dropped deprecated withComponent API (87f511a); use "as" prop instead
  • node >= 14 needed

Full Changelog: styled-components/styled-components@v5.3.7...v6.0.0

v5.3.11

Compare Source

Removed use of the useDebugValue hook to rectify older React support.

Full Changelog: styled-components/styled-components@v5.3.10...v5.3.11

v5.3.10

Compare Source

What's Changed

Full Changelog: styled-components/styled-components@v5.3.9...v5.3.10

v5.3.9

Compare Source

What's Changed

Full Changelog: styled-components/styled-components@v5.3.8...v5.3.9

v5.3.8

Compare Source

What's Changed

fix(constants): rework process env guard

Full Changelog: styled-components/styled-components@v5.3.7-fixed...v5.3.8

v5.3.7

Compare Source

v5.3.6

Compare Source

What's Changed

Deprecations

  • $as and $forwardedAs will be removed in the next major version, use the unprefixed props instead

New Contributors

Full Changelog: styled-components/styled-components@v5.3.5...v5.3.6


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@netlify
Copy link

netlify bot commented Jun 28, 2023

Deploy Preview for arcus failed.

Name Link
🔨 Latest commit 25f2cba
🔍 Latest deploy log https://app.netlify.com/sites/arcus/deploys/6792028050b9720008ac3efd

@renovate renovate bot force-pushed the renovate-styled-components-6.x branch from 9d87a2d to f78a031 Compare August 17, 2023 08:53
@renovate renovate bot force-pushed the renovate-styled-components-6.x branch from f78a031 to 65e41a1 Compare February 7, 2024 21:55
@renovate renovate bot force-pushed the renovate-styled-components-6.x branch 2 times, most recently from 517f24f to e68b3e3 Compare March 1, 2024 05:37
@renovate renovate bot force-pushed the renovate-styled-components-6.x branch from e68b3e3 to 2cb8ad7 Compare March 6, 2024 11:28
@renovate renovate bot force-pushed the renovate-styled-components-6.x branch from 2cb8ad7 to 39f21ad Compare April 3, 2024 04:56
@renovate renovate bot force-pushed the renovate-styled-components-6.x branch from 39f21ad to a3b8306 Compare June 21, 2024 11:56
@renovate renovate bot force-pushed the renovate-styled-components-6.x branch from a3b8306 to 9f3374c Compare July 8, 2024 05:34
@renovate renovate bot force-pushed the renovate-styled-components-6.x branch from 9f3374c to 66f575d Compare July 23, 2024 04:49
@renovate renovate bot force-pushed the renovate-styled-components-6.x branch from 66f575d to 92ed777 Compare August 27, 2024 06:49
@renovate renovate bot force-pushed the renovate-styled-components-6.x branch from 92ed777 to 25f2cba Compare January 23, 2025 08:49
@renovate renovate bot force-pushed the renovate-styled-components-6.x branch from 25f2cba to 9b73ae2 Compare August 4, 2025 18:54
@netlify
Copy link

netlify bot commented Aug 4, 2025

Deploy Preview for arcus failed.

Name Link
🔨 Latest commit 9b73ae2
🔍 Latest deploy log https://app.netlify.com/projects/arcus/deploys/689101d66ab77b0008b54002

@renovate renovate bot force-pushed the renovate-styled-components-6.x branch from 9b73ae2 to 1eaced0 Compare January 6, 2026 02:06
@netlify
Copy link

netlify bot commented Jan 6, 2026

Deploy Preview for arcus failed.

Name Link
🔨 Latest commit 686a56a
🔍 Latest deploy log https://app.netlify.com/projects/arcus/deploys/69632b0a297b2b0008e05105

@renovate renovate bot force-pushed the renovate-styled-components-6.x branch 4 times, most recently from 215d96e to 17ba7dc Compare January 10, 2026 21:35
@renovate renovate bot force-pushed the renovate-styled-components-6.x branch from 17ba7dc to 686a56a Compare January 11, 2026 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant