generated from arvinxx/npm-template
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 fix: 修正 prefixCls 在嵌套 ThemeProvider 中没有继承的问题 (#78)
* 🐛 fix: 修正 prefixCls 在嵌套 ThemeProvider 中没有继承的问题 * 🔖 chore(release): v3.4.1-beta.1 [skip ci] --------- Co-authored-by: semantic-release-bot <[email protected]>
- Loading branch information
1 parent
f5eeb9c
commit d939a2a
Showing
5 changed files
with
51 additions
and
3 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
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 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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* debug: true | ||
* iframe: true | ||
*/ | ||
import { Button } from 'antd'; | ||
import { ThemeProvider, createStyles } from 'antd-style'; | ||
|
||
const useStyles = createStyles(({ css, prefixCls }) => ({ | ||
button: css` | ||
.${prefixCls}-btn { | ||
background: pink; | ||
} | ||
`, | ||
})); | ||
|
||
const Demo = () => { | ||
const { styles } = useStyles(); | ||
return ( | ||
<div className={styles.button}> | ||
<Button>按钮</Button> | ||
</div> | ||
); | ||
}; | ||
|
||
const App = () => { | ||
return ( | ||
<ThemeProvider appearance={'dark'} prefixCls={'a'}> | ||
<ThemeProvider appearance={'light'}> | ||
<Demo /> | ||
</ThemeProvider> | ||
</ThemeProvider> | ||
); | ||
}; | ||
export default App; |
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 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