Skip to content

Commit 8f08c7c

Browse files
authored
Merge branch 'canary' into 07-17-remove_the_experimental_env_var
2 parents 2013224 + b2e711a commit 8f08c7c

File tree

83 files changed

+744
-520
lines changed

Some content is hidden

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

83 files changed

+744
-520
lines changed

.github/workflows/build_and_deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99

1010
env:
1111
NAPI_CLI_VERSION: 2.16.2
12-
TURBO_VERSION: 2.0.6-canary.0
12+
TURBO_VERSION: 2.0.7
1313
NODE_LTS_VERSION: 20
1414
CARGO_PROFILE_RELEASE_LTO: 'true'
1515
TURBO_TEAM: 'vercel'

.github/workflows/build_and_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
env:
1010
NAPI_CLI_VERSION: 2.14.7
11-
TURBO_VERSION: 2.0.6-canary.0
11+
TURBO_VERSION: 2.0.7
1212
NODE_MAINTENANCE_VERSION: 18
1313
NODE_LTS_VERSION: 20
1414
TEST_CONCURRENCY: 8

.github/workflows/code_freeze.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ name: Code Freeze
1717

1818
env:
1919
NAPI_CLI_VERSION: 2.14.7
20-
TURBO_VERSION: 2.0.6-canary.0
20+
TURBO_VERSION: 2.0.7
2121
NODE_LTS_VERSION: 20
2222

2323
jobs:

.github/workflows/pull_request_stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name: Generate Pull Request Stats
66

77
env:
88
NAPI_CLI_VERSION: 2.14.7
9-
TURBO_VERSION: 2.0.6-canary.0
9+
TURBO_VERSION: 2.0.7
1010
NODE_LTS_VERSION: 20
1111
TEST_CONCURRENCY: 6
1212

.github/workflows/trigger_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ name: Trigger Release
3535

3636
env:
3737
NAPI_CLI_VERSION: 2.14.7
38-
TURBO_VERSION: 2.0.6-canary.0
38+
TURBO_VERSION: 2.0.7
3939
NODE_LTS_VERSION: 20
4040

4141
jobs:

docs/02-app/01-building-your-application/05-styling/01-css-modules.mdx renamed to docs/02-app/01-building-your-application/05-styling/01-stylesheets.mdx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: CSS Modules and Global Styles
3-
nav_title: CSS Modules
2+
title: Stylesheets
3+
nav_title: Stylesheets
44
description: Style your Next.js Application with CSS Modules, Global Styles, and external stylesheets.
55
---
66

@@ -29,7 +29,7 @@ Next.js has built-in support for CSS Modules using the `.module.css` extension.
2929

3030
CSS Modules locally scope CSS by automatically creating a unique class name. This allows you to use the same class name in different files without worrying about collisions. This behavior makes CSS Modules the ideal way to include component-level CSS.
3131

32-
## Example
32+
### Example
3333

3434
<AppOnly>
3535
CSS Modules can be imported into any file inside the `app` directory:
@@ -110,7 +110,10 @@ These `.css` files represent hot execution paths in your application, ensuring t
110110
<AppOnly>
111111
Global styles can be imported into any layout, page, or component inside the `app` directory.
112112

113-
> **Good to know**: This is different from the `pages` directory, where you can only import global styles inside the `_app.js` file.
113+
> **Good to know**:
114+
>
115+
> - This is different from the `pages` directory, where you can only import global styles inside the `_app.js` file.
116+
> - Next.js does not support usage of global styles unless they are actually global, meaning they can apply to all pages and can live for the lifetime of the application. This is because Next.js uses React's built-in support for stylesheets to integrate with Suspense. This built-in support currently does not remove stylesheets as you navigate between routes. Because of this, we recommend using CSS Modules over global styles.
114117
115118
For example, consider a stylesheet named `app/global.css`:
116119

@@ -300,7 +303,7 @@ function ExampleDialog(props) {
300303

301304
## Ordering and Merging
302305

303-
Next.js optimizes CSS during production builds by automatically chunking (merging) stylesheets. The CSS order is determined by the order in which you import the stylesheets into your application code.
306+
Next.js optimizes CSS during production builds by automatically chunking (merging) stylesheets. The CSS order is _determined by the order in which you import the stylesheets into your application code_.
304307

305308
For example, `base-button.module.css` will be ordered before `page.module.css` since `<BaseButton>` is imported first in `<Page>`:
306309

@@ -346,6 +349,7 @@ To maintain a predictable order, we recommend the following:
346349
- Use a consistent naming convention for your CSS modules. For example, using `<name>.module.css` over `<name>.tsx`.
347350
- Extract shared styles into a separate shared component.
348351
- If using [Tailwind](/docs/app/building-your-application/styling/tailwind-css), import the stylesheet at the top of the file, preferably in the [Root Layout](/docs/app/building-your-application/routing/layouts-and-templates#root-layout-required).
352+
- Turn off any linters/formatters (e.g., ESLint's [`sort-import`](https://eslint.org/docs/latest/rules/sort-imports)) that automatically sort your imports. This can inadvertently affect your CSS since CSS import order _matters_.
349353

350354
> **Good to know:**
351355
>

docs/02-app/01-building-your-application/05-styling/02-tailwind-css.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ You do not need to modify `postcss.config.js`.
5555

5656
## Importing Styles
5757

58-
Add the [Tailwind CSS directives](https://tailwindcss.com/docs/functions-and-directives#directives) that Tailwind will use to inject its generated styles to a [Global Stylesheet](/docs/app/building-your-application/styling/css-modules#global-styles) in your application, for example:
58+
Add the [Tailwind CSS directives](https://tailwindcss.com/docs/functions-and-directives#directives) that Tailwind will use to inject its generated styles to a [Global Stylesheet](/docs/app/building-your-application/styling/stylesheets#global-styles) in your application, for example:
5959

6060
```css filename="app/globals.css"
6161
@tailwind base;

docs/02-app/01-building-your-application/05-styling/04-css-in-js.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The following are currently working on support:
3333

3434
> **Good to know**: We're testing out different CSS-in-JS libraries and we'll be adding more examples for libraries that support React 18 features and/or the `app` directory.
3535
36-
If you want to style Server Components, we recommend using [CSS Modules](/docs/app/building-your-application/styling/css-modules) or other solutions that output CSS files, like PostCSS or [Tailwind CSS](/docs/app/building-your-application/styling/tailwind-css).
36+
If you want to style Server Components, we recommend using [CSS Modules](/docs/app/building-your-application/styling/stylesheets) or other solutions that output CSS files, like PostCSS or [Tailwind CSS](/docs/app/building-your-application/styling/tailwind-css).
3737

3838
## Configuring CSS-in-JS in `app`
3939

docs/02-app/01-building-your-application/05-styling/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ description: Learn the different ways you can style your Next.js application.
77

88
Next.js supports different ways of styling your application, including:
99

10-
- **Global CSS**: Simple to use and familiar for those experienced with traditional CSS, but can lead to larger CSS bundles and difficulty managing styles as the application grows.
1110
- **CSS Modules**: Create locally scoped CSS classes to avoid naming conflicts and improve maintainability.
11+
- **Global CSS**: Simple to use and familiar for those experienced with traditional CSS, but can lead to larger CSS bundles and difficulty managing styles as the application grows.
1212
- **Tailwind CSS**: A utility-first CSS framework that allows for rapid custom designs by composing utility classes.
1313
- **Sass**: A popular CSS preprocessor that extends CSS with features like variables, nested rules, and mixins.
1414
- **CSS-in-JS**: Embed CSS directly in your JavaScript components, enabling dynamic and scoped styling.

docs/02-app/01-building-your-application/06-optimizing/01-images.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ If none of the suggested methods works for sizing your images, the `next/image`
229229
Styling the Image component is similar to styling a normal `<img>` element, but there are a few guidelines to keep in mind:
230230

231231
- Use `className` or `style`, not `styled-jsx`.
232-
- In most cases, we recommend using the `className` prop. This can be an imported [CSS Module](/docs/app/building-your-application/styling/css-modules), a [global stylesheet](/docs/app/building-your-application/styling/css-modules#global-styles), etc.
232+
- In most cases, we recommend using the `className` prop. This can be an imported [CSS Module](/docs/app/building-your-application/styling/stylesheets), a [global stylesheet](/docs/app/building-your-application/styling/stylesheets#global-styles), etc.
233233
- You can also use the `style` prop to assign inline styles.
234234
- You cannot use [styled-jsx](/docs/app/building-your-application/styling/css-in-js) because it's scoped to the current component (unless you mark the style as `global`).
235235
- When using `fill`, the parent element must have `position: relative`

0 commit comments

Comments
 (0)