tkr/public/css/default.css
2025-06-24 19:58:48 -04:00

241 lines
4.9 KiB
CSS

@charset "UTF-8";
:root {
--color-bg: white;
--color-border: black;
--color-delete-btn-bg: linen;
--color-delete-btn: #721c24;
--color-delete-btn-border: lightcoral;
--color-flash-error: #721c24;
--color-flash-error-bg: mistyrose;
--color-flash-error-border-left: crimson;
--color-flash-success: darkgreen;
--color-flash-success-bg: honeydew;
--color-flash-success-border-left: forestgreen;
--color-mood-border: darkslateblue;
--color-mood-hover: lightsteelblue;
--color-mood-selected: lightblue;
--color-primary: gainsboro;
--color-required: crimson;
--color-text: black;
--border-width: 2px;
--border-width-thin: 1px;
--border-radius: 4px;
}
/* default element styling */
body {
max-width: 940px;
margin: 0 auto;
padding: 2em;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
background-color: var(--color-bg);
color: var(--color-text);
}
/*a { font-weight: bold; } */
a { font-weight: bold; }
/*
Make the site description a little smaller,
but keep it an h1 for screen readers.
*/
h1.site-description {
font-size: 1.2rem;
margin-bottom: 1.2rem;
}
/* Navbar styling */
nav {
overflow: visible;
display: flex;
align-items: center;
}
nav a {
color: var(--color-text);
padding: 10px;
font-size: 16px;
text-align: center;
text-decoration: none;
border-radius: var(--border-radius);
}
nav > a:first-child {
padding-left: 0;
}
/*
Using details/summary tags to build dropdowm menus.
They have to be clicked open and closed, but they allow
me to have semantically appropriate pure HTML dropdowms
that work on mobile devices.
*/
details {
overflow: visible;
position: relative;
}
summary {
font-size: 16px;
padding: 10px;
color: var(--color-text);
font-weight: bold;
cursor: pointer;
list-style: none;
display: block;
border-radius: var(--border-radius);
}
/* Remove the default details arrow on different browsers*/
summary::-webkit-details-marker,
summary::-moz-list-bullet {
display: none;
list-style-type: none;
}
/* Add a downward-facing caret after the button label */
summary::after {
content: " ▼";
font-size: 0.8em;
margin-left: 1px;
}
/* Rotate the caret when opened */
details[open] summary::after { content: " ▲"; }
.dropdown-items{
position: absolute;
background-color: var(--color-bg);
border: var(--border-width-thin) solid var(--color-border);
border-radius: var(--border-radius);
min-width: 160px;
z-index: 1;
top: 100%;
left: 0;
}
.dropdown-items a {
float: none;
color: var(--color-text);
padding: 10px;
text-decoration: none;
display: block;
text-align: left;
}
nav a:hover,
nav a:focus,
summary:hover,
summary:focus,
.dropdown-items a:hover,
.dropdown-items a:focus {
background-color: var(--color-primary);
}
.home-container { display: grid; }
.home-sidebar {
padding-top: 1em;
padding-bottom: 1em;
}
.profile-data {
display: grid;
gap: 1rem;
margin: 0 0 1rem 0;
}
.profile-data dd { margin: 0; }
/* Hidden from visual display - screen reader only class */
/* https://www.sitelint.com/blog/hiding-a-text-but-making-it-accessible-to-a-screen-reader */
.profile-data dt {
border: 0;
clip: rect(0, 0, 0, 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
white-space: nowrap;
width: 1px;
}
/* container for greeting + mood emoji (wrapped in a <span>), and "change mood" link */
.profile-greeting {
display: flex;
justify-content: space-between;
align-items: center;
gap: 0.5rem;
}
/* add a small gap between the greeting and the mood emoji */
.profile-greeting-content {
display: flex;
align-items: baseline;
gap: 0.4em;
}
.profile-greeting-content-text {
font-weight: 600;
font-size: 1.1em;
}
.profile-about {
font-style: italic;
font-size: 0.95em;
}
.tick-feed {
list-style: none;
padding: 0;
margin: 0.5em 0 0 0;
}
.tick {
margin-bottom: 1em;
padding-left: 0.5em;
}
time {
color: var(--color-text);
font-size: 0.8em;
margin-bottom: 0.4em;
}
.tick-text {
color: var(--color-text);
font-size: 1.0em;
display: block;
}
.tick-pagination a {
margin: 0 5px;
text-decoration: none;
}
/*
Responsive layout - adjusts from 1 to 2 columns based on screen width
- min-width makes the mobile (stacked) view the default
- 600px covers most mobile devices in portrait mode
- Once the width exceeds that (e.g. desktops), it will convert to horizontal alignment
*/
@media (min-width: 600px) {
.home-container {
grid-template-columns: 1fr 2fr;
grid-gap: 2em;
}
.navbar { flex-wrap: wrap; }
.dropdown-menu {
position: fixed;
left: 1em;
right: 1em;
width: auto;
min-width: auto;
}
}