Repository: tailwindlabs/tailwindcss
File: packages/tailwindcss/src/utilities.ts (TypeScript)

Code before:
  staticUtility('text-balance', [['text-wrap', 'balance']])
  staticUtility('text-pretty', [['text-wrap', 'pretty']])
  staticUtility('break-normal', [
    ['overflow-wrap', 'normal'],
    ['word-break', 'normal'],
  ])
  staticUtility('break-words', [['overflow-wrap', 'break-word']])
  staticUtility('break-all', [['word-break', 'break-all']])
  staticUtility('break-keep', [['word-break', 'break-keep']])

  {
    function handleBareBorderRadiusValue({ value }: NamedUtilityValue) {
      switch (value) {
        case 'none':
          return '0px'
        case 'full':
          return 'calc(infinity * 1px)'
        default:
          return null
      }
    }

    // rounded-*
    functionalUtility('rounded', {
      themeKeys: ['--radius'],
      handleBareValue: handleBareBorderRadiusValue,
      handle: (value) => [decl('border-radius', value)],
    })

    functionalUtility('rounded-s', {
      themeKeys: ['--radius'],
      handleBareValue: handleBareBorderRadiusValue,
      handle: (value) => [
        decl('border-start-start-radius', value),
        decl('border-end-start-radius', value),
      ],
    })

    functionalUtility('rounded-e', {
      themeKeys: ['--radius'],
      handleBareValue: handleBareBorderRadiusValue,
      handle: (value) => [
        decl('border-start-end-radius', value),
        decl('border-end-end-radius', value),
      ],
    })

    functionalUtility('rounded-t', {
      themeKeys: ['--radius'],
      handleBareValue: handleBareBorderRadiusValue,
      handle: (value) => [

Review comment (refactor):
These should probably be implemented using `staticUtility` instead of `handleBareValue`.

Code after:

  staticUtility('text-wrap', [['text-wrap', 'wrap']])
  staticUtility('text-nowrap', [['text-wrap', 'nowrap']])
  staticUtility('text-balance', [['text-wrap', 'balance']])
  staticUtility('text-pretty', [['text-wrap', 'pretty']])
  staticUtility('break-normal', [
    ['overflow-wrap', 'normal'],
    ['word-break', 'normal'],
  ])
  staticUtility('break-words', [['overflow-wrap', 'break-word']])
  staticUtility('break-all', [['word-break', 'break-all']])
  staticUtility('break-keep', [['word-break', 'break-keep']])

  {
    // border-radius
    for (let [root, properties] of [
      ['rounded', ['border-radius']],
      ['rounded-s', ['border-start-start-radius', 'border-end-start-radius']],
      ['rounded-e', ['border-start-end-radius', 'border-end-end-radius']],
      ['rounded-t', ['border-top-left-radius', 'border-top-right-radius']],
      ['rounded-r', ['border-top-right-radius', 'border-bottom-right-radius']],
      ['rounded-b', ['border-bottom-right-radius', 'border-bottom-left-radius']],
      ['rounded-l', ['border-top-left-radius', 'border-bottom-left-radius']],
      ['rounded-ss', ['border-start-start-radius']],
      ['rounded-se', ['border-start-end-radius']],
      ['rounded-ee', ['border-end-end-radius']],
      ['rounded-es', ['border-end-start-radius']],
      ['rounded-tl', ['border-top-left-radius']],
      ['rounded-tr', ['border-top-right-radius']],
      ['rounded-br', ['border-bottom-right-radius']],
      ['rounded-bl', ['border-bottom-left-radius']],
    ] as const) {
      staticUtility(
        `${root}-none`,
        properties.map((property) => [property, '0']),
      )
      staticUtility(
        `${root}-full`,
        properties.map((property) => [property, 'calc(infinity * 1px)']),
      )
      functionalUtility(root, {
        themeKeys: ['--radius'],
        handle: (value) => properties.map((property) => decl(property, value)),
      })
    }
  }

  staticUtility('border-solid', [
    ['--tw-border-style', 'solid'],
    ['border-style', 'solid'],
  ])