Skip to content

Commit

Permalink
feat: add spacing system (#474)
Browse files Browse the repository at this point in the history
* feat: add spacing system

* refactor: update spacing naming

* chore: add leading 0

---------

Co-authored-by: doprz <[email protected]>
  • Loading branch information
EthanL06 and doprz authored Jan 2, 2025
1 parent 9cbcfa4 commit e61ab56
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/shared/types/Spacing.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* An object representing various spacing values used throughout the application.
* Each key corresponds to a specific spacing size based on the 4px grid system.
*/
export const spacing = {
'spacing-1': '0.125rem',
'spacing-2': '0.25rem',
'spacing-3': '0.5rem',
'spacing-4': '0.75rem',
'spacing-5': '1rem',
'spacing-6': '1.25rem',
'spacing-7': '1.5rem',
'spacing-8': '2rem',
} as const;
2 changes: 2 additions & 0 deletions unocss.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import transformerDirectives from '@unocss/transformer-directives';
import transformerVariantGroup from '@unocss/transformer-variant-group';
import { defineConfig } from 'unocss';

import { spacing } from './src/shared/types/Spacing';
import { colors } from './src/shared/types/ThemeColors';

export default defineConfig({
Expand Down Expand Up @@ -36,6 +37,7 @@ export default defineConfig({
'out-expo': 'cubic-bezier(0.19, 1, 0.22, 1)',
},
colors,
spacing,
},
variants: [
matcher => {
Expand Down

0 comments on commit e61ab56

Please sign in to comment.