Custom button component and WIP getting started documentation

This commit is contained in:
Luke committed 2022-03-01 18:25:46 +01:00
1 parent 9c3b63edc2
commit 818646734b
10 files changed
+97 -4

No files matched your search

+41
View File
@@ -0,0 +1,41 @@
import React from 'react';
interface Props {
icon: Element;
side: 'left' | 'right';
style?: React.CSSProperties;
}
const IconButton: React.FC<Props> = (props) => {
const iconStyles: React.CSSProperties = {
fontSize: '1.7rem',
paddingRight: props.side === 'left' && '0.6rem',
paddingLeft: props.side === 'right' && '0.6rem',
verticalAlign: 'center',
display: 'flex',
};
return (
<div
style={{
width: 'fit-content',
height: '3rem',
padding: '0.8rem',
borderRadius: '0.2rem',
verticalAlign: 'baseline',
textAlign: 'center',
...props.style,
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
}}
className="icon-button"
>
{props.side === 'left' && <div style={iconStyles}>{props.icon}</div>}
<div>{props.children}</div>
{props.side === 'right' && <div style={iconStyles}>{props.icon}</div>}
</div>
);
};
export default IconButton;
+19
View File
@@ -55,3 +55,22 @@
.navbar {
background-color: #1d252e;
}
.icon-button {
/* background-color: var(--ifm-color-primary-darkest); */
transition: 300ms;
border: 0.12rem solid var(--ifm-color-primary-darkest);
}
.icon-button:hover {
background-color: var(--ifm-color-primary-darkest);
cursor: pointer;
}
a,
a:hover,
a:focus,
a:active {
text-decoration: none;
color: inherit;
}