Skip to content

Commit

Permalink
♻️ Refactor theme structure
Browse files Browse the repository at this point in the history
  • Loading branch information
jpolo committed Nov 5, 2024
1 parent d118d83 commit d65e719
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 4 deletions.
11 changes: 11 additions & 0 deletions packages/cherry-sea/src/cherrySea.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { Theme } from './type.js';
import { spacing } from './cherrySea/spacing.js';
import { typeface } from './cherrySea/typeface.js';

/**
* Cherry sea theme configuration
*/
export const cherrySea = {
typeface,
spacing,
} satisfies Theme;
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* eslint-disable @typescript-eslint/naming-convention */
const spacing = {
import type { Spacing } from '../type.js';

export const spacing: Spacing = {
'space-000': '0px',
'space-025': '4px',
'space-050': '8px',
Expand All @@ -18,5 +20,3 @@ const spacing = {
'space-4000': '640px',
'space-4800': '768px',
};

export { spacing };
12 changes: 12 additions & 0 deletions packages/cherry-sea/src/cherrySea/typeface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Typeface } from '../type.js';

const fallback = ['-apple-system', 'Segoe UI', 'roboto', 'noto sans', 'ubuntu', 'cantarell', 'helvetica neue'];

export const typeface = {
brand: Typeface({
fontFamily: ['Barlow', ...fallback],
}),
plain: Typeface({
fontFamily: ['Inter', ...fallback],
}),
};
1 change: 1 addition & 0 deletions packages/cherry-sea/src/cherrySea/typescale.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const typescale = {};
3 changes: 3 additions & 0 deletions packages/cherry-sea/src/fonts.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const fallback = ['-apple-system', 'Segoe UI', 'roboto', 'noto sans', 'ubuntu', 'cantarell', 'helvetica neue'];

/**
* @deprecated
*/
const fonts = {
fallback,
brand: ['Barlow', ...fallback],
Expand Down
4 changes: 3 additions & 1 deletion packages/cherry-sea/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export * from './colors.js';
export * from './spacing.js';
export * from './cherrySea/spacing.js';
export * from './fonts.js';
export * from './cherrySea.js';
export * from './type.js';
2 changes: 2 additions & 0 deletions packages/cherry-sea/src/type/Theme.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import type { Spacing } from './Spacing.js';
import type { Typeface } from './Typeface.js';

export interface Theme {
typeface: Record<string, Typeface>;
spacing: Spacing;
}

0 comments on commit d65e719

Please sign in to comment.