Skip to content

Commit

Permalink
fix: types
Browse files Browse the repository at this point in the history
  • Loading branch information
hmd committed Oct 20, 2024
1 parent 1eab4ed commit aa93674
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"cSpell.words": ["consts"]
}
8 changes: 3 additions & 5 deletions src/consts.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { Alpha, P3, Step } from './types';

export const RADIX_HUES = [
"amber",
"blue",
Expand Down Expand Up @@ -35,6 +33,6 @@ export const RADIX_HUES = [
] as const;


export const ALPHAS: Alpha[] = ['', 'A'] as const;
export const P3S: P3[] = ['', 'P3'] as const;
export const STEPS: Step[] = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '-fg'] as const;
export const ALPHAS = ['', 'A'] as const;
export const P3S = ['', 'P3'] as const;
export const STEPS= ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '-fg'] as const;
12 changes: 6 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Extractor, Preset, ResolvedConfig, RuleContext } from 'unocss';
import { Preset, RuleContext } from 'unocss';
import type { Theme } from 'unocss/preset-uno';
import { type Options, Aliases, Alpha, HueOrAlias, Property, RadixHue, Step } from './types';
import { type Options, Aliases, Alpha, HueOrAlias, RadixHue, Step } from './types';

import { generateCSSVariablesForColorsInUse } from './preflights';
import { extendTheme } from './extendTheme';
Expand Down Expand Up @@ -68,10 +68,10 @@ export function presetRadix<T extends Aliases>({
name: 'unocss-preset-radix',
layers: layer
? {
preflights: 1,
[layer]: 2,
default: 3,
}
preflights: 1,
[layer]: 2,
default: 3,
}
: undefined,
shortcuts: [
// This shortcut exist so generated css for colors to have same order.
Expand Down
1 change: 0 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { RADIX_HUES } from './consts';

export type Alpha = 'A' | '';
export type RadixHue = (typeof RADIX_HUES)[number];
export type Step = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | '-fg';
Expand Down

0 comments on commit aa93674

Please sign in to comment.