NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #4359 most downloaded on npm
Improve the debugging experience and add server-side rendering support to styled-components
Last release today
22 Oct 2026
Ships unpredictably
gaps range from 8 days to 2.9 years
Rarely documented
notes for 10 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
98 releases · first in 2016
860a70c : Add npm bugs metadata pointing to the GitHub issue tracker.
css prop is used in a CommonJS file without a styled-components import.css props.minmax(\n 0,\n 1fr\n); // comment). The comment check required balanced parentheses on the line, so the unmatched ) made the comment look like it was inside a value; after lines were joined, styled-components treated everything after // as a comment and silently dropped the following declarations and nested blocks. Unmatched closing parentheses are now ignored, which also stops url(//...) values after them from being truncated.declare module block also imports styled-components.import type from styled-components when finding the real styled import.styled.default.x losing displayName and componentId with import * as styled alongside the css prop or a default import.styled in a named import are recognized now. In import { css, styled } from 'styled-components', css and keyframes are minified, and with pure annotations turned on they are marked pure.styled.default(Component) with import * as styled or require.styled under any local name, such as import { styled as sc } or const sc = require('styled-components').styled.box, styled.foo, and styled.feNotAFilter are real components. const styled = require('styled-components'), import sc from 'styled-components', sc.default, ns.default, and __importDefault(require('styled-components')).default are that factory. Known non-tag exports stay plain, including sc.css, sc.keyframes, sc.createGlobalStyle, sc['createGlobalStyle'], sc.isStyledComponent, and sc.default.css. Names on Object.prototype or Function.prototype stay plain too, including sc.hasOwnProperty, sc.toString, sc.bind, sc.__lookupGetter__, sc.name, and sc.__proto__. A computed key is resolved when it is a string, a template whose parts all fold to strings, or a const initialized to one of those, so const name = 'css'; sc[name], sc[`css`], and sc[`${'css'}`] stay plain, while const css = 'div'; sc[css] and sc.default[css] keep their ids. A key this plugin cannot resolve stays plain on require() and on an alias that is not named styled, so let dynamic = 'css'; sc[dynamic] returns the helper instead of throwing. styled[dynamic] on an import named styled is still decorated. A let or var that starts as the factory keeps its display name on a straight-line use written before the reassignment. A use inside a nested function, or inside a loop that also reassigns the binding, is left alone, so that function and the next loop iteration do not throw.content: "it's"; // note).One column per quarter.
0c5f21d : Add a cssPropImportPath option to control which package the css-prop transform auto-imports styled from when the file has no existing styled
cssPropImportPath option to control which package the css-prop transform auto-imports styled from when the file has no existing styled import. Defaults to 'styled-components' (existing behavior). React Native targets can set it to 'styled-components/native' so the auto-injected import resolves to the right runtime.const styled = baseStyled as ThemedStyledInterface<MyTheme>. After type-stripping Babel sees a plain const styled = baseStyled, and the detector now follows single-identifier alias chains so styled.div resolves back to the original import.css={{ ... }} object key matches a local binding name (e.g. ({ position }) => <div css={{ position: 'absolute' }} />). The reducer no longer mis-treats non-computed property names as scope references, so plain keys stay literal while only computed [expr] keys are extracted as prop interpolations.__importDefault interop helper alongside Babel's _interopRequireDefault. Files compiled through tsc / ts-jest (which emit var sc_1 = __importDefault(require('styled-components'))) now flow into the same detection path as Babel-compiled output, so styled declarations downstream pick up displayName and componentId as expected.a40e3f7 : Refresh the toolchain and fix a handful of css-prop transform bugs that had crept in under recent Babel versions.
styled and also uses one or more css={…} props, every styled component now keeps its display name and stable component id. Previously the cache that tracks the local default import could be overwritten on each css-prop usage, which silently dropped the display name and id for the surrounding styled.div declarations.css={{ [foo]: bar }} with a non-primitive value no longer fails Babel's validator. Computed keys are preserved through the css-prop object rewrite.ReferenceError.lodash dependency. The plugin now ships with @babel/core as a declared peer.Bump ansi-regex from 5.0.0 to 5.0.1 by @dependabot in #391
Full Changelog: v2.1.3...v2.1.4
When testing import paths, only use string literals. by @maisano-patreon in #389
Full Changelog: v2.1.1...v2.1.3
Nothing published for this version
Add tricky expression on object expression by @healtheloper in #381
Full Changelog: v2.0.7...v2.1.1
Nothing published for this version
fix minifier bug #366 by @agriffis in #376
Revert change from 2.0.5 that lead to a major build performance regression.
Revert change from 2.0.5 that lead to a major build performance regression.
Full Changelog: v2.0.5...v2.0.6
One more change related to babel macro; eliminates an extra injected import in some cases
One more change related to babel macro; eliminates an extra injected import in some cases
Full Changelog: v2.0.4...v2.0.5
fix compat with styled-components babel macro
fix compat with styled-components babel macro
Full Changelog: v2.0.3...v2.0.4
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →