Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save brooksvb/78a54355151a18477e33c224177dc5fa to your computer and use it in GitHub Desktop.
Save brooksvb/78a54355151a18477e33c224177dc5fa to your computer and use it in GitHub Desktop.
These CSS tweaks are for higher density display for Uptime Kuma status pages in dark mode.
:root {
--min-item-width: 28ch;
--max-item-width: .5fr;
--grid-spacing: .25rem;
--item-padding: .25rem;
}
/* Let items expand on small screens */
@media (max-width: 600px) {
:root {
--max-item-width: 1fr;
}
}
/* Cap item width for better appearance on large screens */
@media (min-width: 2560px) {
:root {
--max-item-width: 300px;
}
}
/* Readability on 4K screens at distance */
@media (min-width: 3840px) {
.item-name {
font-size 1.3em;
font-weight: 700;
letter-spacing: 0.8px;
}
.badge {
font-size: .9em;
}
.wrap > .d-flex {
font-size: .9em;
font-weight: 500;
letter-spacing: .8px;
}
}
/* Expand container */
.container {
max-width: 98%
}
/* Grid layout */
.monitor-list > .monitor-list {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(var(--min-item-width), var(--max-item-width)));
grid-gap: var(--grid-spacing);
}
.item {
width: 100%;
padding: var(--item-padding) !important;
border: #3d3d3d solid 2px;
}
.item > .row {
flex-direction: column;
}
.row > div {
width: 100%;
}
/* Text readability */
.item-name {
color: #f1f1f1;
}
/* Badge movement */
.row {
position: relative;
}
body:not(.mobile) .badge {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
}
/* Header compacting */
.main {
position: relative;
}
.overall-status {
padding: .5rem !important;
}
body:not(.mobile) .overall-status {
position: absolute;
top: 0;
right: 0;
width: 50%;
}
/* Tweaks for mobile size */
body.mobile {}
/* Footer compacting */
footer .alert-heading {
padding: 0 !important;
}
/* Margin resets */
.mb-4, .mb-5 {
margin-bottom: .5rem !important;
}
.mt-4 {
margin-top: .5rem !important;
}
.mt-5 {
margin-top: 0 !important;
}
/* Reduce glaring blue maintenance color */
.bg-maintenance {
background-color: #4962bd !important;
}
@Jersuxs
Copy link

Jersuxs commented Oct 18, 2024

Better is:
`:root {
--min-item-width: 28ch;
--max-item-width: 1fr;
--grid-spacing: 0.5rem;
--item-padding: 1rem;
--primary-color: #6200ea;
--secondary-color: #bb86fc;
--background-color: #1c1c1c;
--text-color: #eaeaea;
--border-color: #444444;
--shadow-color: rgba(0, 0, 0, 0.5);
--hover-transform: scale(1.05);
}

body {
background: linear-gradient(135deg, var(--background-color), #0d0d0d);
color: var(--text-color);
font-family: 'Helvetica Neue', Arial, sans-serif;
margin: 0;
padding: 0;
overflow-x: hidden;
}

header, footer {
background-color: var(--primary-color);
color: #ffffff;
text-align: center;
padding: 1rem;
box-shadow: 0 2px 10px var(--shadow-color);
position: sticky;
z-index: 1000;
}

nav {
display: flex;
justify-content: center;
gap: 1rem;
margin: 1rem 0;
}

nav a {
color: var(--secondary-color);
text-decoration: none;
font-weight: 700;
transition: color 0.3s;
}

nav a:hover {
color: #ffffff;
}

.container {
max-width: 98%;
margin: auto;
padding: 1rem;
}

.monitor-list {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(var(--min-item-width), var(--max-item-width)));
gap: var(--grid-spacing);
}

.item {
background-color: #292929;
border: 1px solid var(--border-color);
border-radius: 10px;
padding: var(--item-padding);
box-shadow: 0 4px 15px var(--shadow-color);
transition: background-color 0.3s, transform 0.3s;
}

.item:hover {
background-color: #383838;
transform: var(--hover-transform);
}

.item-name {
color: var(--secondary-color);
font-size: 1.4em;
font-weight: 700;
}

.badge {
background-color: var(--primary-color);
border-radius: 12px;
padding: 0.5rem 1rem;
color: #ffffff;
font-size: 0.9em;
position: absolute;
bottom: 1rem;
left: 50%;
transform: translateX(-50%);
box-shadow: 0 2px 5px var(--shadow-color);
}

.row {
display: flex;
flex-direction: column;
position: relative;
}

@media (max-width: 600px) {
:root {
--max-item-width: 1fr;
}
}

@media (min-width: 2560px) {
:root {
--max-item-width: 300px;
}
}

@media (min-width: 3840px) {
.item-name {
font-size: 1.3em;
font-weight: 700;
letter-spacing: 0.8px;
}
.badge {
font-size: 0.9em;
}
.wrap > .d-flex {
font-size: 0.9em;
font-weight: 500;
letter-spacing: 0.8px;
}
}

.overall-status, .alert-heading, .mb-4, .mb-5, .mt-4, .mt-5 {
padding: 0.5rem !important;
margin: 0.5rem 0 !important;
}

.bg-maintenance {
background-color: #4962bd !important;
}
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment