-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
39d6ff0
commit e7b7ea2
Showing
6 changed files
with
86 additions
and
8 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 |
---|---|---|
@@ -1,7 +1,11 @@ | ||
import { AccountBookFilled } from '@lotus-design/icons'; | ||
import React from 'react'; | ||
import { AccountBookFilled, AccountBookOutlined, } from '@lotus-design/icons'; | ||
|
||
export default () => { | ||
return ( | ||
<AccountBookFilled /> | ||
<> | ||
<AccountBookFilled /> | ||
<AccountBookOutlined spin /> | ||
</> | ||
) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import { useContext, useEffect } from 'react'; | ||
import IconContext from '../components/Context'; | ||
import { updateCSS } from 'rc-util/lib/Dom/dynamicCSS'; | ||
|
||
|
||
export const useInsertStyles = (styleStr?: string) => { | ||
const { csp, prefixCls = 'lotus-icon' } = useContext(IconContext); | ||
|
||
useEffect(() => { | ||
updateCSS(styleStr ?? getIconStyles(prefixCls), 'lotus-design-icons', { | ||
prepend: true, | ||
csp, | ||
}); | ||
}, []); | ||
}; | ||
|
||
function getIconStyles (prefixCls: string) { | ||
return ` | ||
.${prefixCls} { | ||
display: inline-block; | ||
color: inherit; | ||
font-style: normal; | ||
line-height: 0; | ||
text-align: center; | ||
text-transform: none; | ||
vertical-align: -0.125em; | ||
text-rendering: optimizeLegibility; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
} | ||
.${prefixCls} > * { | ||
line-height: 1; | ||
} | ||
.${prefixCls} svg { | ||
display: inline-block; | ||
} | ||
.${prefixCls}::before { | ||
display: none; | ||
} | ||
.${prefixCls}[tabindex] { | ||
cursor: pointer; | ||
} | ||
.${prefixCls}-spin::before, | ||
.${prefixCls}-spin { | ||
display: inline-block; | ||
-webkit-animation: loadingCircle 1s infinite linear; | ||
animation: loadingCircle 1s infinite linear; | ||
} | ||
@-webkit-keyframes loadingCircle { | ||
100% { | ||
-webkit-transform: rotate(360deg); | ||
transform: rotate(360deg); | ||
} | ||
} | ||
@keyframes loadingCircle { | ||
100% { | ||
-webkit-transform: rotate(360deg); | ||
transform: rotate(360deg); | ||
} | ||
} | ||
` | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.