dimensions.ts — tailwindcss Source File
Architecture documentation for dimensions.ts, a typescript file in the tailwindcss codebase. 2 imports, 2 dependents.
Entity Profile
Dependency Diagram
graph LR 27d3cdf1_e27d_4437_413c_da251dc63276["dimensions.ts"] 28a2f72d_350c_6647_bf9d_77c69e637045["default-map.ts"] 27d3cdf1_e27d_4437_413c_da251dc63276 --> 28a2f72d_350c_6647_bf9d_77c69e637045 cfb4af0e_7b2d_34a1_693a_90088443cfec["DefaultMap"] 27d3cdf1_e27d_4437_413c_da251dc63276 --> cfb4af0e_7b2d_34a1_693a_90088443cfec f6c14bbb_2e42_58cc_18f1_c89a243da9c0["canonicalize-candidates.ts"] f6c14bbb_2e42_58cc_18f1_c89a243da9c0 --> 27d3cdf1_e27d_4437_413c_da251dc63276 28f23724_d31a_a8d3_3dd6_07e505ec5b7b["constant-fold-declaration.ts"] 28f23724_d31a_a8d3_3dd6_07e505ec5b7b --> 27d3cdf1_e27d_4437_413c_da251dc63276 style 27d3cdf1_e27d_4437_413c_da251dc63276 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import { DefaultMap } from '../../../tailwindcss/src/utils/default-map'
const DIMENSION_REGEX = /^(?<value>[-+]?(?:\d*\.)?\d+)(?<unit>[a-z]+|%)?$/i
// Parse a dimension such as `64rem` into `[64, 'rem']`.
export const dimensions = new DefaultMap((input) => {
let match = DIMENSION_REGEX.exec(input)
if (!match) return null
let value = match.groups?.value
if (value === undefined) return null
let valueAsNumber = Number(value)
if (Number.isNaN(valueAsNumber)) return null
let unit = match.groups?.unit
if (unit === undefined) return [valueAsNumber, null] as const
return [valueAsNumber, unit] as const
})
Domain
Subdomains
Functions
Dependencies
Imported By
Source
Frequently Asked Questions
What does dimensions.ts do?
dimensions.ts is a source file in the tailwindcss codebase, written in typescript. It belongs to the Oxide domain, Extractor subdomain.
What functions are defined in dimensions.ts?
dimensions.ts defines 1 function(s): dimensions.
What does dimensions.ts depend on?
dimensions.ts imports 2 module(s): DefaultMap, default-map.ts.
What files import dimensions.ts?
dimensions.ts is imported by 2 file(s): canonicalize-candidates.ts, constant-fold-declaration.ts.
Where is dimensions.ts in the architecture?
dimensions.ts is located at packages/tailwindcss/src/utils/dimensions.ts (domain: Oxide, subdomain: Extractor, directory: packages/tailwindcss/src/utils).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free