Closed VugarAhmadov closed 1 year ago
How to use ant theme object inside styled components from emotion like Mui? Normally I do it in Mui like
import { Theme as MuiTheme } from "@mui/material/styles"; declare module "@emotion/react" { export interface Theme extends MuiTheme {} }
and access theme variable inside styled components like
import styled from "@emotion/styled"; export const StyledDiv = styled.div` .MuiToggleButtonGroup-root { ${({ theme }) => theme.breakpoints.down("md")} { flex-wrap: wrap; } .MuiButtonBase-root { background-color: ${({ theme }) => theme.palette.common.white}; color: ${({ theme }) => theme.palette.custom.greyChateau}; } } `
How I will get theme object in Ant-design cssinjs solution?
In antd you can get by:
import { theme } from 'antd'; const { useToken } = theme;
How to use ant theme object inside styled components from emotion like Mui? Normally I do it in Mui like
and access theme variable inside styled components like
How I will get theme object in Ant-design cssinjs solution?