generated from arvinxx/npm-template
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat: styled 方法底层实现替换为 styled-component 以默认支持组件选择器
BREAKING CHANGES: 由于 emotion/react 版本的 styled 无法默认支持组件选择器。虽然可以用 babel-plugin 配置,但是太过于复杂,因此考虑直接替换为styled-components
- Loading branch information
Showing
6 changed files
with
169 additions
and
37 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
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,11 +1,8 @@ | ||
export { | ||
css as reactCss, | ||
ThemeProvider as EmotionThemeProvider, | ||
useTheme, | ||
withTheme, | ||
} from '@emotion/react'; | ||
export { css as reactCss } from '@emotion/react'; | ||
// styled 配套的 | ||
export { ThemeProvider as PedestalProvider, useTheme, withTheme } from 'styled-components'; | ||
|
||
// styled 方法 | ||
import type { CreateStyled } from '@/types'; | ||
import _styled from '@emotion/styled'; | ||
export const styled = _styled as CreateStyled; | ||
import _styled from 'styled-components'; | ||
export const styled = _styled as unknown as CreateStyled; |
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