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

Method clearNamespace

packages/tailwindcss/src/theme.ts:149–166  ·  view source on GitHub ↗
(namespace: string, clearOptions: ThemeOptions)

Source from the content-addressed store, hash-verified

147 }
148
149 clearNamespace(namespace: string, clearOptions: ThemeOptions) {
150 let ignored = ignoredThemeKeyMap.get(namespace) ?? []
151
152 outer: for (let key of this.values.keys()) {
153 if (key.startsWith(namespace)) {
154 if (clearOptions !== ThemeOptions.NONE) {
155 let options = this.getOptions(key)
156 if ((options & clearOptions) !== clearOptions) {
157 continue
158 }
159 }
160 for (let ignoredNamespace of ignored) {
161 if (key.startsWith(ignoredNamespace)) continue outer
162 }
163 this.values.delete(key)
164 }
165 }
166 }
167
168 #resolveKey(candidateValue: string | null, themeKeys: ThemeKey[]): string | null {
169 for (let namespace of themeKeys) {

Callers 4

addMethod · 0.95
applyConfigToThemeFunction · 0.80

Calls 3

getOptionsMethod · 0.95
getMethod · 0.45
keysMethod · 0.45

Tested by

no test coverage detected