Skip to content

Commit 1effaf9

Browse files
committed
Merge remote-tracking branch 'origin/main' into ts-migration
# Conflicts: # docs/docs.yaml # packages/babel-plugin/src/index.js # packages/cache/src/index.js # packages/css/package.json # packages/css/src/create-instance.d.ts # packages/primitives-core/package.json # packages/react/__tests__/warnings.js # packages/react/src/global.js # packages/react/src/jsx-dev-runtime.js # packages/react/src/jsx-runtime.js # packages/react/src/jsx.js # packages/serialize/types/index.d.ts # packages/styled/package.json # yarn.lock
2 parents 993557d + 73f6881 commit 1effaf9

File tree

106 files changed

+2521
-962
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+2521
-962
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
- ts-migration
88
pull_request:
99

10+
permissions:
11+
contents: read # to fetch code (actions/checkout)
12+
1013
jobs:
1114
test:
1215
name: 'Tests on ${{matrix.platform}}'

.github/workflows/release.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,14 @@ on:
88

99
concurrency: ${{ github.workflow }}-${{ github.ref }}
1010

11+
permissions: {}
1112
jobs:
1213
release:
14+
permissions:
15+
contents: write # to create release
16+
issues: write # to post issue comments
17+
pull-requests: write # to create pull request
18+
1319
name: Release
1420
runs-on: ubuntu-latest
1521
steps:
@@ -20,6 +26,7 @@ jobs:
2026
uses: changesets/action@v1
2127
with:
2228
publish: yarn release
29+
version: yarn version-packages
2330
env:
2431
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2532
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.yarn/releases/yarn-3.2.2.cjs renamed to .yarn/releases/yarn-3.2.3.cjs

Lines changed: 266 additions & 266 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
nodeLinker: node-modules
2+
3+
npmPublishAccess: public
4+
15
plugins:
26
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
37
spec: "@yarnpkg/plugin-workspace-tools"
48

5-
yarnPath: .yarn/releases/yarn-3.2.2.cjs
6-
7-
nodeLinker: node-modules
8-
9-
npmPublishAccess: public
9+
yarnPath: .yarn/releases/yarn-3.2.3.cjs

CHANGELOG.md

Lines changed: 131 additions & 131 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ Look here 👉 _[emotion babel plugin feature table and documentation](https://g
9292

9393
### In the Wild
9494

95+
- [feathery.io](https://feathery.io)
9596
- [frontity.org](https://frontity.org)
9697
- [abacusfi.com](https://abacusfi.com)
9798
- [healthline.com](https://www.healthline.com)
@@ -109,6 +110,7 @@ Look here 👉 _[emotion babel plugin feature table and documentation](https://g
109110
- [cyberhaven.com](https://cyberhaven.com)
110111
- [CommercialRealEstate.com.au](https://www.commercialrealestate.com.au)
111112
- [codecademy.com](https://www.codecademy.com)
113+
- [Apache Superset](https://superset.apache.org/)
112114

113115
## Sponsors
114116

SECURITY.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Security policy
2+
3+
## Supported versions
4+
5+
The latest version of the project is currently supported with security updates.
6+
7+
## Reporting a vulnerability
8+
9+
You can report a vulnerability by contacting maintainers via email.

docs/best-practices.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,29 +93,29 @@ Advantages of sharing styles via component reuse include:
9393

9494
The css prop or `styled` should be used for static styles, while the `style` prop (inline styles) should be used for truly dynamic styles. By dynamic styles, we mean styles that change frequently or are unique to a single element.
9595

96-
Imagine you are displaying a list of user avatars in a forum application. Every avatar shares certain static CSS, like `width: 40px` and `border-radius: 50%`, but the avatar image is set via a `background-style` rule whose value is different for each avatar. If you pass all of this CSS through the CSS prop, you'll end up with a lot of nearly-duplicate CSS in the document. With 3 avatars, Emotion will create something like:
96+
Imagine you are displaying a list of user avatars in a forum application. Every avatar shares certain static CSS, like `width: 40px` and `border-radius: 50%`, but the avatar image is set via a `background-image` rule whose value is different for each avatar. If you pass all of this CSS through the CSS prop, you'll end up with a lot of nearly-duplicate CSS in the document. With 3 avatars, Emotion will create something like:
9797

9898
```html
9999
<style>
100100
.css-1udhswa {
101101
border-radius: 50%;
102102
width: 40px;
103103
height: 40px;
104-
background-style: url(https://i.pravatar.cc/150?u=0);
104+
background-image: url(https://i.pravatar.cc/150?u=0);
105105
}
106106
107107
.css-1cpwmbr {
108108
border-radius: 50%;
109109
width: 40px;
110110
height: 40px;
111-
background-style: url(https://i.pravatar.cc/150?u=1);
111+
background-image: url(https://i.pravatar.cc/150?u=1);
112112
}
113113
114114
.css-am987o {
115115
border-radius: 50%;
116116
width: 40px;
117117
height: 40px;
118-
background-style: url(https://i.pravatar.cc/150?u=2);
118+
background-image: url(https://i.pravatar.cc/150?u=2);
119119
}
120120
</style>
121121
```
@@ -141,19 +141,19 @@ CSS variables can be used with the `style` prop to keep the CSS in a single plac
141141
border-radius: 50%;
142142
width: 40px;
143143
height: 40px;
144-
background-style: var(--background-style);
144+
background-image: var(--background-image);
145145
}
146146
```
147147

148-
Then, for each avatar, you render an element which sets the value of the `--background-style` CSS variable:
148+
Then, for each avatar, you render an element which sets the value of the `--background-image` CSS variable:
149149

150150
```tsx
151151
function Avatar({ imageUrl }) {
152-
return <div className="avatar" style={{ '--background-style': imageUrl }} />
152+
return <div className="avatar" style={{ '--background-image': imageUrl }} />
153153
}
154154
```
155155

156-
If you're using TypeScript, you'll have to use a type assertion like `style={{ ['--background-style' as any]: imageUrl }}` as explained [here](https://stackoverflow.com/a/52013197/752601).
156+
If you're using TypeScript, you'll have to use a type assertion like `style={{ ['--background-image' as any]: imageUrl }}` as explained [here](https://stackoverflow.com/a/52013197/752601).
157157

158158
### If using React, prefer `@emotion/react` or `@emotion/styled` over `@emotion/css`
159159

docs/css-prop.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ The styles are concatenated together and inserted via `insertRule`.
241241

242242
```css
243243
.css-2 {
244-
font-size: 14px,
245-
font-family: Georgia, serif,
244+
font-size: 14px;
245+
font-family: Georgia, serif;
246246
color: darkgray;
247247
}
248248
```
@@ -264,8 +264,8 @@ The styles are concatenated together and inserted via `insertRule`.
264264
+ line-height: 1.5;
265265
- font-family: 'sans-serif';
266266
- color: black;
267-
- font-size: 14px,
268-
+ font-family: Georgia, serif,
267+
- font-size: 14px;
268+
+ font-family: Georgia, serif;
269269
+ color: darkgray;
270270
+ font-size: 10px;
271271
}

docs/docs.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
- source-maps
3333
- testing
3434
- typescript
35+
- eslint-plugin-react
3536

3637
# This loads the READMEs instead of files in docs/
3738
- title: Packages

0 commit comments

Comments
 (0)