Skip to content

Commit e872864

Browse files
committed
refactor: rename functions
1 parent 7292fc8 commit e872864

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

packages/core/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Colors } from './type'
22

3-
export { defineColorVariables } from './plugin'
3+
export { variableColorsPlugin } from './plugin'
44

55
type VariableColors = {
66
[key in keyof Colors]: Colors[key] extends `#${string}`

packages/core/src/plugin.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import colors from 'tailwindcss/colors'
22

33
import { describe, expect, it } from 'vitest'
4-
import { createColorVariables } from '../src/plugin'
4+
import { generateColorVariables } from '../src/plugin'
55

66
describe('should', () => {
77
it('match snapshot', () => {
8-
expect(createColorVariables(colors)).toMatchInlineSnapshot(`
8+
expect(generateColorVariables(colors)).toMatchInlineSnapshot(`
99
{
1010
"&.dark": {
1111
"--tw-color-amber-100": "120 53 15",

packages/core/src/plugin.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ import { Colors } from './type'
44
interface Options {
55
mode?: 'invert'
66
}
7-
export function defineColorVariables<T extends Colors>(
7+
export function variableColorsPlugin<T extends Colors>(
88
colors: T,
99
options: Options = {},
1010
) {
1111
return plugin(({ addBase }) => {
1212
addBase({
13-
':root': createColorVariables(colors),
13+
':root': generateColorVariables(colors),
1414
})
1515
})
1616
}
1717

18-
export function createColorVariables<T extends Colors>(colors: T) {
18+
export function generateColorVariables<T extends Colors>(colors: T) {
1919
const colorVariables = {} as any
2020
const darkColorVariables = {} as any
2121

packages/core/src/purge.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { test, expect } from 'vitest'
22
import postcss from 'postcss'
33
import tailwindcss from 'tailwindcss'
4-
import { createVariableColors, defineColorVariables } from '.'
4+
import { createVariableColors, variableColorsPlugin } from '.'
55
import colors from 'tailwindcss/colors'
66

77
// @ts-ignore
@@ -20,7 +20,7 @@ test('main', async () => {
2020
theme: {
2121
colors: createVariableColors(colors),
2222
},
23-
plugins: [defineColorVariables(colors)],
23+
plugins: [variableColorsPlugin(colors)],
2424
},
2525
}),
2626
pruneVar(),

packages/core/tailwind.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { Config } from 'tailwindcss'
22
import colors from 'tailwindcss/colors'
3-
import { createVariableColors, defineColorVariables } from './src'
3+
import { createVariableColors, variableColorsPlugin } from './src'
44

55
const config: Config = {
66
content: ['./src/**/*.tsx'],
77
theme: {
88
colors: createVariableColors(colors),
99
},
10-
plugins: [defineColorVariables(colors)],
10+
plugins: [variableColorsPlugin(colors)],
1111
}
1212

1313
export default config

site/tailwind.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Config } from 'tailwindcss'
22
import colors from 'tailwindcss/colors'
33
import {
44
createVariableColors,
5-
defineColorVariables,
5+
variableColorsPlugin,
66
} from 'tailwindcss-variable-colors'
77

88
const config: Config = {
@@ -25,7 +25,7 @@ const config: Config = {
2525
padding: '1rem',
2626
},
2727
},
28-
plugins: [defineColorVariables(colors)],
28+
plugins: [variableColorsPlugin(colors)],
2929
}
3030

3131
export default config

0 commit comments

Comments
 (0)