Home / Function/ getImplicitPreference() — supabase Function Reference

getImplicitPreference() — supabase Function Reference

Architecture documentation for the getImplicitPreference() function in shared.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  04e23bd9_35be_f55e_3b0c_6d65f736ceb6["getImplicitPreference()"]
  e2d3eba8_76c5_f344_265b_478004793260["ThemeProvider()"]
  e2d3eba8_76c5_f344_265b_478004793260 -->|calls| 04e23bd9_35be_f55e_3b0c_6d65f736ceb6
  style 04e23bd9_35be_f55e_3b0c_6d65f736ceb6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/cms/src/providers/Theme/shared.ts lines 7–17

export const getImplicitPreference = (): Theme | null => {
  const mediaQuery = '(prefers-color-scheme: dark)'
  const mql = window.matchMedia(mediaQuery)
  const hasImplicitPreference = typeof mql.matches === 'boolean'

  if (hasImplicitPreference) {
    return mql.matches ? 'dark' : 'light'
  }

  return null
}

Subdomains

Called By

Frequently Asked Questions

What does getImplicitPreference() do?
getImplicitPreference() is a function in the supabase codebase.
What calls getImplicitPreference()?
getImplicitPreference() is called by 1 function(s): ThemeProvider.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free