Skip to content

Commit

Permalink
b2b exposes preset
Browse files Browse the repository at this point in the history
  • Loading branch information
sebald committed Aug 6, 2023
1 parent 415a0ff commit 1ff1da5
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 19 deletions.
10 changes: 6 additions & 4 deletions themes/theme-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": {
"./index.css": "./dist/index.css"
"./index.css": "./dist/index.css",
"./preset": "./dist/preset.mjs",
"./preset/cjs": "./dist/preset.js"
},
"sideEffects": false,
"files": [
Expand All @@ -25,17 +27,17 @@
"directory": "packages/theme-core"
},
"devDependencies": {
"@marigold/theme-preset": "workspace:*",
"@marigold/tsconfig": "workspace:*",
"autoprefixer": "10.4.14",
"cssnano": "6.0.1",
"postcss": "8.4.26",
"tailwindcss": "3.3.3",
"tsup": "6.7.0"
},
"peerDependencies": {
"dependencies": {
"@marigold/components": "workspace:*",
"@marigold/system": "workspace:*"
"@marigold/system": "workspace:*",
"@marigold/theme-preset": "workspace:*"
},
"scripts": {
"build": "NODE_ENV=production tsup",
Expand Down
11 changes: 7 additions & 4 deletions themes/theme-core/src/preset.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
import { createPreset } from '@marigold/theme-preset';

import { theme } from './theme';
import { screens } from './screens';
import { colors } from './tokens';

export interface PresetConfig {
name: string;
preflight?: boolean;
}

export const preset = createPreset('core', {
export type Preset = ReturnType<typeof createPreset>;

export const preset: Preset = createPreset('core', {
corePlugins: {
preflight: false,
},
theme: {
extend: {
screens: theme.screens,
screens,
fontFamily: {
body: 'Arial, Helvetica, sans-serif',
},
fontSize: {
body: '13px',
},
colors: theme.colors,
colors,
transitionTimingFunction: {
'ease-out': 'ease-out',
},
Expand Down
7 changes: 7 additions & 0 deletions themes/theme-core/src/screens.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const screens = {
sm: '640px',
md: '768px',
lg: '1024px',
xl: '1280px',
'2xl': '1536px',
};
16 changes: 6 additions & 10 deletions themes/theme-core/src/theme.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
import { Theme } from '@marigold/system';
import { colors } from './tokens';
import * as components from './components';

import { root } from './root';
import { screens } from './screens';
import { colors } from './tokens';

import * as components from './components';

export const theme: Theme = {
name: 'core',
screens: {
sm: '640px',
md: '768px',
lg: '1024px',
xl: '1280px',
'2xl': '1536px',
},
screens,
root,
colors: colors,
colors,
components,
};
2 changes: 1 addition & 1 deletion themes/theme-core/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig } from 'tsup';

export default defineConfig({
entry: ['src/index.ts', 'src/index.css'],
entry: ['src/index.ts', 'src/index.css', 'src/preset.ts'],
format: ['esm', 'cjs'],
tsconfig: './tsconfig.build.json',
dts: true,
Expand Down

0 comments on commit 1ff1da5

Please sign in to comment.