Skip to content

Commit

Permalink
Add underscore prefix to internal extendTheme
Browse files Browse the repository at this point in the history
  • Loading branch information
catuhana committed Jul 18, 2024
1 parent a930f62 commit ed5a29c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/extend.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test, expect, describe } from 'vitest';

import { extendTheme } from './extend.ts';
import { _extendTheme } from './extend.ts';
import {
CatppuccinColors,
CatppuccinFlavors,
Expand All @@ -25,7 +25,7 @@ describe('extending theme with defaults results an object in required format', (
};
}
>;
extendTheme()(theme);
_extendTheme()(theme);

expect(theme).toBeTypeOf('object');

Expand All @@ -47,7 +47,7 @@ describe('extending theme with defaults results an object in required format', (
}
>;

extendTheme({ prefix: false })(theme);
_extendTheme({ prefix: false })(theme);

expect(theme).toBeTypeOf('object');

Expand All @@ -71,7 +71,7 @@ describe('extending theme with defaults results an object in required format', (
}
>;

extendTheme({ prefix })(theme);
_extendTheme({ prefix })(theme);

expect(theme).toBeTypeOf('object');

Expand Down
2 changes: 1 addition & 1 deletion src/extend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type { ExtendOptions } from './types.ts';
/**
* Extend theme to UnoCSS by using `extendTheme` function.
*/
export const extendTheme = (
export const _extendTheme = (
options: ExtendOptions = {}
): ((theme: any) => void) => {
const { prefix = 'ctp', defaultFlavour } = options;
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { extendTheme } from './extend.ts';
import { _extendTheme } from './extend.ts';

import type { Preset } from '@unocss/core';

Expand All @@ -17,7 +17,7 @@ export const presetCatppuccin = (
const { mode, prefix = 'ctp', defaultFlavour } = options;

if (mode === 'extend') {
preset.extendTheme = extendTheme({ prefix, defaultFlavour });
preset.extendTheme = _extendTheme({ prefix, defaultFlavour });
} else {
// TODO: Custom logging?
throw new Error(`Unsupported mode provided: \`${mode}\``);
Expand Down

0 comments on commit ed5a29c

Please sign in to comment.