@reown/appkit-ui
Version:
The full stack toolkit to build onchain app UX.
116 lines (99 loc) • 3.2 kB
JavaScript
import { css } from '../../utils/ThemeHelperUtil.js';
export default css `
label {
display: inline-flex;
align-items: center;
cursor: pointer;
user-select: none;
column-gap: ${({ spacing }) => spacing[2]};
}
label > input[type='checkbox'] {
height: 0;
width: 0;
opacity: 0;
position: absolute;
}
label > span {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
width: 100%;
border: 1px solid ${({ colors }) => colors.neutrals400};
color: ${({ colors }) => colors.white};
background-color: transparent;
will-change: border-color, background-color;
}
label > span > wui-icon {
opacity: 0;
will-change: opacity;
}
label > input[type='checkbox']:checked + span > wui-icon {
color: ${({ colors }) => colors.white};
}
label > input[type='checkbox']:not(:checked) > span > wui-icon {
color: ${({ colors }) => colors.neutrals900};
}
label > input[type='checkbox']:checked + span > wui-icon {
opacity: 1;
}
/* -- Sizes --------------------------------------------------- */
label[data-size='lg'] > span {
width: 24px;
height: 24px;
min-width: 24px;
min-height: 24px;
border-radius: ${({ borderRadius }) => borderRadius[10]};
}
label[data-size='md'] > span {
width: 20px;
height: 20px;
min-width: 20px;
min-height: 20px;
border-radius: ${({ borderRadius }) => borderRadius[2]};
}
label[data-size='sm'] > span {
width: 16px;
height: 16px;
min-width: 16px;
min-height: 16px;
border-radius: ${({ borderRadius }) => borderRadius[1]};
}
/* -- Focus states --------------------------------------------------- */
label > input[type='checkbox']:focus-visible + span,
label > input[type='checkbox']:focus + span {
border: 1px solid ${({ tokens }) => tokens.core.borderAccentPrimary};
box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2);
}
/* -- Checked states --------------------------------------------------- */
label > input[type='checkbox']:checked + span {
background-color: ${({ tokens }) => tokens.core.iconAccentPrimary};
border: 1px solid transparent;
}
/* -- Hover states --------------------------------------------------- */
input[type='checkbox']:not(:checked):not(:disabled) + span:hover {
border: 1px solid ${({ colors }) => colors.neutrals700};
background-color: ${({ colors }) => colors.neutrals800};
box-shadow: none;
}
input[type='checkbox']:checked:not(:disabled) + span:hover {
border: 1px solid transparent;
background-color: ${({ colors }) => colors.accent080};
box-shadow: none;
}
/* -- Disabled state --------------------------------------------------- */
label > input[type='checkbox']:checked:disabled + span {
border: 1px solid transparent;
opacity: 0.3;
}
label > input[type='checkbox']:not(:checked):disabled + span {
border: 1px solid ${({ colors }) => colors.neutrals700};
}
label:has(input[type='checkbox']:disabled) {
cursor: auto;
}
label > input[type='checkbox']:disabled + span {
cursor: not-allowed;
}
`;
//# sourceMappingURL=styles.js.map