A familiar and performant compile time CSS-in-JS library for React.
APACHE-2.0 License
Bot releases are visible (Hide)
Published by atlas-dst-bot almost 3 years ago
homepage
and other package.json
propertiesPublished by atlas-dst-bot almost 3 years ago
homepage
and other package.json
propertiesPublished by atlas-dst-bot almost 3 years ago
Published by atlas-dst-bot almost 3 years ago
jsx-pragma
rule now removes the default react import when moving to the automatic runtime and it isn't used.Published by atlas-dst-bot almost 3 years ago
Published by atlas-dst-bot almost 3 years ago
css
prop using jsx pragmas (both with @jsx
and @jsxImportSource
).Published by atlas-dst-bot almost 3 years ago
css
prop using jsx pragmas (both with @jsx
and @jsxImportSource
).Published by atlas-dst-bot almost 3 years ago
Published by atlas-dst-bot almost 3 years ago
Published by atlas-dst-bot almost 3 years ago
Published by atlas-dst-bot almost 3 years ago
css
prop using jsx pragmas (both with @jsx
and @jsxImportSource
).Published by atlas-dst-bot almost 3 years ago
427cead: Breaking change: When using the css
prop with TypeScript you now need to declare a JSX pragma enabling types for that module. Previously when importing the @compiled/react
package the global JSX namespace would be polluted as a side effect potentially causing collisions with other CSS-in-JS libraries. Now thanks to the use of locally scoped JSX namespaces the global JSX namespace will no longer be polluted.
As an added bonus the css
prop will only be available on JSX elements that have also defined a className
prop with the potential for more type safe features later on.
Make sure to update @compiled/babel-plugin
, @compiled/webpack-loader
, and @compiled/parcel-transformer
to latest when adopting this change.
Automatic runtime
-import '@compiled/react';
+/** @jsxImportSource @compiled/react */
<div css={{ display: 'block' }} />;
Classic runtime
-import '@compiled/react';
+/** @jsx jsx */
+import { jsx } from '@compiled/react';
<div css={{ display: 'block' }} />;
To aid consumers in adopting this change easily, a new ESLint rule jsx-pragma
has been created which will automatically migrate you to use a JSX pragma if missing when running with --fix
. The rule takes an option to configure the runtime (either classic or automatic) and defaults to automatic.
npm i @compiled/eslint-plugin
{
"rules": {
"@compiled/jsx-pragma": ["error", { "runtime": "classic" }]
}
}
Published by atlas-dst-bot almost 3 years ago
Published by atlas-dst-bot almost 3 years ago
emotion-to-compiled
rule to no-emotion-css
.no-emotion-css
rule now keeps the jsx pragma around if defined.no-emotion-css
rule now will check for jsxImportSource
pragma usage with a supplementary fixer.jsx-pragma
rule,css
prop.Published by atlas-dst-bot almost 3 years ago
Published by atlas-dst-bot almost 3 years ago
Published by atlas-dst-bot almost 3 years ago
Published by atlas-dst-bot almost 3 years ago
// @compiled-disable(-next)-line) transform-css-prop
to disable Compiled processing on CSS propPublished by atlas-dst-bot almost 3 years ago
Published by atlas-dst-bot almost 3 years ago
keyframes
import from @emotion/core
and @emotion/react
with alphabetical sorting