legacy-utilities.ts — tailwindcss Source File
Architecture documentation for legacy-utilities.ts, a typescript file in the tailwindcss codebase. 8 imports, 1 dependents.
Entity Profile
Dependency Diagram
graph LR 13af74f3_f39e_86e7_a3f9_c2738431bca0["legacy-utilities.ts"] 42640952_ea63_55f1_1ff1_00816e2980ae["ast.ts"] 13af74f3_f39e_86e7_a3f9_c2738431bca0 --> 42640952_ea63_55f1_1ff1_00816e2980ae c203f636_607a_d332_b4c5_6a40c108f778["decl"] 13af74f3_f39e_86e7_a3f9_c2738431bca0 --> c203f636_607a_d332_b4c5_6a40c108f778 7fd72d4c_e95c_d849_1002_1e1c9d8aca1a["design-system.ts"] 13af74f3_f39e_86e7_a3f9_c2738431bca0 --> 7fd72d4c_e95c_d849_1002_1e1c9d8aca1a 516809a4_c70e_60c3_bbb2_8de4c4572510["infer-data-type.ts"] 13af74f3_f39e_86e7_a3f9_c2738431bca0 --> 516809a4_c70e_60c3_bbb2_8de4c4572510 4e39f1e7_ebcb_7f62_4a59_b645e71d50fd["isPositiveInteger"] 13af74f3_f39e_86e7_a3f9_c2738431bca0 --> 4e39f1e7_ebcb_7f62_4a59_b645e71d50fd a15b3c4a_76ff_0090_fc86_bac24f0a4135["isValidSpacingMultiplier"] 13af74f3_f39e_86e7_a3f9_c2738431bca0 --> a15b3c4a_76ff_0090_fc86_bac24f0a4135 ef204000_8998_5a6c_5455_324b37624713["segment.ts"] 13af74f3_f39e_86e7_a3f9_c2738431bca0 --> ef204000_8998_5a6c_5455_324b37624713 f712ed47_45d4_4e5a_dd73_fdefa1da71da["segment"] 13af74f3_f39e_86e7_a3f9_c2738431bca0 --> f712ed47_45d4_4e5a_dd73_fdefa1da71da daaadd53_16ee_21c6_12d9_8feaac80a91b["apply-compat-hooks.ts"] daaadd53_16ee_21c6_12d9_8feaac80a91b --> 13af74f3_f39e_86e7_a3f9_c2738431bca0 style 13af74f3_f39e_86e7_a3f9_c2738431bca0 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import { decl } from '../ast'
import type { DesignSystem } from '../design-system'
import { isPositiveInteger, isValidSpacingMultiplier } from '../utils/infer-data-type'
import { segment } from '../utils/segment'
export function registerLegacyUtilities(designSystem: DesignSystem) {
for (let [value, direction] of [
['t', 'top'],
['tr', 'top right'],
['r', 'right'],
['br', 'bottom right'],
['b', 'bottom'],
['bl', 'bottom left'],
['l', 'left'],
['tl', 'top left'],
]) {
designSystem.utilities.suggest(`bg-gradient-to-${value}`, () => [])
designSystem.utilities.static(`bg-gradient-to-${value}`, () => [
decl('--tw-gradient-position', `to ${direction} in oklab`),
decl('background-image', `linear-gradient(var(--tw-gradient-stops))`),
])
}
// Legacy `background-position` utilities for compatibility with v4.0 and earlier
designSystem.utilities.suggest('bg-left-top', () => [])
designSystem.utilities.static('bg-left-top', () => [decl('background-position', 'left top')])
designSystem.utilities.suggest('bg-right-top', () => [])
designSystem.utilities.static('bg-right-top', () => [decl('background-position', 'right top')])
designSystem.utilities.suggest('bg-left-bottom', () => [])
designSystem.utilities.static('bg-left-bottom', () => [
decl('background-position', 'left bottom'),
])
designSystem.utilities.suggest('bg-right-bottom', () => [])
designSystem.utilities.static('bg-right-bottom', () => [
decl('background-position', 'right bottom'),
])
// Legacy `object-position` utilities for compatibility with v4.0 and earlier
designSystem.utilities.suggest('object-left-top', () => [])
designSystem.utilities.static('object-left-top', () => [decl('object-position', 'left top')])
designSystem.utilities.suggest('object-right-top', () => [])
designSystem.utilities.static('object-right-top', () => [decl('object-position', 'right top')])
designSystem.utilities.suggest('object-left-bottom', () => [])
designSystem.utilities.static('object-left-bottom', () => [
decl('object-position', 'left bottom'),
])
designSystem.utilities.suggest('object-right-bottom', () => [])
designSystem.utilities.static('object-right-bottom', () => [
decl('object-position', 'right bottom'),
])
designSystem.utilities.suggest('max-w-screen', () => [])
designSystem.utilities.functional('max-w-screen', (candidate) => {
if (!candidate.value) return
if (candidate.value.kind === 'arbitrary') return
let value = designSystem.theme.resolve(candidate.value.value, ['--breakpoint'])
if (!value) return
return [decl('max-width', value)]
})
// ... (120 more lines)
Domain
Subdomains
Functions
Dependencies
Source
Frequently Asked Questions
What does legacy-utilities.ts do?
legacy-utilities.ts is a source file in the tailwindcss codebase, written in typescript. It belongs to the OxideEngine domain, Scanner subdomain.
What functions are defined in legacy-utilities.ts?
legacy-utilities.ts defines 1 function(s): registerLegacyUtilities.
What does legacy-utilities.ts depend on?
legacy-utilities.ts imports 8 module(s): ast.ts, decl, design-system.ts, infer-data-type.ts, isPositiveInteger, isValidSpacingMultiplier, segment, segment.ts.
What files import legacy-utilities.ts?
legacy-utilities.ts is imported by 1 file(s): apply-compat-hooks.ts.
Where is legacy-utilities.ts in the architecture?
legacy-utilities.ts is located at packages/tailwindcss/src/compat/legacy-utilities.ts (domain: OxideEngine, subdomain: Scanner, directory: packages/tailwindcss/src/compat).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free