Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixup documentation briefly for sortShorthand #1718

Merged
merged 2 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,3 @@ See [Shorthand properties](/shorthand) for more information.

- Type: `boolean`
- Default: `false`

#### sortShorthand
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a duplicate (the section above is the same)


Whether to sort shorthand properties so that they always some before longhand properties.

For example, `border` will always come before `borderColor`, which will always come before `borderTopColor`.

See [Shorthand properties](/shorthand) for more information.

- Type: `boolean`
- Default: `false`
6 changes: 6 additions & 0 deletions website/packages/docs/src/pages/pkg-webpack-loader.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -305,5 +305,11 @@ For example, `border` will always come before `borderColor`, which will always c

See [Shorthand properties](/shorthand) for more information.

```js
new CompiledExtractPlugin({
sortShorthand: true,
});
```

- Type: `boolean`
- Default: `false`
2 changes: 1 addition & 1 deletion website/packages/docs/src/pages/shorthand.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Note that there is a bug where [stylesheet extraction cannot be used for Parcel]

If stylesheet extraction is turned on, then shorthand property sorting is controlled by the `sortShorthand` option. This is set to `false` by default, meaning that if stylesheet extraction is turned on, shorthand properties will not be sorted in any way by default.

If you are using Webpack, set `sortShorthand: true` as an option to `new CompiledExtractPlugin()`. If you are using Parcel, set `sortShorthand: true` in your Compiled configuration file (e.g. `.compiledcssrc`), but note that stylesheet extraction won't work unless you are in production mode [due to a bug](https://github.com/atlassian-labs/compiled/issues/1306).
If you are using Webpack, set `sortShorthand: true` as an option like `new CompiledExtractPlugin({ sortShorthand: true })`. If you are using Parcel, set `sortShorthand: true` in your Compiled configuration file (e.g. `.compiledcssrc`), but note that stylesheet extraction won't work unless you are in production mode [due to a bug](https://github.com/atlassian-labs/compiled/issues/1306).

With `sortShorthand` set to `true`, shorthand properties will be sorted deterministically, with more specific shorthand properties taking precedence over less specific shorthand properties. Shorthand property sorting takes precedence over the sorting of pseudo-selectors. For example, given the following example:

Expand Down
Loading