Skip to content

[Docs] EuiThemeProvider global theme switching #5072

Closed as not planned
Closed as not planned

Description

@thompsongl

We should add an example like this of how to hook up the theme names and colorMode in the https://eui.elastic.co/pr_4511/#/theming/theme-provider#euithemeprovider example

Originally posted by @cchaos in #4511 (comment)

Activity

  1. github-actions commented on Feb 21, 2022

    @github-actions

    👋 Hey there. This issue hasn't had any activity for 180 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment.

  2. added
    stale-issue
    on Feb 21, 2022
  3. added and removed
    stale-issue
    on Feb 21, 2022
  4. blessedjasonmwanza commented on May 31, 2022

    @blessedjasonmwanza

    Hi @cchaos && @cconboy - This mention illustrates some weird behavior of how theming fails to comply with index.js provider configs. Is there a way to make this setting intuitive?

  5. ebuildy commented on Nov 7, 2022

    @ebuildy
    Contributor

    Agree, documentation is really missing a concrete example, by using React Lazy & suspense. Here what I did:

    https://github.com/datatok/gui/pull/13/files

    Embed theme inside React component:

    import React, { FC } from 'react'
    
    import '@elastic/eui/dist/eui_theme_light.css'
    
    const Theme: FC = () => (<React.Fragment></React.Fragment>)
    
    export default Theme
    

    The magic (where state.theme host the theme):

    const LightTheme = React.lazy(async () => await import('../themes/Light'))
    const DarkTheme = React.lazy(async () => await import('../themes/Dark'))
    
    <React.Suspense fallback={<></>}>
            {(state.theme === 'light') && <LightTheme />}
            {(state.theme === 'dark') && <DarkTheme />}
          </React.Suspense>
    
  6. added
    documentation
    on Nov 8, 2022
  7. github-actions commented on Oct 22, 2023

    @github-actions

    👋 Hi there - this issue hasn't had any activity in 6 months. If the EUI team has not explicitly expressed that this is something on our roadmap, it's unlikely that we'll pick this issue up. We would sincerely appreciate a PR/community contribution if this is something that matters to you! If not, and there is no further activity on this issue for another 6 months (i.e. it's stale for over a year), the issue will be auto-closed.

  8. added
    stale-issue
    on Oct 22, 2023
  9. github-actions commented on Apr 19, 2024

    @github-actions

    ❌ Per our previous message, this issue is auto-closing after having been open and inactive for a year. If you strongly feel this is still a high-priority issue, or are interested in contributing, please leave a comment or open a new issue linking to this one for context.

  10. added
    stale-issue-closed
    on Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationemotionstale-issuestale-issue-closed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions