Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Move test
  • Loading branch information
thecrypticace committed Nov 20, 2025
commit e8fe386e1c3bf9e857537bb7c633a6de4b025e61
52 changes: 52 additions & 0 deletions packages/tailwindcss/src/compat/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1719,3 +1719,55 @@ test('The theme() function does not try indexing into strings', async () => {
"
`)
})

test('camel case keys are preserved', async () => {
let compiler = await compile(
css`
@tailwind utilities;
@theme {
--color-blue-green: slate;
}
@config "./plugin.js";
`,
{
loadModule: async () => {
return {
base: '/',
path: '',
module: {
theme: {
extend: {
backgroundColor: {
lightGreen: '#c0ffee',
},
},
},
},
}
},
},
)

expect(
compiler.build([
// From CSS
'bg-blue-green', // should be output
'bg-blueGreen', // should not

// From JS config
'bg-light-green', // should not be output
'bg-lightGreen', // should be
]),
).toMatchInlineSnapshot(`
".bg-blue-green {
background-color: var(--color-blue-green);
}
.bg-lightGreen {
background-color: #c0ffee;
}
:root, :host {
--color-blue-green: slate;
}
"
`)
})
37 changes: 0 additions & 37 deletions packages/tailwindcss/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5935,43 +5935,6 @@ describe('`@property` polyfill', async () => {
}"
`)
})

// TODO: Move test into compat folder
it('camel case keys are preserved', async () => {
await expect(
compileCss(
css`
@tailwind utilities;
@theme {
--color-blue-green: slate;
}
@config "./plugin.js";
`,
['bg-lightGreen', 'bg-blue-green', 'bg-blueGreen'],
{
loadModule: async () => {
return {
base: '/',
path: '',
module: {
theme: {
extend: {
backgroundColor: {
lightGreen: '#c0ffee',
},
},
},
},
}
},
},
),
).resolves.toMatchInlineSnapshot(`
".bg-lightGreen {
background-color: #c0ffee;
}"
`)
})
})

describe('feature detection', () => {
Expand Down
Loading