Skip to content

Commit cea86ed

Browse files
committed
Cleanup code
1 parent c45ed2b commit cea86ed

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/tailwindcss/src/compat/plugin-functions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,14 @@ function readFromCss(
211211
// the `DEFAULT` key from the list of possible values. If there is no
212212
// `DEFAULT` in the list, there is no match so return `null`.
213213
if (path[path.length - 1] === 'DEFAULT') {
214-
return [(obj?.DEFAULT ?? null) as any, optionsObj.DEFAULT ?? 0] as const
214+
return [(obj?.DEFAULT ?? null) as any, optionsObj.DEFAULT ?? ThemeOptions.NONE] as const
215215
}
216216

217217
// The request looked like `theme('animation.spin')` and was turned into a
218218
// lookup for `--animation-spin-*` which had only one entry which means it
219219
// should be returned directly.
220220
if ('DEFAULT' in obj && Object.keys(obj).length === 1) {
221-
return [obj.DEFAULT as any, optionsObj.DEFAULT ?? 0] as const
221+
return [obj.DEFAULT as any, optionsObj.DEFAULT ?? ThemeOptions.NONE] as const
222222
}
223223

224224
// Attach the CSS values to the object for later use. This object could be

packages/tailwindcss/src/theme.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ export class Theme {
6666
}
6767

6868
hasDefault(key: string): boolean {
69-
return ((this.values.get(key)?.options ?? 0) & ThemeOptions.DEFAULT) === ThemeOptions.DEFAULT
69+
return (this.getOptions(key) & ThemeOptions.DEFAULT) === ThemeOptions.DEFAULT
7070
}
7171

7272
getOptions(key: string) {
73-
return this.values.get(key)?.options ?? 0
73+
return this.values.get(key)?.options ?? ThemeOptions.NONE
7474
}
7575

7676
entries() {

0 commit comments

Comments
 (0)