Files
pg-adminus/public/styles/responsive.css
2026-03-19 14:36:35 +07:00

280 lines
4.7 KiB
CSS

/* Responsive Design - Mobile First */
/* Extra Small Devices (< 640px) */
@media (max-width: 639px) {
body {
font-size: 14px;
}
h1 {
font-size: 1.5rem;
}
h2 {
font-size: 1.25rem;
}
h3 {
font-size: 1.1rem;
}
.card {
padding: 1rem;
}
.btn {
padding: 0.625rem 1rem;
font-size: 0.875rem;
}
.btn-icon {
width: 32px;
height: 32px;
padding: 0.5rem;
}
/* Hide elements on small screens */
.hidden-mobile {
display: none;
}
/* Stack grid on mobile */
.grid-responsive {
grid-template-columns: 1fr;
}
/* Full width modals */
.modal {
margin: 1rem;
}
/* Navigation sidebar to drawer on mobile */
#sidebar {
position: fixed;
left: 0;
top: 4rem;
height: calc(100vh - 4rem);
width: 100%;
max-width: 256px;
transition: transform 0.3s ease;
}
#sidebar.hidden {
transform: translateX(-100%);
}
/* Adjust table for small screens */
table {
font-size: 0.875rem;
}
thead th {
padding: 0.5rem;
}
tbody td {
padding: 0.5rem;
}
/* Stack table rows */
.table-responsive {
display: block;
overflow-x: auto;
white-space: nowrap;
}
/* Adjust forms */
.form-group {
margin-bottom: 1rem;
}
.form-group label {
display: block;
margin-bottom: 0.5rem;
font-size: 0.875rem;
}
/* Responsive header */
header {
padding: 0.5rem 1rem;
}
.header-title {
font-size: 1rem;
}
}
/* Small Devices (640px - 768px) */
@media (min-width: 640px) and (max-width: 767px) {
.card {
padding: 1.5rem;
}
.grid-responsive {
grid-template-columns: repeat(2, 1fr);
}
table {
font-size: 0.9375rem;
}
}
/* Medium Devices (768px - 1024px) && ipads */
@media (min-width: 768px) {
.hidden-md-down {
display: none;
}
.hidden-md-up {
display: block;
}
#sidebar {
transform: translateX(0) !important;
position: static;
}
.grid-responsive {
grid-template-columns: repeat(2, 1fr);
}
}
/* Large Devices (1024px+) && desktops */
@media (min-width: 1024px) {
.grid-responsive {
grid-template-columns: repeat(3, 1fr);
}
.grid-responsive.grid-4 {
grid-template-columns: repeat(4, 1fr);
}
#sidebar {
display: block !important;
}
.hidden-lg-down {
display: none;
}
.hidden-lg-up {
display: block;
}
/* Show more columns on desktop */
.table-hidden-mobile {
display: table-cell;
}
}
/* Extra Large Devices (1280px+) */
@media (min-width: 1280px) {
body {
font-size: 16px;
}
.container-xl {
max-width: 1280px;
margin: 0 auto;
}
.grid-responsive.grid-4 {
grid-template-columns: repeat(4, 1fr);
}
.grid-responsive.grid-5 {
grid-template-columns: repeat(5, 1fr);
}
}
/* Portrait vs Landscape */
@media (orientation: portrait) {
.landscape-hidden {
display: none;
}
}
@media (orientation: landscape) {
.portrait-hidden {
display: none;
}
.h-screen {
max-height: 100vh;
}
}
/* Touch devices optimization */
@media (hover: none) and (pointer: coarse) {
.btn,
.nav-item {
padding: 1rem;
min-height: 44px;
min-width: 44px;
}
/* Remove hover effects on touch devices */
.btn:hover {
transform: none;
}
button:active {
transform: scale(0.98);
}
}
/* Print styles */
@media print {
header,
nav,
.no-print {
display: none;
}
body {
background: white;
color: black;
}
.card {
page-break-inside: avoid;
border: 1px solid #ccc;
}
.btn {
display: none;
}
}
/* High DPI screens (Retina) */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
/* Optimize images and borders */
body {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
}
/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
* {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}
/* Dark mode media query */
@media (prefers-color-scheme: dark) {
:root {
color-scheme: dark;
}
}
/* Light mode media query */
@media (prefers-color-scheme: light) {
:root {
color-scheme: light;
}
}