Skip to content

Commit

Permalink
refactor: use xs as default gutter
Browse files Browse the repository at this point in the history
  • Loading branch information
Calvein committed Sep 13, 2023
1 parent 2c0039a commit 62848f8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions packages/Core/src/theme/dropdownMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { CSSObject } from '@xstyled/styled-components'
import { WuiTheme } from './types'

export type ThemeDropdownMenu = {
gutter: number
inner: CSSObject
item: CSSObject
separator: CSSObject
Expand All @@ -14,7 +13,6 @@ export const getDropdownMenu = (theme: WuiTheme): ThemeDropdownMenu => {
const borderColor = colors['nude-200']

return {
gutter: 10,
inner: {
fontSize: fontSizes.sm,
minWidth: toRem(130),
Expand Down
4 changes: 2 additions & 2 deletions packages/DropdownMenu/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ export interface DropdownMenuOptions extends Omit<Ariakit.MenuProps, 'gutter'> {
export type DropdownMenuProps = CreateWuiProps<'div', DropdownMenuOptions>

const DropdownMenuComponent = forwardRef<'div', DropdownMenuProps>(
({ children, dataTestId, innerProps = {}, store, gutter, ...rest }, ref) => {
({ children, dataTestId, innerProps = {}, store, gutter = 'xs', ...rest }, ref) => {
const theme = useTheme()
const arrowElement = store.useState('arrowElement')
const isOpen = store.useState('open')

let parsedGutter = gutter ?? theme.dropdownMenu.gutter
let parsedGutter = gutter
if (typeof parsedGutter === 'string') {
// The value from the theme is in rem, e.g: 1.5rem
// So we parse it to float and pass it to theme.toPx that will convert it to px, e.g: 24px
Expand Down

0 comments on commit 62848f8

Please sign in to comment.