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
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- Nothing yet!
### Added

- Add support for `tailwindcss/lib/util/flattenColorPalette` exports ([#15318](https://github.com/tailwindlabs/tailwindcss/pull/15318))

### Fixed

- Fix dependency related warnings when using `@tailwindcss/postcss` on Windows ([#15321](https://github.com/tailwindlabs/tailwindcss/pull/15321))
Comment on lines +14 to +16
Copy link
Member

Choose a reason for hiding this comment

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

Was a bit confused by this one, but makes sense!

Copy link
Member Author

Choose a reason for hiding this comment

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

lol yeah my bad when I merged the other one 😕


## [4.0.0-beta.6] - 2024-12-06

### Fixed

- Ensure `@import "…" reference` never generates utilities ([#15307](https://github.com/tailwindlabs/tailwindcss/pull/15307))
- Fix dependency related warnings when using `@tailwindcss/postcss` on Windows

## [4.0.0-beta.5] - 2024-12-04

Expand Down
8 changes: 8 additions & 0 deletions packages/tailwindcss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
"require": "./src/compat/colors.cts",
"import": "./src/compat/colors.ts"
},
"./lib/util/flattenColorPalette": {
"require": "./src/compat/flatten-color-palette.cts",
"import": "./src/compat/flatten-color-palette.ts"
},
Copy link
Contributor

Choose a reason for hiding this comment

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

ngl kinda sad we have to export this one but makes sense.

"./defaultTheme": {
"require": "./src/compat/default-theme.cts",
"import": "./src/compat/default-theme.ts"
Expand Down Expand Up @@ -91,6 +95,10 @@
"require": "./dist/colors.js",
"import": "./dist/colors.mjs"
},
"./lib/util/flattenColorPalette": {
"require": "./dist/flatten-color-palette.js",
"import": "./dist/flatten-color-palette.mjs"
},
"./package.json": "./package.json",
"./index.css": "./index.css",
"./index": "./index.css",
Expand Down
2 changes: 1 addition & 1 deletion packages/tailwindcss/src/compat/config.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, expect, test, vi } from 'vitest'
import { compile, type Config } from '..'
import { default as plugin } from '../plugin'
import { flattenColorPalette } from './flatten-color-palette'
import flattenColorPalette from './flatten-color-palette'

const css = String.raw

Expand Down
8 changes: 8 additions & 0 deletions packages/tailwindcss/src/compat/flatten-color-palette.cts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import flattenColorPalette from './flatten-color-palette.ts'

// This file exists so that `flatten-color-palette.ts` can be written one time
// but be compatible with both CJS and ESM. Without it we get a `.default`
// export when using `require` in CJS.

// @ts-ignore
export = flattenColorPalette
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect, test } from 'vitest'
import { flattenColorPalette } from './flatten-color-palette'
import flattenColorPalette from './flatten-color-palette'

test('it should handle private __CSS_VALUES__ to resolve to the right value', () => {
expect(
Expand Down
2 changes: 1 addition & 1 deletion packages/tailwindcss/src/compat/flatten-color-palette.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type Colors = {
[key: string | number]: string | Colors
}

export function flattenColorPalette(colors: Colors) {
export default function flattenColorPalette(colors: Colors) {
let result: Record<string, string> = {}

for (let [root, children] of Object.entries(colors ?? {})) {
Expand Down
2 changes: 2 additions & 0 deletions packages/tailwindcss/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export default defineConfig([
plugin: 'src/plugin.ts',
colors: 'src/compat/colors.ts',
'default-theme': 'src/compat/default-theme.ts',
'flatten-color-palette': 'src/compat/flatten-color-palette.ts',
},
},
{
Expand All @@ -21,6 +22,7 @@ export default defineConfig([
lib: 'src/index.cts',
colors: 'src/compat/colors.cts',
'default-theme': 'src/compat/default-theme.cts',
'flatten-color-palette': 'src/compat/flatten-color-palette.cts',
},
},
])