@buun_group/brutalist-ui
Version:
A brutalist-styled component library
371 lines (317 loc) • 8.02 kB
CSS
/* Sheet Component Styles */
.trigger {
/* Inherit button styles from existing button component */
display: inline-flex;
align-items: center;
justify-content: center;
padding: var(--brutal-space-3) var(--brutal-space-6);
background-color: var(--brutal-white);
border: var(--brutal-border-width) solid var(--brutal-black);
color: var(--brutal-black);
font-family: var(--brutal-font-mono);
font-weight: var(--brutal-font-bold);
text-transform: uppercase;
cursor: pointer;
transition: var(--brutal-transition-base);
box-shadow: var(--brutal-shadow);
}
.trigger:hover {
background-color: var(--brutal-gray-100);
transform: translate(-2px, -2px);
box-shadow: var(--brutal-shadow-lg);
}
.trigger:active {
transform: translate(0, 0);
box-shadow: var(--brutal-shadow-sm);
}
/* Overlay */
.overlay {
position: fixed;
inset: 0;
background-color: rgba(0, 0, 0, 0.8);
z-index: 9998;
animation: fadeIn 0.2s ease-out;
}
.overlay[data-variant="brutal"] {
background-color: rgba(255, 0, 110, 0.3);
}
.overlay[data-variant="outline"] {
background-color: rgba(0, 0, 0, 0.5);
}
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
/* Content Base */
.content {
--brutal-sheet-bg: var(--brutal-white);
--brutal-sheet-border: var(--brutal-black);
--brutal-sheet-border-width: 4px;
--brutal-sheet-shadow: 8px 8px 0px var(--brutal-black);
--brutal-sheet-text: var(--brutal-black);
position: fixed;
background-color: var(--brutal-sheet-bg);
border: var(--brutal-sheet-border-width) solid var(--brutal-sheet-border);
box-shadow: var(--brutal-sheet-shadow);
z-index: 9999;
display: flex;
flex-direction: column;
transition: transform 0.3s ease-out;
font-family: var(--brutal-font-mono);
color: var(--brutal-sheet-text);
}
/* Side variants */
.side-left {
top: 0;
left: 0;
bottom: 0;
transform: translateX(-100%);
border-right: var(--brutal-sheet-border-width) solid var(--brutal-sheet-border);
border-left: none;
}
.side-left[data-state="open"] {
transform: translateX(0);
}
.side-right {
top: 0;
right: 0;
bottom: 0;
transform: translateX(100%);
border-left: var(--brutal-sheet-border-width) solid var(--brutal-sheet-border);
border-right: none;
}
.side-right[data-state="open"] {
transform: translateX(0);
}
.side-top {
top: 0;
left: 0;
right: 0;
transform: translateY(-100%);
border-bottom: var(--brutal-sheet-border-width) solid var(--brutal-sheet-border);
border-top: none;
}
.side-top[data-state="open"] {
transform: translateY(0);
}
.side-bottom {
bottom: 0;
left: 0;
right: 0;
transform: translateY(100%);
border-top: var(--brutal-sheet-border-width) solid var(--brutal-sheet-border);
border-bottom: none;
}
.side-bottom[data-state="open"] {
transform: translateY(0);
}
/* Size variants */
.size-sm {
--brutal-sheet-size: 300px;
}
.size-md {
--brutal-sheet-size: 400px;
}
.size-lg {
--brutal-sheet-size: 500px;
}
.size-xl {
--brutal-sheet-size: 600px;
}
.size-full {
--brutal-sheet-size: 100%;
}
/* Apply sizes to sides */
.side-left,
.side-right {
width: var(--brutal-sheet-size);
max-width: 90vw;
}
.side-top,
.side-bottom {
height: var(--brutal-sheet-size);
max-height: 90vh;
}
/* Style variants */
.variant-default {
--brutal-sheet-bg: var(--brutal-white);
--brutal-sheet-border: var(--brutal-black);
--brutal-sheet-text: var(--brutal-black);
--brutal-sheet-shadow: 8px 8px 0px var(--brutal-black);
}
.variant-brutal {
--brutal-sheet-bg: var(--brutal-accent);
--brutal-sheet-border: var(--brutal-black);
--brutal-sheet-text: var(--brutal-white);
--brutal-sheet-shadow: 8px 8px 0px var(--brutal-black);
}
.variant-outline {
--brutal-sheet-bg: transparent;
--brutal-sheet-border: var(--brutal-black);
--brutal-sheet-text: var(--brutal-black);
--brutal-sheet-shadow: none;
backdrop-filter: blur(10px);
}
/* Header */
.header {
padding: var(--brutal-space-6) var(--brutal-space-6) var(--brutal-space-4);
border-bottom: var(--brutal-border-width) solid var(--brutal-sheet-border);
background-color: var(--brutal-sheet-bg);
flex-shrink: 0;
}
.variant-brutal .header {
border-bottom-color: var(--brutal-white);
}
.variant-outline .header {
border-bottom-color: var(--brutal-black);
background-color: rgba(255, 255, 255, 0.9);
}
/* Title */
.title {
font-family: var(--brutal-font-mono);
font-weight: var(--brutal-font-bold);
font-size: var(--brutal-text-xl);
text-transform: uppercase;
letter-spacing: 0.05em;
margin: 0;
color: var(--brutal-sheet-text);
}
/* Description */
.description {
font-family: var(--brutal-font-mono);
font-size: var(--brutal-text-sm);
color: var(--brutal-sheet-text);
opacity: 0.8;
margin: var(--brutal-space-2) 0 0 0;
line-height: 1.5;
}
/* Footer */
.footer {
padding: var(--brutal-space-4) var(--brutal-space-6) var(--brutal-space-6);
border-top: var(--brutal-border-width) solid var(--brutal-sheet-border);
background-color: var(--brutal-sheet-bg);
flex-shrink: 0;
display: flex;
gap: var(--brutal-space-3);
justify-content: flex-end;
}
.variant-brutal .footer {
border-top-color: var(--brutal-white);
}
.variant-outline .footer {
border-top-color: var(--brutal-black);
background-color: rgba(255, 255, 255, 0.9);
}
/* Close button */
.close {
display: inline-flex;
align-items: center;
justify-content: center;
padding: var(--brutal-space-2) var(--brutal-space-4);
background-color: var(--brutal-white);
border: var(--brutal-border-width) solid var(--brutal-black);
color: var(--brutal-black);
font-family: var(--brutal-font-mono);
font-weight: var(--brutal-font-bold);
text-transform: uppercase;
cursor: pointer;
transition: var(--brutal-transition-base);
box-shadow: var(--brutal-shadow-sm);
}
.close:hover {
background-color: var(--brutal-gray-100);
transform: translate(-1px, -1px);
box-shadow: var(--brutal-shadow);
}
.close:active {
transform: translate(0, 0);
box-shadow: var(--brutal-shadow-sm);
}
.variant-brutal .close {
background-color: var(--brutal-white);
color: var(--brutal-black);
}
.variant-outline .close {
background-color: transparent;
color: var(--brutal-black);
}
/* Focus styles */
.content:focus-visible {
outline: 2px solid var(--brutal-accent);
outline-offset: 2px;
}
.trigger:focus-visible,
.close:focus-visible {
outline: 2px solid var(--brutal-accent);
outline-offset: 2px;
}
/* Responsive adjustments */
@media (max-width: 768px) {
.side-left,
.side-right {
width: 90vw;
max-width: none;
}
.side-top,
.side-bottom {
height: 70vh;
max-height: none;
}
.header {
padding: var(--brutal-space-4);
}
.footer {
padding: var(--brutal-space-4);
}
}
/* Dark mode support */
@media (prefers-color-scheme: dark) {
.variant-default {
--brutal-sheet-bg: var(--brutal-gray-900);
--brutal-sheet-border: var(--brutal-gray-300);
--brutal-sheet-text: var(--brutal-white);
--brutal-sheet-shadow: 8px 8px 0px var(--brutal-gray-300);
}
.variant-outline {
--brutal-sheet-border: var(--brutal-gray-300);
--brutal-sheet-text: var(--brutal-white);
}
.variant-outline .header,
.variant-outline .footer {
background-color: rgba(26, 26, 26, 0.9);
}
.close {
background-color: var(--brutal-gray-800);
color: var(--brutal-white);
border-color: var(--brutal-gray-300);
}
.close:hover {
background-color: var(--brutal-gray-700);
}
.trigger {
background-color: var(--brutal-gray-800);
color: var(--brutal-white);
border-color: var(--brutal-gray-300);
}
.trigger:hover {
background-color: var(--brutal-gray-700);
}
}
/* Animation improvements */
@media (prefers-reduced-motion: reduce) {
.content,
.overlay {
animation: none;
transition: none;
}
}
/* High contrast mode support */
@media (prefers-contrast: high) {
.content {
--brutal-sheet-border-width: 6px;
}
}