Files
CWC/styles/base/global.css
T
Keith Solomon 7267f67d99
Deploy to Dreamhost (dev) / build (push) Successful in 36s
Sync TODOs with Issues / sync_todos (push) Successful in 6s
🐞 fix: Update chrome tint visibility handling to prevent dark bars over page content and enhance related tests
2026-07-12 15:13:55 -05:00

122 lines
3.4 KiB
CSS

/* Miscellaneous custom styles */
@theme {
--spacing-menu-top: calc(100% + .9375rem);
--spacing-section: 2rem;
--shadow-menu-shadow: 0 .25rem .375rem rgba(0,0,0,0.1);
/** Breakpoints
* The breakpoints are set to match the default Tailwind breakpoints.
* You can override them here if you want to use different breakpoints.
*
* @see https://tailwindcss.com/docs/breakpoints
*/
--breakpoint-*: initial;
--breakpoint-xxs: 22.5rem; /* 360px */
--breakpoint-xs: 29.6875rem; /* 475px */
--breakpoint-sm: 40rem; /* 640px */
--breakpoint-md: 48rem; /* 768px */
--breakpoint-lg: 64rem; /* 1024px */
--breakpoint-xl: 70rem; /* 1280px */
--breakpoint-2xl: 96rem; /* 1536px */
}
/* Basic layout styles */
main#maincontent {
background-color: var(--color-background);
color: var(--color-text);
margin: 0;
padding: 0 0 5rem;
}
.container {
margin: 0 auto;
max-width: 80.5rem;
padding-inline: clamp(1.5rem, 5vw, 3rem);
width: 100%;
&.wider { max-width: 85rem; }
}
.section {
@apply relative my-section px-section;
&:first-child { @apply mt-0; }
&:last-child, p:last-child { @apply mb-0; }
&.has-background { @apply py-section bg-cover bg-no-repeat; }
}
/** Allows containers inside containers
*
* .container .wp-block-section {
* @apply mx-break-out;
* }
*/
.content-wrapper {
.alignfull { @apply max-w-full; }
.alignwide { @apply max-w-full; }
.alignleft { @apply ml-0 mr-auto float-none; }
.alignright { @apply ml-auto mr-0 float-none; }
.aligncenter { @apply mx-auto; }
}
/* Responsive embeds */
.embed { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; }
.embed iframe, .embed object, .embed embed, .embed video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
/*
* Chrome tint elements.
*
* iOS 26+ Safari samples the background-color of position: fixed
* elements within 4px of the top or 3px of the bottom of the viewport
* to tint the browser chrome (status bar / home indicator). The
* elements below are placed inside those sampling windows and their
* backgroundColor is updated at runtime by
* static/js/modules/ChromeTint.js.
*
* visibility: hidden keeps the elements invisible to the user (so
* they don't appear as dark bars over the page content) while iOS
* Safari still samples their backgroundColor. The WebKit source
* explicitly notes that visibility: hidden elements ARE sampled.
*
* The elements are kept as small as possible (12px tall) so they
* stay well within the iOS safe-area insets. They have no background
* by default — they only get a backgroundColor when the matching
* element (header / footer) is in view. pointer-events: none ensures
* they never intercept clicks even if made visible.
*
* (iOS 26 ignores <meta name="theme-color">; this technique is
* what replaced it.)
*/
.chrome-tint {
pointer-events: none;
position: fixed;
visibility: hidden;
z-index: 9999;
}
.chrome-tint--top {
left: 0;
min-height: 12px;
top: 4px;
/* 4px from top + 12px tall = within the 4px-to-12px iOS 26
sampling window for top status bar tinting. */
width: 90%;
/* width: 90% > 80% iOS minimum for being sampled. */
}
.chrome-tint--bottom {
bottom: 3px;
/* 3px from bottom = within the 3px iOS sampling window. */
left: 0;
min-height: 12px;
width: 90%;
}