sx
prop isn't working where as style
prop works perfectly fine
#1142
Unanswered
deadcoder0904
asked this question in
General
Replies: 1 comment
-
I changed my /** @jsx jsx */
import { jsx } from '@theme-ui/core'
import { HTMLAttributes } from 'react'
export const H1 = (props: HTMLAttributes<HTMLHeadingElement>) => (
<h1 sx={{ color: 'tomato', margin: '4rem' }} {...props} />
) Added I just saw the generated CSS in Devtools & it looks like: css-48v1qb {
𝚌̶𝚘̶𝚕̶𝚘̶𝚛̶:̶ ̶𝚝̶𝚘̶𝚖̶𝚊̶𝚝̶𝚘̶;̶
margin: 4rem;
font-family: 'Inter var',Georgia,Cambria,'Times New Roman',Times,serif;
line-height: 1.125;
font-weight: 700;
font-size: 32px;
color: var(--theme-ui-colors-primary,#87EAF2);
} Is this an error? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a Next.js + TS project with Theme UI with the following folder structure:
And I have a MDX file as follows:
src/pages/hello.mdx
# Hello This is the world
This is my
_app.tsx
file:src/pages/_app.tsx
This is the file where I export
MDXComponents
from:src/components/mdx/index.ts
And finally my
H1
component:src/components/mdx/H1.tsx
The
Hello
printed on the screen (seehello.mdx
above) is intomato
color thanks to the aboveH1
component.But if I change the
H1
component to:src/components/mdx/H1.tsx
It doesn't work. It shows the default from
theme
.My
theme.ts
looks like:src/config/theme.ts
I don't see any problem. Any ideas what I am doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions