styled-components 5.3.9 → 5.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (234) hide show
  1. package/dist/styled-components.browser.cjs.js +1 -1
  2. package/dist/styled-components.browser.cjs.js.map +1 -1
  3. package/dist/styled-components.browser.esm.js +1 -1
  4. package/dist/styled-components.browser.esm.js.map +1 -1
  5. package/dist/styled-components.cjs.js +1 -1
  6. package/dist/styled-components.cjs.js.map +1 -1
  7. package/dist/styled-components.esm.js +1 -1
  8. package/dist/styled-components.esm.js.map +1 -1
  9. package/dist/styled-components.js +1 -1
  10. package/dist/styled-components.js.map +1 -1
  11. package/dist/styled-components.min.js +1 -1
  12. package/dist/styled-components.min.js.map +1 -1
  13. package/native/dist/base.d.ts +2 -3
  14. package/native/dist/constructors/constructWithOptions.d.ts +2 -2
  15. package/native/dist/index.d.ts +1 -1
  16. package/native/dist/models/ComponentStyle.d.ts +0 -1
  17. package/native/dist/models/StyleSheetManager.d.ts +6 -7
  18. package/native/dist/models/ThemeProvider.d.ts +1 -0
  19. package/native/dist/native/index.d.ts +25 -26
  20. package/native/dist/sheet/GroupedTag.d.ts +1 -1
  21. package/native/dist/styled-components.native.cjs.js +3 -3
  22. package/native/dist/styled-components.native.cjs.js.map +1 -1
  23. package/native/dist/styled-components.native.esm.js +3 -3
  24. package/native/dist/styled-components.native.esm.js.map +1 -1
  25. package/native/dist/test/types.d.ts +9 -1
  26. package/native/dist/types.d.ts +16 -18
  27. package/native/dist/utils/determineTheme.d.ts +4 -2
  28. package/native/dist/utils/domElements.d.ts +1 -1
  29. package/native/dist/utils/flatten.d.ts +1 -1
  30. package/native/dist/utils/isPlainObject.d.ts +1 -1
  31. package/native/dist/utils/isStatelessFunction.d.ts +1 -1
  32. package/native/dist/utils/joinStrings.d.ts +2 -1
  33. package/package.json +1 -1
  34. package/primitives/dist/styled-components-primitives.cjs.js +3 -3
  35. package/primitives/dist/styled-components-primitives.cjs.js.map +1 -1
  36. package/primitives/dist/styled-components-primitives.esm.js +3 -3
  37. package/primitives/dist/styled-components-primitives.esm.js.map +1 -1
  38. package/native/dist/base.d.ts.map +0 -1
  39. package/native/dist/constants.d.ts.map +0 -1
  40. package/native/dist/constructors/constructWithOptions.d.ts.map +0 -1
  41. package/native/dist/constructors/createGlobalStyle.d.ts.map +0 -1
  42. package/native/dist/constructors/css.d.ts.map +0 -1
  43. package/native/dist/constructors/keyframes.d.ts.map +0 -1
  44. package/native/dist/constructors/styled.d.ts.map +0 -1
  45. package/native/dist/dist/base.d.ts +0 -18
  46. package/native/dist/dist/base.d.ts.map +0 -1
  47. package/native/dist/dist/constants.d.ts +0 -9
  48. package/native/dist/dist/constants.d.ts.map +0 -1
  49. package/native/dist/dist/constructors/constructWithOptions.d.ts +0 -20
  50. package/native/dist/dist/constructors/constructWithOptions.d.ts.map +0 -1
  51. package/native/dist/dist/constructors/createGlobalStyle.d.ts +0 -4
  52. package/native/dist/dist/constructors/createGlobalStyle.d.ts.map +0 -1
  53. package/native/dist/dist/constructors/css.d.ts +0 -5
  54. package/native/dist/dist/constructors/css.d.ts.map +0 -1
  55. package/native/dist/dist/constructors/keyframes.d.ts +0 -4
  56. package/native/dist/dist/constructors/keyframes.d.ts.map +0 -1
  57. package/native/dist/dist/constructors/styled.d.ts +0 -186
  58. package/native/dist/dist/constructors/styled.d.ts.map +0 -1
  59. package/native/dist/dist/hoc/withTheme.d.ts +0 -4
  60. package/native/dist/dist/hoc/withTheme.d.ts.map +0 -1
  61. package/native/dist/dist/hoc/withTheme.spec.d.ts +0 -2
  62. package/native/dist/dist/hoc/withTheme.spec.d.ts.map +0 -1
  63. package/native/dist/dist/hooks/useTheme.d.ts +0 -4
  64. package/native/dist/dist/hooks/useTheme.d.ts.map +0 -1
  65. package/native/dist/dist/index-standalone.d.ts +0 -3
  66. package/native/dist/dist/index-standalone.d.ts.map +0 -1
  67. package/native/dist/dist/index.d.ts +0 -4
  68. package/native/dist/dist/index.d.ts.map +0 -1
  69. package/native/dist/dist/macro/index.d.ts +0 -3
  70. package/native/dist/dist/macro/index.d.ts.map +0 -1
  71. package/native/dist/dist/macro/test/babel.config.d.ts +0 -1
  72. package/native/dist/dist/macro/test/babel.config.d.ts.map +0 -1
  73. package/native/dist/dist/models/ComponentStyle.d.ts +0 -16
  74. package/native/dist/dist/models/ComponentStyle.d.ts.map +0 -1
  75. package/native/dist/dist/models/GlobalStyle.d.ts +0 -12
  76. package/native/dist/dist/models/GlobalStyle.d.ts.map +0 -1
  77. package/native/dist/dist/models/InlineStyle.d.ts +0 -7
  78. package/native/dist/dist/models/InlineStyle.d.ts.map +0 -1
  79. package/native/dist/dist/models/Keyframes.d.ts +0 -12
  80. package/native/dist/dist/models/Keyframes.d.ts.map +0 -1
  81. package/native/dist/dist/models/ServerStyleSheet.d.ts +0 -16
  82. package/native/dist/dist/models/ServerStyleSheet.d.ts.map +0 -1
  83. package/native/dist/dist/models/StyleSheetManager.d.ts +0 -22
  84. package/native/dist/dist/models/StyleSheetManager.d.ts.map +0 -1
  85. package/native/dist/dist/models/StyledComponent.d.ts +0 -4
  86. package/native/dist/dist/models/StyledComponent.d.ts.map +0 -1
  87. package/native/dist/dist/models/StyledNativeComponent.d.ts +0 -4
  88. package/native/dist/dist/models/StyledNativeComponent.d.ts.map +0 -1
  89. package/native/dist/dist/models/ThemeProvider.d.ts +0 -18
  90. package/native/dist/dist/models/ThemeProvider.d.ts.map +0 -1
  91. package/native/dist/dist/native/index.d.ts +0 -65
  92. package/native/dist/dist/native/index.d.ts.map +0 -1
  93. package/native/dist/dist/primitives/index.d.ts +0 -23
  94. package/native/dist/dist/primitives/index.d.ts.map +0 -1
  95. package/native/dist/dist/secretInternals.d.ts +0 -6
  96. package/native/dist/dist/secretInternals.d.ts.map +0 -1
  97. package/native/dist/dist/sheet/GroupIDAllocator.d.ts +0 -5
  98. package/native/dist/dist/sheet/GroupIDAllocator.d.ts.map +0 -1
  99. package/native/dist/dist/sheet/GroupedTag.d.ts +0 -12
  100. package/native/dist/dist/sheet/GroupedTag.d.ts.map +0 -1
  101. package/native/dist/dist/sheet/Rehydration.d.ts +0 -4
  102. package/native/dist/dist/sheet/Rehydration.d.ts.map +0 -1
  103. package/native/dist/dist/sheet/Sheet.d.ts +0 -41
  104. package/native/dist/dist/sheet/Sheet.d.ts.map +0 -1
  105. package/native/dist/dist/sheet/Tag.d.ts +0 -55
  106. package/native/dist/dist/sheet/Tag.d.ts.map +0 -1
  107. package/native/dist/dist/sheet/dom.d.ts +0 -5
  108. package/native/dist/dist/sheet/dom.d.ts.map +0 -1
  109. package/native/dist/dist/sheet/index.d.ts +0 -2
  110. package/native/dist/dist/sheet/index.d.ts.map +0 -1
  111. package/native/dist/dist/sheet/types.d.ts +0 -35
  112. package/native/dist/dist/sheet/types.d.ts.map +0 -1
  113. package/native/dist/dist/test/globals.d.ts +0 -3
  114. package/native/dist/dist/test/globals.d.ts.map +0 -1
  115. package/native/dist/dist/test/utils.d.ts +0 -192
  116. package/native/dist/dist/test/utils.d.ts.map +0 -1
  117. package/native/dist/dist/types.d.ts +0 -121
  118. package/native/dist/dist/types.d.ts.map +0 -1
  119. package/native/dist/dist/utils/addUnitIfNeeded.d.ts +0 -2
  120. package/native/dist/dist/utils/addUnitIfNeeded.d.ts.map +0 -1
  121. package/native/dist/dist/utils/checkDynamicCreation.d.ts +0 -2
  122. package/native/dist/dist/utils/checkDynamicCreation.d.ts.map +0 -1
  123. package/native/dist/dist/utils/createWarnTooManyClasses.d.ts +0 -4
  124. package/native/dist/dist/utils/createWarnTooManyClasses.d.ts.map +0 -1
  125. package/native/dist/dist/utils/determineTheme.d.ts +0 -3
  126. package/native/dist/dist/utils/determineTheme.d.ts.map +0 -1
  127. package/native/dist/dist/utils/domElements.d.ts +0 -3
  128. package/native/dist/dist/utils/domElements.d.ts.map +0 -1
  129. package/native/dist/dist/utils/empties.d.ts +0 -4
  130. package/native/dist/dist/utils/empties.d.ts.map +0 -1
  131. package/native/dist/dist/utils/error.d.ts +0 -6
  132. package/native/dist/dist/utils/error.d.ts.map +0 -1
  133. package/native/dist/dist/utils/errors.d.ts +0 -21
  134. package/native/dist/dist/utils/errors.d.ts.map +0 -1
  135. package/native/dist/dist/utils/escape.d.ts +0 -6
  136. package/native/dist/dist/utils/escape.d.ts.map +0 -1
  137. package/native/dist/dist/utils/flatten.d.ts +0 -5
  138. package/native/dist/dist/utils/flatten.d.ts.map +0 -1
  139. package/native/dist/dist/utils/generateAlphabeticName.d.ts +0 -2
  140. package/native/dist/dist/utils/generateAlphabeticName.d.ts.map +0 -1
  141. package/native/dist/dist/utils/generateComponentId.d.ts +0 -2
  142. package/native/dist/dist/utils/generateComponentId.d.ts.map +0 -1
  143. package/native/dist/dist/utils/generateDisplayName.d.ts +0 -3
  144. package/native/dist/dist/utils/generateDisplayName.d.ts.map +0 -1
  145. package/native/dist/dist/utils/getComponentName.d.ts +0 -3
  146. package/native/dist/dist/utils/getComponentName.d.ts.map +0 -1
  147. package/native/dist/dist/utils/hash.d.ts +0 -4
  148. package/native/dist/dist/utils/hash.d.ts.map +0 -1
  149. package/native/dist/dist/utils/hoist.d.ts +0 -52
  150. package/native/dist/dist/utils/hoist.d.ts.map +0 -1
  151. package/native/dist/dist/utils/hyphenateStyleName.d.ts +0 -15
  152. package/native/dist/dist/utils/hyphenateStyleName.d.ts.map +0 -1
  153. package/native/dist/dist/utils/interleave.d.ts +0 -3
  154. package/native/dist/dist/utils/interleave.d.ts.map +0 -1
  155. package/native/dist/dist/utils/isFunction.d.ts +0 -2
  156. package/native/dist/dist/utils/isFunction.d.ts.map +0 -1
  157. package/native/dist/dist/utils/isPlainObject.d.ts +0 -2
  158. package/native/dist/dist/utils/isPlainObject.d.ts.map +0 -1
  159. package/native/dist/dist/utils/isStatelessFunction.d.ts +0 -2
  160. package/native/dist/dist/utils/isStatelessFunction.d.ts.map +0 -1
  161. package/native/dist/dist/utils/isStaticRules.d.ts +0 -3
  162. package/native/dist/dist/utils/isStaticRules.d.ts.map +0 -1
  163. package/native/dist/dist/utils/isStyledComponent.d.ts +0 -3
  164. package/native/dist/dist/utils/isStyledComponent.d.ts.map +0 -1
  165. package/native/dist/dist/utils/isTag.d.ts +0 -3
  166. package/native/dist/dist/utils/isTag.d.ts.map +0 -1
  167. package/native/dist/dist/utils/joinStrings.d.ts +0 -5
  168. package/native/dist/dist/utils/joinStrings.d.ts.map +0 -1
  169. package/native/dist/dist/utils/mixinDeep.d.ts +0 -8
  170. package/native/dist/dist/utils/mixinDeep.d.ts.map +0 -1
  171. package/native/dist/dist/utils/nonce.d.ts +0 -2
  172. package/native/dist/dist/utils/nonce.d.ts.map +0 -1
  173. package/native/dist/dist/utils/stylis.d.ts +0 -10
  174. package/native/dist/dist/utils/stylis.d.ts.map +0 -1
  175. package/native/dist/hoc/withTheme.d.ts.map +0 -1
  176. package/native/dist/hoc/withTheme.spec.d.ts.map +0 -1
  177. package/native/dist/hooks/useTheme.d.ts.map +0 -1
  178. package/native/dist/index-standalone.d.ts.map +0 -1
  179. package/native/dist/index.d.ts.map +0 -1
  180. package/native/dist/macro/index.d.ts.map +0 -1
  181. package/native/dist/macro/test/babel.config.d.ts +0 -1
  182. package/native/dist/macro/test/babel.config.d.ts.map +0 -1
  183. package/native/dist/models/ComponentStyle.d.ts.map +0 -1
  184. package/native/dist/models/GlobalStyle.d.ts.map +0 -1
  185. package/native/dist/models/InlineStyle.d.ts.map +0 -1
  186. package/native/dist/models/Keyframes.d.ts.map +0 -1
  187. package/native/dist/models/ServerStyleSheet.d.ts.map +0 -1
  188. package/native/dist/models/StyleSheetManager.d.ts.map +0 -1
  189. package/native/dist/models/StyledComponent.d.ts.map +0 -1
  190. package/native/dist/models/StyledNativeComponent.d.ts.map +0 -1
  191. package/native/dist/models/ThemeProvider.d.ts.map +0 -1
  192. package/native/dist/native/index.d.ts.map +0 -1
  193. package/native/dist/primitives/index.d.ts +0 -23
  194. package/native/dist/primitives/index.d.ts.map +0 -1
  195. package/native/dist/secretInternals.d.ts.map +0 -1
  196. package/native/dist/sheet/GroupIDAllocator.d.ts.map +0 -1
  197. package/native/dist/sheet/GroupedTag.d.ts.map +0 -1
  198. package/native/dist/sheet/Rehydration.d.ts.map +0 -1
  199. package/native/dist/sheet/Sheet.d.ts.map +0 -1
  200. package/native/dist/sheet/Tag.d.ts.map +0 -1
  201. package/native/dist/sheet/dom.d.ts.map +0 -1
  202. package/native/dist/sheet/index.d.ts.map +0 -1
  203. package/native/dist/sheet/types.d.ts.map +0 -1
  204. package/native/dist/test/globals.d.ts.map +0 -1
  205. package/native/dist/test/utils.d.ts.map +0 -1
  206. package/native/dist/types.d.ts.map +0 -1
  207. package/native/dist/utils/addUnitIfNeeded.d.ts.map +0 -1
  208. package/native/dist/utils/checkDynamicCreation.d.ts.map +0 -1
  209. package/native/dist/utils/createWarnTooManyClasses.d.ts.map +0 -1
  210. package/native/dist/utils/determineTheme.d.ts.map +0 -1
  211. package/native/dist/utils/domElements.d.ts.map +0 -1
  212. package/native/dist/utils/empties.d.ts.map +0 -1
  213. package/native/dist/utils/error.d.ts.map +0 -1
  214. package/native/dist/utils/errors.d.ts.map +0 -1
  215. package/native/dist/utils/escape.d.ts.map +0 -1
  216. package/native/dist/utils/flatten.d.ts.map +0 -1
  217. package/native/dist/utils/generateAlphabeticName.d.ts.map +0 -1
  218. package/native/dist/utils/generateComponentId.d.ts.map +0 -1
  219. package/native/dist/utils/generateDisplayName.d.ts.map +0 -1
  220. package/native/dist/utils/getComponentName.d.ts.map +0 -1
  221. package/native/dist/utils/hash.d.ts.map +0 -1
  222. package/native/dist/utils/hoist.d.ts.map +0 -1
  223. package/native/dist/utils/hyphenateStyleName.d.ts.map +0 -1
  224. package/native/dist/utils/interleave.d.ts.map +0 -1
  225. package/native/dist/utils/isFunction.d.ts.map +0 -1
  226. package/native/dist/utils/isPlainObject.d.ts.map +0 -1
  227. package/native/dist/utils/isStatelessFunction.d.ts.map +0 -1
  228. package/native/dist/utils/isStaticRules.d.ts.map +0 -1
  229. package/native/dist/utils/isStyledComponent.d.ts.map +0 -1
  230. package/native/dist/utils/isTag.d.ts.map +0 -1
  231. package/native/dist/utils/joinStrings.d.ts.map +0 -1
  232. package/native/dist/utils/mixinDeep.d.ts.map +0 -1
  233. package/native/dist/utils/nonce.d.ts.map +0 -1
  234. package/native/dist/utils/stylis.d.ts.map +0 -1
@@ -1 +1,9 @@
1
- export {};
1
+ import { CSSProp } from '../index';
2
+ /**
3
+ * `css` prop
4
+ */
5
+ declare module 'react' {
6
+ interface Attributes {
7
+ css?: CSSProp;
8
+ }
9
+ }
@@ -17,7 +17,7 @@ export type WebTarget = string | KnownTarget;
17
17
  export type NativeTarget = AnyComponent;
18
18
  export type StyledTarget<R extends Runtime> = R extends 'web' ? WebTarget : NativeTarget;
19
19
  export interface StyledOptions<R extends Runtime, Props extends object> {
20
- attrs?: AttrsArg<Props>[];
20
+ attrs?: Attrs<Props>[];
21
21
  componentId?: R extends 'web' ? string : never;
22
22
  displayName?: string;
23
23
  parentComponentId?: R extends 'web' ? string : never;
@@ -51,8 +51,7 @@ export interface StyleFunction<Props extends object> {
51
51
  (executionContext: ExecutionContext & Omit<Props, keyof ExecutionContext>): Interpolation<Props>;
52
52
  }
53
53
  export type Interpolation<Props extends object> = StyleFunction<Props> | StyledObject<Props> | TemplateStringsArray | string | number | false | undefined | null | Keyframes | IStyledComponent<'web', any, any> | Interpolation<Props>[];
54
- export type AttrsArg<Props extends object> = (Omit<ExecutionProps, keyof Props> & Props) | ((props: Omit<ExecutionContext, keyof Props> & Props) => Partial<Props>);
55
- export type Attrs = object | ((...args: any) => object);
54
+ export type Attrs<Props extends object = object> = (ExecutionProps & Props) | ((props: ExecutionContext & Props) => Partial<Props>);
56
55
  export type RuleSet<Props extends object> = Interpolation<Props>[];
57
56
  export type Styles<Props extends object> = TemplateStringsArray | StyledObject<Props> | StyleFunction<Props>;
58
57
  export type NameGenerator = (hash: number) => string;
@@ -76,13 +75,13 @@ export interface ShouldForwardProp<R extends Runtime> {
76
75
  (prop: string, elementToBeCreated: StyledTarget<R>): boolean;
77
76
  }
78
77
  export interface CommonStatics<R extends Runtime, Props extends object> {
79
- attrs: AttrsArg<Props>[];
78
+ attrs: Attrs<Props>[];
80
79
  target: StyledTarget<R>;
81
80
  shouldForwardProp?: ShouldForwardProp<R>;
82
81
  }
83
82
  export interface IStyledStatics<R extends Runtime, OuterProps extends object> extends CommonStatics<R, OuterProps> {
84
83
  componentStyle: R extends 'web' ? ComponentStyle : never;
85
- foldedComponentIds: R extends 'web' ? Array<string> : never;
84
+ foldedComponentIds: R extends 'web' ? string : never;
86
85
  inlineStyle: R extends 'native' ? InstanceType<IInlineStyleConstructor<OuterProps>> : never;
87
86
  target: StyledTarget<R>;
88
87
  styledComponentId: R extends 'web' ? string : never;
@@ -124,25 +123,24 @@ export interface StyledObject<Props extends object> {
124
123
  [key: string]: Dict<any> | string | number | StyleFunction<Props> | StyledObject<Props>;
125
124
  }
126
125
  /**
127
- * Override DefaultTheme to get accurate typings for your project.
126
+ * The `css` prop is not declared by default in the types as it would cause `css` to be present
127
+ * on the types of anything that uses styled-components indirectly, even if they do not use the
128
+ * babel plugin.
128
129
  *
129
- * ```
130
- * // create styled-components.d.ts in your project source
131
- * // if it isn't being picked up, check tsconfig compilerOptions.types
132
- * import type { CSSProp } from "styled-components";
133
- * import Theme from './theme';
134
- *
135
- * type ThemeType = typeof Theme;
130
+ * To enable support for the `css` prop in TypeScript, create a `styled-components.d.ts` file in
131
+ * your project source with the following contents:
136
132
  *
137
- * declare module "styled-components" {
138
- * export interface DefaultTheme extends ThemeType {}
139
- * }
133
+ * ```ts
134
+ * import type { CSSProp } from "styled-components";
140
135
  *
141
136
  * declare module "react" {
142
- * interface DOMAttributes<T> {
137
+ * interface Attributes {
143
138
  * css?: CSSProp;
144
139
  * }
145
140
  * }
146
141
  * ```
142
+ *
143
+ * In order to get accurate typings for `props.theme` in `css` interpolations, see
144
+ * {@link DefaultTheme}.
147
145
  */
148
- export type CSSProp = string | StyledObject<any> | StyleFunction<any>;
146
+ export type CSSProp = RuleSet<any>;
@@ -1,2 +1,4 @@
1
- import { ExecutionProps } from '../types';
2
- export default function determineTheme(props: ExecutionProps, providedTheme: any, defaultProps?: any): any;
1
+ import { DefaultTheme, ExecutionProps } from '../types';
2
+ export default function determineTheme(props: ExecutionProps, providedTheme?: DefaultTheme, defaultProps?: {
3
+ theme?: DefaultTheme;
4
+ }): DefaultTheme | undefined;
@@ -1,2 +1,2 @@
1
- declare const _default: readonly ["a", "abbr", "address", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "menu", "menuitem", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "u", "ul", "use", "var", "video", "wbr", "circle", "clipPath", "defs", "ellipse", "foreignObject", "g", "image", "line", "linearGradient", "marker", "mask", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "stop", "svg", "text", "tspan"];
1
+ declare const _default: Set<"object" | "g" | "big" | "link" | "small" | "sub" | "sup" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menu" | "menuitem" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "source" | "span" | "strong" | "style" | "summary" | "table" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "svg" | "circle" | "clipPath" | "defs" | "ellipse" | "foreignObject" | "image" | "line" | "linearGradient" | "marker" | "mask" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "text" | "tspan" | "use">;
2
2
  export default _default;
@@ -1,4 +1,4 @@
1
1
  import StyleSheet from '../sheet';
2
2
  import { Dict, ExecutionContext, Interpolation, RuleSet, Stringifier } from '../types';
3
- export declare const objToCssArray: (obj: Dict<any>, prevKey?: string) => string[];
3
+ export declare const objToCssArray: (obj: Dict<any>) => string[];
4
4
  export default function flatten<Props extends object>(chunk: Interpolation<Props>, executionContext?: ExecutionContext & Props, styleSheet?: StyleSheet, stylisInstance?: Stringifier): RuleSet<Props>;
@@ -1 +1 @@
1
- export default function isPlainObject(x: any): boolean;
1
+ export default function isPlainObject(x: any): x is Record<any, any>;
@@ -1 +1 @@
1
- export default function isStatelessFunction(test: any): boolean;
1
+ export default function isStatelessFunction(test: any): test is Function;
@@ -1,4 +1,5 @@
1
1
  /**
2
2
  * Convenience function for joining strings to form className chains
3
3
  */
4
- export default function joinStrings(a: string | undefined, b: string): string;
4
+ export declare function joinStrings(a?: string, b?: string): string;
5
+ export declare function joinStringArray(arr: string[], sep?: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "styled-components",
3
- "version": "5.3.9",
3
+ "version": "5.3.10",
4
4
  "description": "Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress",
5
5
  "main": "dist/styled-components.cjs.js",
6
6
  "jsnext:main": "dist/styled-components.esm.js",
@@ -155,7 +155,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
155
155
  var SC_ATTR = typeof process !== 'undefined' && typeof process.env !== 'undefined' && (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR) || 'data-styled';
156
156
  var SC_ATTR_ACTIVE = 'active';
157
157
  var SC_ATTR_VERSION = 'data-styled-version';
158
- var SC_VERSION = "5.3.9";
158
+ var SC_VERSION = "5.3.10";
159
159
  var SPLITTER = '/*!sc*/\n';
160
160
  var IS_BROWSER = typeof window !== 'undefined' && 'HTMLElement' in window;
161
161
  var DISABLE_SPEEDY = Boolean(typeof SC_DISABLE_SPEEDY === 'boolean' ? SC_DISABLE_SPEEDY : typeof process !== 'undefined' && typeof process.env !== 'undefined' ? typeof process.env.REACT_APP_SC_DISABLE_SPEEDY !== 'undefined' && process.env.REACT_APP_SC_DISABLE_SPEEDY !== '' ? process.env.REACT_APP_SC_DISABLE_SPEEDY === 'false' ? false : process.env.REACT_APP_SC_DISABLE_SPEEDY : typeof process.env.SC_DISABLE_SPEEDY !== 'undefined' && process.env.SC_DISABLE_SPEEDY !== '' ? process.env.SC_DISABLE_SPEEDY === 'false' ? false : process.env.SC_DISABLE_SPEEDY : process.env.NODE_ENV !== 'production' : false); // Shared empty execution context when generating static styles
@@ -998,8 +998,8 @@ function addUnitIfNeeded(name, value) {
998
998
  return '';
999
999
  }
1000
1000
 
1001
- if (typeof value === 'number' && value !== 0 && !(name in unitless)) {
1002
- return value + "px"; // Presumes implicit 'px' suffix for unitless numbers
1001
+ if (typeof value === 'number' && value !== 0 && !(name in unitless) && !name.startsWith('--')) {
1002
+ return value + "px"; // Presumes implicit 'px' suffix for unitless numbers except for CSS variables
1003
1003
  }
1004
1004
 
1005
1005
  return String(value).trim();