2022-12-08 12:14:18 +08:00
|
|
|
import { css, Global } from '@emotion/react';
|
|
|
|
import React from 'react';
|
2023-07-20 19:27:33 +08:00
|
|
|
import { useTheme } from 'antd-style';
|
2022-12-08 12:14:18 +08:00
|
|
|
|
|
|
|
export default () => {
|
2023-07-20 19:27:33 +08:00
|
|
|
const token = useTheme();
|
2022-12-08 12:14:18 +08:00
|
|
|
|
|
|
|
const { antCls, iconCls } = token;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Global
|
|
|
|
styles={css`
|
2022-12-19 13:23:28 +08:00
|
|
|
ul.anticons-list {
|
|
|
|
margin: 10px 0;
|
|
|
|
overflow: hidden;
|
|
|
|
direction: ltr;
|
|
|
|
list-style: none;
|
|
|
|
|
|
|
|
li {
|
|
|
|
position: relative;
|
|
|
|
float: left;
|
|
|
|
width: 16.66%;
|
|
|
|
height: 100px;
|
|
|
|
margin: 3px 0;
|
|
|
|
padding: 10px 0 0;
|
2022-12-08 12:14:18 +08:00
|
|
|
overflow: hidden;
|
2022-12-19 13:23:28 +08:00
|
|
|
color: #555;
|
|
|
|
text-align: center;
|
2022-12-08 12:14:18 +08:00
|
|
|
list-style: none;
|
2022-12-19 13:23:28 +08:00
|
|
|
background-color: inherit;
|
|
|
|
border-radius: 4px;
|
|
|
|
cursor: pointer;
|
|
|
|
transition: color 0.3s ease-in-out, background-color 0.3s ease-in-out;
|
2022-12-08 12:14:18 +08:00
|
|
|
|
2022-12-19 13:23:28 +08:00
|
|
|
.rtl & {
|
2022-12-08 12:14:18 +08:00
|
|
|
margin: 3px 0;
|
|
|
|
padding: 10px 0 0;
|
2022-12-19 13:23:28 +08:00
|
|
|
}
|
2022-12-08 12:14:18 +08:00
|
|
|
|
2022-12-19 13:23:28 +08:00
|
|
|
${iconCls} {
|
|
|
|
margin: 12px 0 8px;
|
|
|
|
font-size: 36px;
|
|
|
|
transition: transform 0.3s ease-in-out;
|
|
|
|
will-change: transform;
|
|
|
|
}
|
2022-12-08 12:14:18 +08:00
|
|
|
|
2022-12-19 13:23:28 +08:00
|
|
|
.anticon-class {
|
|
|
|
display: block;
|
|
|
|
font-family: 'Lucida Console', Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono',
|
|
|
|
monospace;
|
|
|
|
white-space: nowrap;
|
|
|
|
text-align: center;
|
|
|
|
transform: scale(0.83);
|
2022-12-08 12:14:18 +08:00
|
|
|
|
2022-12-19 13:23:28 +08:00
|
|
|
${antCls}-badge {
|
|
|
|
transition: color 0.3s ease-in-out;
|
2022-12-08 12:14:18 +08:00
|
|
|
}
|
2022-12-19 13:23:28 +08:00
|
|
|
}
|
2022-12-08 12:14:18 +08:00
|
|
|
|
2022-12-19 13:23:28 +08:00
|
|
|
&:hover {
|
|
|
|
color: #fff;
|
|
|
|
background-color: ${token.colorPrimary};
|
2022-12-08 12:14:18 +08:00
|
|
|
|
2022-12-19 13:23:28 +08:00
|
|
|
${iconCls} {
|
|
|
|
transform: scale(1.4);
|
2022-12-08 12:14:18 +08:00
|
|
|
}
|
|
|
|
|
2022-12-19 13:23:28 +08:00
|
|
|
${antCls}-badge {
|
2022-12-08 12:14:18 +08:00
|
|
|
color: #fff;
|
|
|
|
}
|
2022-12-19 13:23:28 +08:00
|
|
|
}
|
2022-12-08 12:14:18 +08:00
|
|
|
|
2022-12-19 13:23:28 +08:00
|
|
|
&.TwoTone:hover {
|
|
|
|
background-color: #8ecafe;
|
2022-12-08 12:14:18 +08:00
|
|
|
}
|
|
|
|
|
2022-12-19 13:23:28 +08:00
|
|
|
&.copied:hover {
|
|
|
|
color: rgba(255, 255, 255, 0.2);
|
|
|
|
}
|
|
|
|
|
|
|
|
&::after {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
color: #fff;
|
|
|
|
line-height: 110px;
|
|
|
|
text-align: center;
|
|
|
|
background: #1677ff;
|
|
|
|
opacity: 0;
|
|
|
|
transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
|
|
|
|
content: 'Copied!';
|
|
|
|
}
|
|
|
|
|
|
|
|
&.copied::after {
|
|
|
|
opacity: 1;
|
|
|
|
}
|
2022-12-08 12:14:18 +08:00
|
|
|
}
|
2022-12-19 13:23:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.copied-code {
|
|
|
|
padding: 2px 4px;
|
|
|
|
font-size: 12px;
|
|
|
|
background: #f5f5f5;
|
|
|
|
border-radius: 2px;
|
|
|
|
}
|
|
|
|
`}
|
2022-12-08 12:14:18 +08:00
|
|
|
/>
|
|
|
|
);
|
|
|
|
};
|