Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EuiThemeProvider Usage #5198

Closed
thomaswall opened this issue Sep 17, 2021 · 1 comment
Closed

EuiThemeProvider Usage #5198

thomaswall opened this issue Sep 17, 2021 · 1 comment

Comments

@thomaswall
Copy link

Is EuiThemeProvider supported yet? Or will this be released with the full transition to Emotion? I've attempted to recreate the example from the documentation, but overrides won't take effect.

import { EuiThemeProvider } from "@elastic/eui"
    
const overrides = {
    colors: {
      LIGHT: { lightShade: '#d3e6df' },
      DARK: { lightShade: '#394c4b' },
    },
 }

    
function Test() {
  return (
    <EuiThemeProvider modify={overrides}>
        <EuiButton>Test</EuiButton>
    </EuiThemeProvider>
  )
}

I've also tried removing this import entirely:

import "@elastic/eui/dist/eui_theme_light.css"

But this just entirely removes styling altogether.

@cchaos
Copy link
Contributor

cchaos commented Sep 17, 2021

Hey @thomaswall, None of the EUI components have been converted yet to the theme context (Emotion styling). We have simply setup the provider as a means to consume the global variables. See the note on the Global Variables page.

Screen Shot 2021-09-17 at 14 01 26 PM

It will most likely take a better part of a year to get the whole of EUI converted to this new styling method. You can track the project progress in our meta ticket: #3912

It should also be noted that none of the examples on the theme provider page currently showcase using it to alter EUI components, but purely as a way to create custom styles with EUI styling tokens.

@cchaos cchaos closed this as completed Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants