MCPcopy
hub / github.com/tailwindlabs/tailwindcss / parseThemeOptions

Function parseThemeOptions

packages/tailwindcss/src/index.ts:86–105  ·  view source on GitHub ↗
(params: string)

Source from the content-addressed store, hash-verified

84}
85
86function parseThemeOptions(params: string) {
87 let options = ThemeOptions.NONE
88 let prefix = null
89
90 for (let option of segment(params, ' ')) {
91 if (option === 'reference') {
92 options |= ThemeOptions.REFERENCE
93 } else if (option === 'inline') {
94 options |= ThemeOptions.INLINE
95 } else if (option === 'default') {
96 options |= ThemeOptions.DEFAULT
97 } else if (option === 'static') {
98 options |= ThemeOptions.STATIC
99 } else if (option.startsWith('prefix(') && option.endsWith(')')) {
100 prefix = option.slice(7, -1)
101 }
102 }
103
104 return [options, prefix] as const
105}
106
107type Root =
108 // Unknown root

Callers 1

parseCssFunction · 0.85

Calls 1

segmentFunction · 0.90

Tested by

no test coverage detected