How do I access my theme in component styles? #20910
Unanswered
JohannesOlsson8
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hi @JohannesOlsson8, which version of the product are you using? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I've been searching for an answer all morning without result, hopefully you guys can help me.
My project is wrapped in a and my themes are working well.
The problem is that I can't access it in any ...styles.ts file. I've tried using the useTheme hook but it only returns some default theme for Fluent.
I've also tried this (deprecated).
`import { makeStyles } from "@fluentui/react";
export const useFooStyles = makeStyles((theme) => ({
root: {
width: "100px",
height: "100px",
background: theme.palette.themePrimary,
},
}));
`
What am I missing?
Beta Was this translation helpful? Give feedback.
All reactions