mirror of https://github.com/mifi/lossless-cut
make more consistent close button
parent
250506ad96
commit
250506404f
@ -0,0 +1,26 @@
|
||||
.close-button {
|
||||
all: unset;
|
||||
position: absolute;
|
||||
padding: .5em;
|
||||
margin: .2em;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
border-radius: 100%;
|
||||
font-size: 1.3em;
|
||||
|
||||
border: .1em solid transparent;
|
||||
color: var(--gray-12);
|
||||
background-color: none;
|
||||
transition: background-color 0.2s ease-in-out, transform 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.close-button:hover {
|
||||
background-color: var(--gray-4);
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.close-button:focus {
|
||||
border: .1em solid var(--gray-4);
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
import { FaTimes } from 'react-icons/fa';
|
||||
import { DetailedHTMLProps, ButtonHTMLAttributes } from 'react';
|
||||
|
||||
import styles from './CloseButton.module.css';
|
||||
import i18n from '../i18n';
|
||||
|
||||
export default function CloseButton({ type = 'button', ...props }: DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>) {
|
||||
return (
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading, react/button-has-type
|
||||
<button type={type} className={styles['close-button']} title={i18n.t('Close')} aria-label={i18n.t('Close')} {...props}>
|
||||
<FaTimes />
|
||||
</button>
|
||||
);
|
||||
}
|
||||
Loading…
Reference in New Issue