-
Notifications
You must be signed in to change notification settings - Fork 672
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core): add
css
prop back to JSX types
- Loading branch information
Showing
6 changed files
with
214 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,5 +22,6 @@ module.exports = { | |
|
||
// TypeScript checks this | ||
'no-undef': 'off', | ||
'no-lone-blocks': 'off', | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,52 @@ | ||
import { ThemeUIStyleObject } from '@theme-ui/css' | ||
|
||
import { ThemeUIJSX } from './jsx-namespace' | ||
|
||
export interface SxProp { | ||
/** | ||
* The sx prop lets you style elements inline, using values from your | ||
* theme. To use the sx prop, add the custom pragma as a comment to the | ||
* top of your module and import the jsx function. | ||
* | ||
* ```ts | ||
* // @jsx jsx | ||
* | ||
* import { jsx } from 'theme-ui' | ||
* ``` | ||
*/ | ||
sx?: ThemeUIStyleObject | ||
} | ||
|
||
export interface IntrinsicSxElements { | ||
p: ThemeUIJSX.IntrinsicElements['p'] | ||
b: ThemeUIJSX.IntrinsicElements['b'] | ||
i: ThemeUIJSX.IntrinsicElements['i'] | ||
a: ThemeUIJSX.IntrinsicElements['a'] | ||
h1: ThemeUIJSX.IntrinsicElements['h1'] | ||
h2: ThemeUIJSX.IntrinsicElements['h2'] | ||
h3: ThemeUIJSX.IntrinsicElements['h3'] | ||
h4: ThemeUIJSX.IntrinsicElements['h4'] | ||
h5: ThemeUIJSX.IntrinsicElements['h5'] | ||
h6: ThemeUIJSX.IntrinsicElements['h6'] | ||
img: ThemeUIJSX.IntrinsicElements['img'] | ||
pre: ThemeUIJSX.IntrinsicElements['pre'] | ||
code: ThemeUIJSX.IntrinsicElements['code'] | ||
ol: ThemeUIJSX.IntrinsicElements['ol'] | ||
ul: ThemeUIJSX.IntrinsicElements['ul'] | ||
li: ThemeUIJSX.IntrinsicElements['li'] | ||
blockquote: ThemeUIJSX.IntrinsicElements['blockquote'] | ||
hr: ThemeUIJSX.IntrinsicElements['hr'] | ||
table: ThemeUIJSX.IntrinsicElements['table'] | ||
tr: ThemeUIJSX.IntrinsicElements['tr'] | ||
th: ThemeUIJSX.IntrinsicElements['th'] | ||
td: ThemeUIJSX.IntrinsicElements['td'] | ||
em: ThemeUIJSX.IntrinsicElements['em'] | ||
strong: ThemeUIJSX.IntrinsicElements['strong'] | ||
div: ThemeUIJSX.IntrinsicElements['div'] | ||
del: ThemeUIJSX.IntrinsicElements['div'] | ||
inlineCode: ThemeUIJSX.IntrinsicElements['div'] | ||
thematicBreak: ThemeUIJSX.IntrinsicElements['div'] | ||
root: ThemeUIJSX.IntrinsicElements['div'] | ||
} | ||
import { Interpolation } from '@emotion/react' | ||
import { ThemeUIStyleObject, Theme as ThemeUITheme } from '@theme-ui/css' | ||
|
||
import { ThemeUIJSX } from './jsx-namespace' | ||
|
||
export interface SxProp { | ||
/** | ||
* The sx prop lets you style elements inline, using values from your | ||
* theme. | ||
* | ||
* @see https://theme-ui.com/sx-prop/ | ||
*/ | ||
sx?: ThemeUIStyleObject | ||
/** | ||
* Theme UI uses Emotion's JSX function. You can pass styles to it directly | ||
* using `css` prop. | ||
* @see https://theme-ui.com/sx-prop/#raw-css | ||
*/ | ||
css?: Interpolation<ThemeUITheme> | ||
} | ||
|
||
export interface IntrinsicSxElements { | ||
p: ThemeUIJSX.IntrinsicElements['p'] | ||
b: ThemeUIJSX.IntrinsicElements['b'] | ||
i: ThemeUIJSX.IntrinsicElements['i'] | ||
a: ThemeUIJSX.IntrinsicElements['a'] | ||
h1: ThemeUIJSX.IntrinsicElements['h1'] | ||
h2: ThemeUIJSX.IntrinsicElements['h2'] | ||
h3: ThemeUIJSX.IntrinsicElements['h3'] | ||
h4: ThemeUIJSX.IntrinsicElements['h4'] | ||
h5: ThemeUIJSX.IntrinsicElements['h5'] | ||
h6: ThemeUIJSX.IntrinsicElements['h6'] | ||
img: ThemeUIJSX.IntrinsicElements['img'] | ||
pre: ThemeUIJSX.IntrinsicElements['pre'] | ||
code: ThemeUIJSX.IntrinsicElements['code'] | ||
ol: ThemeUIJSX.IntrinsicElements['ol'] | ||
ul: ThemeUIJSX.IntrinsicElements['ul'] | ||
li: ThemeUIJSX.IntrinsicElements['li'] | ||
blockquote: ThemeUIJSX.IntrinsicElements['blockquote'] | ||
hr: ThemeUIJSX.IntrinsicElements['hr'] | ||
table: ThemeUIJSX.IntrinsicElements['table'] | ||
tr: ThemeUIJSX.IntrinsicElements['tr'] | ||
th: ThemeUIJSX.IntrinsicElements['th'] | ||
td: ThemeUIJSX.IntrinsicElements['td'] | ||
em: ThemeUIJSX.IntrinsicElements['em'] | ||
strong: ThemeUIJSX.IntrinsicElements['strong'] | ||
div: ThemeUIJSX.IntrinsicElements['div'] | ||
del: ThemeUIJSX.IntrinsicElements['div'] | ||
inlineCode: ThemeUIJSX.IntrinsicElements['div'] | ||
thematicBreak: ThemeUIJSX.IntrinsicElements['div'] | ||
root: ThemeUIJSX.IntrinsicElements['div'] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.