Skip to content
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
96 changes: 56 additions & 40 deletions packages/tailwindcss-language-server/ThirdPartyNotices.txt
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ This is necessary, as the default `aspectRatio` values are overwritten by this p

================================================================================

@tailwindcss/[email protected].0
@tailwindcss/[email protected].1

# @tailwindcss/container-queries

Expand Down Expand Up @@ -509,47 +509,68 @@ module.exports = {

## Usage

Start by marking an element as a container using the `@container` class, and then applying styles based on the size of that container using the container variants like `@md:`, `@lg:`, and `@xl:`:

```html
<!-- Container queries without a specific container name -->
<div class="@container">
<!-- Container query with a size of `lg` defined in your tailwind.config.js file -->
<div class="@lg:underline"></div>
<div class="@[1024px]:underline"></div>
<div class="@lg:underline">
<!-- This text will be underlined when the container is larger than `32rem` -->
</div>
</div>
```

By default we provide [container sizes](#configuration) from `@xs` (`20rem`) to `@7xl` (`80rem`).

### Named containers

You can optionally name containers using a `@container/{name}` class, and then include that name in the container variants using classes like `@lg/{name}:underline`:

<!-- Container queries that apply for a defined container name -->
<div class="@container/sidebar">
<div class="@lg/sidebar:underline"></div>
<div class="@[1024px]/sidebar:underline"></div>
```html
<div class="@container/main">
<!-- ... -->
<div class="@lg/main:underline">
<!-- This text will be underlined when the "main" container is larger than `32rem` -->
</div>
</div>
```

### Container types
### Arbitrary container sizes

| Class | css |
| --------------------------- | ------------------------------------------------------- |
| `@container` | `container-type: inline-size;` |
| `@container/sidebar` | `container-type: inline-size; container-name: sidebar;` |
| `@container-normal` | `container-type: normal;` |
| `@container-normal/sidebar` | `container-type: inline-size; container-name: sidebar;` |
In addition to using one of the [container sizes](#configuration) provided by default, you can also create one-off sizes using any arbitrary value:

```html
<div class="@container">
<div class="@[17.5rem]:underline"></div>
<!-- This text will be underlined when the container is larger than `17.5rem` -->
</div>
</div>
```

### Removing a container

To stop an element from acting as a container, use the `@container-normal` class.

<div class="@container xl:@container-normal">
<!-- ... -->
</div>

## Configuration

By default we ship with the following configured values:

| Name | Value |
| ----- | ------- |
| `xs` | `20rem` |
| `sm` | `24rem` |
| `md` | `28rem` |
| `lg` | `32rem` |
| `xl` | `36rem` |
| `2xl` | `42rem` |
| `3xl` | `48rem` |
| `4xl` | `56rem` |
| `5xl` | `64rem` |
| `6xl` | `72rem` |
| `7xl` | `80rem` |
| Name | CSS |
| ------ | ------------------------------- |
| `@xs` | `@container (min-width: 20rem)` |
| `@sm` | `@container (min-width: 24rem)` |
| `@md` | `@container (min-width: 28rem)` |
| `@lg` | `@container (min-width: 32rem)` |
| `@xl` | `@container (min-width: 36rem)` |
| `@2xl` | `@container (min-width: 42rem)` |
| `@3xl` | `@container (min-width: 48rem)` |
| `@4xl` | `@container (min-width: 56rem)` |
| `@5xl` | `@container (min-width: 64rem)` |
| `@6xl` | `@container (min-width: 72rem)` |
| `@7xl` | `@container (min-width: 80rem)` |

You can configure which values are available for this plugin under the `containers` key in your `tailwind.config.js` file:

Expand All @@ -559,12 +580,7 @@ module.exports = {
theme: {
extend: {
containers: {
xs: '20rem',
sm: '24rem',
md: '28rem',
lg: '32rem',
xl: '36rem',
// etc...
'2xs': '16rem',
},
},
},
Expand All @@ -573,7 +589,7 @@ module.exports = {

================================================================================

@tailwindcss/[email protected].3
@tailwindcss/[email protected].10

MIT License

Expand All @@ -599,7 +615,7 @@ SOFTWARE.

================================================================================

@tailwindcss/[email protected].2
@tailwindcss/[email protected].4

MIT License

Expand All @@ -625,7 +641,7 @@ SOFTWARE.

================================================================================

@tailwindcss/[email protected].7
@tailwindcss/[email protected].19

MIT License

Expand Down Expand Up @@ -1342,7 +1358,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

================================================================================

[email protected].17
[email protected].18

MIT License

Expand Down Expand Up @@ -1394,7 +1410,7 @@ THE SOFTWARE.

================================================================================

[email protected].6
[email protected].7

The MIT License (MIT)

Expand Down
14 changes: 7 additions & 7 deletions packages/tailwindcss-language-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@
"@parcel/watcher-linux-arm64-glibc": "2.5.1",
"@parcel/watcher-linux-arm64-musl": "2.5.1",
"@tailwindcss/aspect-ratio": "0.4.2",
"@tailwindcss/container-queries": "0.1.0",
"@tailwindcss/forms": "0.5.3",
"@tailwindcss/container-queries": "0.1.1",
"@tailwindcss/forms": "0.5.10",
"@tailwindcss/language-service": "workspace:*",
"@tailwindcss/line-clamp": "0.4.2",
"@tailwindcss/oxide": "^4.1.0",
"@tailwindcss/typography": "0.5.7",
"@tailwindcss/line-clamp": "0.4.4",
"@tailwindcss/oxide": "^4.1.14",
"@tailwindcss/typography": "0.5.19",
"@types/braces": "3.0.1",
"@types/color-name": "^1.1.3",
"@types/culori": "^2.1.0",
Expand Down Expand Up @@ -87,8 +87,8 @@
"resolve": "1.20.0",
"rimraf": "3.0.2",
"stack-trace": "0.0.10",
"tailwindcss": "3.4.17",
"tailwindcss-v4": "npm:[email protected].1",
"tailwindcss": "3.4.18",
"tailwindcss-v4": "npm:[email protected].14",
"tinyglobby": "^0.2.12",
"tsconfck": "^3.1.4",
"tsconfig-paths": "^4.2.0",
Expand Down
20 changes: 10 additions & 10 deletions packages/tailwindcss-language-server/src/project-locator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ testLocator({
'package.json': json`
{
"dependencies": {
"tailwindcss": "^3.4.17"
"tailwindcss": "3.4.18"
}
}
`,
Expand All @@ -379,7 +379,7 @@ testLocator({
},
expected: [
{
version: '3.4.17',
version: '3.4.18',
config: '/tailwind.admin.config.js',
content: ['/src/**/*.{html,js}'],
},
Expand Down Expand Up @@ -455,7 +455,7 @@ testLocator({
},
expected: [
{
version: '4.1.1 (bundled)',
version: '4.1.14 (bundled)',
config: '/src/a/b/c/index.css',
content: [],
},
Expand Down Expand Up @@ -487,12 +487,12 @@ testLocator({
},
expected: [
{
version: '4.1.1 (bundled)',
version: '4.1.14 (bundled)',
config: '/index.css',
content: [],
},
{
version: '4.1.1 (bundled)',
version: '4.1.14 (bundled)',
config: '/src/vendor/c.css',
content: [],
},
Expand All @@ -519,12 +519,12 @@ testLocator({
},
expected: [
{
version: '4.1.1 (bundled)',
version: '4.1.14 (bundled)',
config: '/src/app.css',
content: [],
},
{
version: '4.1.1 (bundled)',
version: '4.1.14 (bundled)',
config: '/a/foo.css',
content: [],
},
Expand Down Expand Up @@ -554,12 +554,12 @@ testLocator({
},
expected: [
{
version: '4.1.1 (bundled)',
version: '4.1.14 (bundled)',
config: '/src/app.css',
content: [],
},
{
version: '4.1.1 (bundled)',
version: '4.1.14 (bundled)',
config: '/a/foo.css',
content: [],
},
Expand All @@ -581,7 +581,7 @@ testLocator({
},
expected: [
{
version: '4.1.1 (bundled)',
version: '4.1.14 (bundled)',
config: '/src/app.css',
content: [],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ defineTest({

expect(c.project).toMatchObject({
tailwind: {
version: '4.1.1',
version: '4.1.14',
isDefaultVersion: true,
},
})
Expand Down Expand Up @@ -388,7 +388,7 @@ defineTest({

expect(c.project).toMatchObject({
tailwind: {
version: '4.1.1',
version: '4.1.14',
isDefaultVersion: true,
},
})
Expand Down
22 changes: 11 additions & 11 deletions packages/tailwindcss-language-server/tests/env/v4.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ defineTest({

expect(await client.project()).toMatchObject({
tailwind: {
version: '4.1.1',
version: '4.1.14',
isDefaultVersion: true,
},
})
Expand Down Expand Up @@ -137,7 +137,7 @@ defineTest({

expect(await client.project()).toMatchObject({
tailwind: {
version: '4.1.1',
version: '4.1.14',
isDefaultVersion: true,
},
})
Expand Down Expand Up @@ -188,7 +188,7 @@ defineTest({
'package.json': json`
{
"dependencies": {
"tailwindcss": "4.1.1"
"tailwindcss": "4.1.14"
}
}
`,
Expand All @@ -205,7 +205,7 @@ defineTest({

expect(await client.project()).toMatchObject({
tailwind: {
version: '4.1.1',
version: '4.1.14',
isDefaultVersion: false,
},
})
Expand Down Expand Up @@ -243,7 +243,7 @@ defineTest({
'package.json': json`
{
"dependencies": {
"tailwindcss": "4.1.1"
"tailwindcss": "4.1.14"
}
}
`,
Expand All @@ -270,7 +270,7 @@ defineTest({

expect(await client.project()).toMatchObject({
tailwind: {
version: '4.1.1',
version: '4.1.14',
isDefaultVersion: false,
},
})
Expand Down Expand Up @@ -322,7 +322,7 @@ defineTest({

expect(await client.project()).toMatchObject({
tailwind: {
version: '4.1.1',
version: '4.1.14',
isDefaultVersion: true,
},
})
Expand Down Expand Up @@ -354,7 +354,7 @@ defineTest({
'package.json': json`
{
"dependencies": {
"tailwindcss": "4.1.1"
"tailwindcss": "4.1.14"
}
}
`,
Expand Down Expand Up @@ -667,7 +667,7 @@ defineTest({
'package.json': json`
{
"dependencies": {
"tailwindcss": "3.4.17"
"tailwindcss": "3.4.18"
}
}
`,
Expand Down Expand Up @@ -745,7 +745,7 @@ defineTest({
'package.json': json`
{
"dependencies": {
"tailwindcss": "3.4.17",
"tailwindcss": "3.4.18",
"some-pkg": "file:./packages/some-pkg"
}
}
Expand Down Expand Up @@ -831,7 +831,7 @@ defineTest({

expect(await client.project()).toMatchObject({
tailwind: {
version: '4.1.1',
version: '4.1.14',
isDefaultVersion: true,
},
})
Expand Down
Loading