Skip to content

Commit

Permalink
refactor(core): update property assignments in style configs
Browse files Browse the repository at this point in the history
  • Loading branch information
hirotomoyamada committed Sep 30, 2023
1 parent 322fee4 commit e73947b
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 30 deletions.
5 changes: 5 additions & 0 deletions .changeset/famous-ducks-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@yamada-ui/core': patch
---

Updated property assignments in style configs.
18 changes: 9 additions & 9 deletions packages/core/src/styles/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ export const background: Configs = {
backgroundRepeat: true,
backgroundAttachment: true,
backgroundClip: { transform: transforms.bgClip },
bgSize: configs.prop('backgroundSize'),
bgPosition: configs.prop('backgroundPosition'),
bg: configs.color('background'),
bgColor: configs.color('backgroundColor'),
bgPos: configs.prop('backgroundPosition'),
bgRepeat: configs.prop('backgroundRepeat'),
bgAttachment: configs.prop('backgroundAttachment'),
bgGradient: configs.gradient('backgroundImage'),
bgClip: { transform: transforms.bgClip },
}

Object.assign(background, {
bg: background.background,
bgColor: background.backgroundColor,
bgImage: background.backgroundImage,
bgImg: background.backgroundImage,
bgGradient: background.backgroundImage,
bgPos: background.bgPosition,
bgClip: background.backgroundClip,
bgSize: background.backgroundSize,
bgPosition: background.backgroundPosition,
bgRepeat: background.backgroundRepeat,
bgAttachment: background.backgroundAttachment,
})

export type BackgroundProps<Y = 'responsive', M = 'colorMode'> = {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/styles/effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { Configs, configs } from './config'
export const effect: Configs = {
boxShadow: configs.shadow('boxShadow'),
mixBlendMode: true,
blendMode: configs.prop('mixBlendMode'),
backgroundBlendMode: true,
bgBlendMode: configs.prop('backgroundBlendMode'),
opacity: true,
}

Object.assign(effect, {
shadow: effect.boxShadow,
blendMode: effect.mixBlendMode,
backgroundBlendMode: effect.backgroundBlendMode,
})

export type EffectProps<Y = 'responsive', M = 'colorMode'> = {
Expand Down
5 changes: 1 addition & 4 deletions packages/core/src/styles/flex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const flex: Configs = {
justifyContent: true,
flexWrap: true,
flexDirection: true,
flexDir: { properties: 'flexDirection' },
flex: true,
flexFlow: true,
flexGrow: true,
Expand All @@ -25,10 +26,6 @@ export const flex: Configs = {
columnGap: configs.space('columnGap'),
}

Object.assign(flex, {
flexDir: flex.flexDirection,
})

export type FlexProps<Y = 'responsive', M = 'colorMode'> = {
/**
* The CSS `align-items` property.
Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/styles/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ export const layout: Configs = {
overflowX: true,
overflowY: true,
overscrollBehavior: true,
overscrollBehaviorX: true,
overscroll: { properties: 'overscrollBehavior' },
overscrollX: true,
textDecor: { properties: 'overscrollBehaviorX' },
overscrollBehaviorY: true,
overscrollY: { properties: 'overscrollBehaviorY' },
display: true,
aspectRatio: true,
verticalAlign: true,
Expand All @@ -41,9 +44,6 @@ Object.assign(layout, {
maxW: layout.maxWidth,
minH: layout.minHeight,
maxH: layout.maxHeight,
overscroll: layout.overscrollBehavior,
overscrollX: layout.overscrollBehaviorX,
overscrollY: layout.overscrollBehaviorY,
})

export type LayoutProps<Y = 'responsive', M = 'colorMode'> = {
Expand Down
9 changes: 3 additions & 6 deletions packages/core/src/styles/list.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import type * as CSS from 'csstype'
import { Token } from '../css'
import { Configs } from './config'
import { Configs, configs } from './config'

export const list: Configs = {
listStyleType: true,
listStylePosition: true,
listStylePos: configs.prop('listStylePosition'),
listStyleImage: true,
listStyleImg: configs.prop('listStyleImage'),
}

Object.assign(list, {
listStylePos: list.listStylePosition,
listStyleImg: list.listStyleImage,
})

export type ListProps<Y = 'responsive', M = 'colorMode'> = {
/**
* The CSS `list-style-type` property.
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/styles/position.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Configs, configs } from './config'

export const position: Configs = {
position: true,
pos: configs.prop('position'),
zIndex: configs.prop('zIndex', 'zIndices'),
inset: configs.space('inset'),
insetX: configs.space(['left', 'right']),
Expand All @@ -21,7 +22,6 @@ export const position: Configs = {
}

Object.assign(position, {
pos: position.position,
insetStart: position.insetInlineStart,
insetEnd: position.insetInlineEnd,
})
Expand Down
5 changes: 1 addition & 4 deletions packages/core/src/styles/typography.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const typography: Configs = {
whiteSpace: true,
textDecorationColor: configs.color('textDecorationColor'),
textDecoration: true,
textDecor: { properties: 'textDecoration' },
textDecorationLine: true,
textDecorationStyle: true,
textDecorationThickness: true,
Expand All @@ -39,10 +40,6 @@ export const typography: Configs = {
},
}

Object.assign(typography, {
textDecor: typography.textDecoration,
})

export type TypographyProps<Y = 'responsive', M = 'colorMode'> = {
/**
* The CSS `font-weight` property.
Expand Down

0 comments on commit e73947b

Please sign in to comment.