@buun_group/brutalist-ui
Version:
A brutalist-styled component library
244 lines (211 loc) • 4.75 kB
CSS
/* Root container */
.root {
position: relative;
display: inline-block;
}
/* Trigger */
.trigger {
cursor: pointer;
display: inline-block;
}
/* Content */
.content {
background-color: var(--brutal-white);
border: var(--brutal-border-width) var(--brutal-border-style) var(--brutal-black);
padding: var(--brutal-space-4);
min-width: 200px;
max-width: 360px;
animation: fadeIn var(--brutal-transition-fast);
transform-origin: var(--radix-hover-card-content-transform-origin);
}
.contentInner {
position: relative;
z-index: 1;
}
/* Shadow effect */
.withShadow {
box-shadow: var(--brutal-shadow-lg);
}
/* Position variants */
.top {
margin-bottom: var(--brutal-space-2);
}
.right {
margin-left: var(--brutal-space-2);
}
.bottom {
margin-top: var(--brutal-space-2);
}
.left {
margin-right: var(--brutal-space-2);
}
/* Arrow */
.arrow {
position: absolute;
width: 0;
height: 0;
border-style: solid;
z-index: 0;
}
/* Arrow positioning based on side */
.arrow[data-side="top"] {
bottom: -8px;
left: 50%;
transform: translateX(-50%);
border-width: 8px 8px 0 8px;
border-color: var(--brutal-black) transparent transparent transparent;
}
.arrow[data-side="top"]::before {
content: '';
position: absolute;
bottom: 3px;
left: -6px;
width: 0;
height: 0;
border-style: solid;
border-width: 6px 6px 0 6px;
border-color: var(--brutal-white) transparent transparent transparent;
}
.arrow[data-side="right"] {
left: -8px;
top: 50%;
transform: translateY(-50%);
border-width: 8px 8px 8px 0;
border-color: transparent var(--brutal-black) transparent transparent;
}
.arrow[data-side="right"]::before {
content: '';
position: absolute;
left: 3px;
top: -6px;
width: 0;
height: 0;
border-style: solid;
border-width: 6px 6px 6px 0;
border-color: transparent var(--brutal-white) transparent transparent;
}
.arrow[data-side="bottom"] {
top: -8px;
left: 50%;
transform: translateX(-50%);
border-width: 0 8px 8px 8px;
border-color: transparent transparent var(--brutal-black) transparent;
}
.arrow[data-side="bottom"]::before {
content: '';
position: absolute;
top: 3px;
left: -6px;
width: 0;
height: 0;
border-style: solid;
border-width: 0 6px 6px 6px;
border-color: transparent transparent var(--brutal-white) transparent;
}
.arrow[data-side="left"] {
right: -8px;
top: 50%;
transform: translateY(-50%);
border-width: 8px 0 8px 8px;
border-color: transparent transparent transparent var(--brutal-black);
}
.arrow[data-side="left"]::before {
content: '';
position: absolute;
right: 3px;
top: -6px;
width: 0;
height: 0;
border-style: solid;
border-width: 6px 0 6px 6px;
border-color: transparent transparent transparent var(--brutal-white);
}
/* Animation */
@keyframes fadeIn {
from {
opacity: 0;
transform: scale(0.95);
}
to {
opacity: 1;
transform: scale(1);
}
}
/* Typography within hover card */
.content h1,
.content h2,
.content h3,
.content h4,
.content h5,
.content h6 {
font-family: var(--brutal-font-mono);
font-weight: var(--brutal-font-black);
text-transform: uppercase;
margin: 0 0 var(--brutal-space-2) 0;
}
.content p {
font-family: var(--brutal-font-mono);
font-size: var(--brutal-text-sm);
line-height: 1.5;
margin: 0 0 var(--brutal-space-3) 0;
}
.content p:last-child {
margin-bottom: 0;
}
/* Links within hover card */
.content a {
color: var(--brutal-accent);
text-decoration: underline;
text-decoration-thickness: 2px;
text-underline-offset: 2px;
font-weight: var(--brutal-font-bold);
transition: var(--brutal-transition-fast);
}
.content a:hover {
color: var(--brutal-accent-dark);
text-decoration-color: var(--brutal-accent-dark);
}
/* Hover card specific styles */
.profileCard {
display: flex;
gap: var(--brutal-space-4);
align-items: flex-start;
}
.profileAvatar {
width: 60px;
height: 60px;
border: var(--brutal-border-width) var(--brutal-border-style) var(--brutal-black);
background-color: var(--brutal-gray-100);
flex-shrink: 0;
}
.profileInfo {
flex: 1;
min-width: 0;
}
.profileName {
font-size: var(--brutal-text-lg);
margin-bottom: var(--brutal-space-1) ;
}
.profileBio {
color: var(--brutal-gray-600);
margin-bottom: var(--brutal-space-3) ;
}
.profileStats {
display: flex;
gap: var(--brutal-space-4);
font-size: var(--brutal-text-sm);
}
.profileStat {
display: flex;
flex-direction: column;
gap: var(--brutal-space-1);
}
.profileStatValue {
font-weight: var(--brutal-font-black);
color: var(--brutal-black);
}
.profileStatLabel {
color: var(--brutal-gray-600);
text-transform: uppercase;
font-size: var(--brutal-text-xs);
}